https://community.cloudflare.com/t/cant-access-bound-d1-database-from-cloudflare-pages/552176/5 Hi i
https://community.cloudflare.com/t/cant-access-bound-d1-database-from-cloudflare-pages/552176/5 Hi is wrangler version 3.7.0 fix that bug?
request.url has the URL. I'd suggest reading the MDN docs on how to parse URLs (https://developer.mozilla.org/en-US/docs/Web/API/URL) and/or moving over to #workers-help for non-D1 specific questions

9/11/23, 2:36 PM

RETURNING
9/13/23, 8:59 PM
bun:sqlite instead of better-sqlite3.export default {
async fetch(request, env, ctx) {
const res = await env.DB.prepare('SELECT 1;').all()
return new Response(JSON.stringify(res, null, 2));
},
};{
....
"results": [
{
"1": 1
}
]
}request.urlRETURNINGError: D1_ERROR: Error: SQL execute error: Execute returned results - did you mean to call query?bun:sqlitebetter-sqlite3const d1_lookup_code = await c.env.DB.prepare(`SELECT id, program, details FROM my_codes WHERE code = ?`).bind(code).first();
await c.env.DB.prepare(`DELETE FROM my_codes WHERE code = ?`).bind(code).run();await c.env.DB.prepare(`DELETE FROM my_codes WHERE code = ? RETURNING *`).bind(code).run()await c.env.DB.prepare(`DELETE FROM my_codes WHERE code = ? RETURNING *`).bind(code).first()