apologies, the error was actually `SqliteError: no such table: todos`
apologies, the error was actually
SqliteError: no such table: todosSqliteError: no such table: todos




env.DB somewhere but your wrangler binding is for env.TEMPDB - you'll want to update the code


i am getting an error "env.DB.prepare(...).run is not a function" , i logged env.DB and it is undefined,
env.DB is undefined because you called it TEMPDB. How do you get from the D1 binding on env.TEMPDB to your own class?env.TEMPDB directly vs. abstracting them - get it working first.Error: D1_ERROR: Error: not authorized in production.returning() or transactions or something? I'm using Miniflare in dev and it works there.*** are definitely GitHub Action logging issues.WRANGLER_LOG env variable set to error or none.env file. You need to create the Pages binding to D1 in the dashboard first: https://developers.cloudflare.com/pages/platform/functions/bindings/#d1-databases
process.env is how they are injected into Next.js within your code.env.DBenv.DBenv.TEMPDBenv.TEMPDBenv.TEMPDBTEMPDBError: D1_ERROR: Error: not authorizedreturning()***WRANGLER_LOGerrornoneprocess.env const newTeam = await locals.db
.transaction(async (tx) => {
const newTeam = await tx.insert(teams).values(form.data).returning().get();
await tx.insert(usersToTeams).values({
userId,
teamId: newTeam.id,
isAdmin: 1
});
return newTeam;
})
.catch((e) => {
console.log('ERROR: ', e);
throw error(500, 'Something went wrong creating your team.');
});