Hey, does anybody have an example implementation of next-auth + d1 for next.js?
Hey, does anybody have an example implementation of next-auth + d1 for next.js?
DATETIME column, and when I run a query using WHERE xyz BETWEEN ? AND ? and passing in a date it always results in Type 'object' not supported for value 'Thu Apr 04 2024 23:54:22 GMT+0200 (Central European Summer Time)' which obviously means that the D1 client apparently cannot handle date objects. It works when passing in an ISO string, but it's really annoying when working with ORMs and schema libraries. So is there a known workaround or am I somehow using an outdated version?text datesISO8601 datesError: D1_ERROR: no such table: countries


wrangler pages dev .svelte-kit/cloudflare --remote no support for --remote argswrangler d1 export i believewrangler d1 export YOUR_DB_NAME --output db.sql --remote && wrangler d1 execute YOUR_DB_BINDING_NAME --local --file db.sql
integer('id', { mode: 'timestamp' }) behaves in a similar way{"error":"Unauthorized, missing DB in environment"}
Error: D1_ERROR: Wrong number of parameter bindings for SQL query.const timestamp = customType<
{ data: Date; driverData: string; }
>({
dataType() {
return 'text';
},
fromDriver(value: string): Date {
return new Date(value);
},
toDriver(value: Date): string {
try {
return value.toISOString();
} catch (e) {
console.log(`failed to covert ${JSON.stringify(value)} to iso string`)
throw e;
}
},
});select "id", "mem_type", "name", "email", "tickets_used", "tickets_remaining", "end_date" from "members" where
"members"."end_date" < date('now', '+? days')
AND "members"."end_date" > date('now', '+? days')
AND NOT EXISTS (
SELECT 1
FROM "emails"
WHERE "members"."id" = "emails"."mem_id"
AND "emails"."time_sent" < date('now', '-? days')
)
-- params: [7, 1, 7]