CF doesn't tell us why, one said to stop using the product, we just can't connect to the db
CF doesn't tell us why, one said to stop using the product, we just can't connect to the db


wrangler.toml works. Is this a Workers or a Pages project?await db.exec("PRAGMA table_list") - and nothing else? Your binding appears fine. You aren't returning any results (because it's an INSERT without any RETURNING) - what do you expect to happen? It should just insert without an error.[vars] table will make it where your D1 bindings are not defined unless you changed your format to use a table for d1_databases also which is why you started to get an error when you moved it.- KV Namespaces:
....
- D1 Databases:
- MYDATABASE_DB: mydbinmydashboard (74244d9f-afa8-4ca2-ab7f-XXXXXX)
- Vars:
..... console.log("we start the new DB");
try {
console.log("we start the new DB test 1");
await env.DBNAME_DB.prepare(`insert into messages (location_id,time_stamp,status,customer_dismiss) values (?,?,?,?)`).bind(restaurant_token_used, timestamp_index, 'new', 0).run()
console.log("we start the new DB test 2");
} catch (e) {
console.log("we start the new DB test 3");
console.log({
message: e.message,
cause: e.cause.message,
});
}
console.log("we end the new DB");d1_databases = [
{ binding = "name", ... }
]
[vars]
hello = "world"[vars]
hello = "world"
d1_databases = [
{ binding = "name", ... }
]var coolio200 = await env.MYDATABASE_DB.exec("PRAGMA table_list")
console.log("here is coolio100")
console.log("here is coolio200: " + JSON.stringify(coolio200))- KV Namespaces:
....
- D1 Databases:
- MYDATABASE_DB: mydbinmydashboard (74244d9f-afa8-4ca2-ab7f-XXXXXX)
- Vars:
.....export default {
async fetch(request, env, ctx) {
let res = await env.MYDATABASE.exec("PRAGMA table_list")
console.log(res)
return Response.json({res: res})
},
};