EXPLAIN <yourSQLquery> also helps you figure out what SQLite will do and see if you miss indexes.
SQLITE_ERROR errors are coming from SQLite itself, so those are probably not fixable by retries. Retries improve issues like networking hiccups, or servers going down, or other transient things.cause: Error: D1_ERROR: Failed to parse body as JSON, got: error code: 1031 and i have no idea what causes it. I restart my server an it stops doing itFailed to parse body as JSON is thrown when the request body is not a valid JSON, before even validating the actual contents.db = drizzle(env.DB)Error: Failed query: select "id", "uid". . .

Failed query: ${sql string} ; It's all like this, whether it's select, delete or insert.Error: D1_ERROR: Currently processing a long-running export.EXPLAIN <yourSQLquery>import { customType } from "drizzle-orm/sqlite-core";
// Custom date type for D1 compatibility - converts Date objects to/from Unix timestamps
// Required for better-auth to work with Cloudflare D1 which doesn't support Date objects
export const D1DateTime = customType<{
data: Date | null;
driverData: number | null;
}>({
dataType() {
return "integer";
},
fromDriver(value: number | null): Date | null {
return value ? new Date(value * 1000) : null; // Convert from Unix seconds to Date
},
toDriver(value: Date | null): number | null {
return value ? Math.floor(value.getTime() / 1000) : null; // Convert Date to Unix seconds
},
});SQLITE_ERRORcause: Error: D1_ERROR: Failed to parse body as JSON, got: error code: 1031Failed to parse body as JSONdb = drizzle(env.DB)Error: Failed query: select "id", "uid". . .Failed query: ${sql string}Error: D1_ERROR: Currently processing a long-running export.