Surely someones created a worker template for this by now
Surely someones created a worker template for this by now
lower() and upper() supposed to work with non latin or accented characters? select lower('Édith Piaf'); returns "Édith piaf" - which obviously isn't lower case. Therefor many of my exact searches fail.What if I read something but it does not result in any row (no row exist for that query in the db)Rows are still read to search for that row, so yes it will count.
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.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
},
});