
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.next dev, I would suggest using a library like cf-bindings-proxy 
'fields_of_study' TEXT ARRAY[4], seems to do something, although when running a .prepare query to insert / retrieve data I'm not sure if it's working how I think it should. json helper functions for use with your SQL queries i.e. SELECT * ... or db.prepare("SELECT * ...fields_of_study key is the string "['Major 1', 'Major 2']". 
json_each()
TEMPDBenv.TEMPDBenv.TEMPDBError: D1_ERROR: Error: not authorizedreturning()***WRANGLER_LOGnonecf-bindings-proxy 'fields_of_study' TEXT ARRAY[4],.preparejsonSELECT * ...db.prepare("SELECT * ...fields_of_study"['Major 1', 'Major 2']"json_each() 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.');
});CREATE TABLE IF NOT EXISTS 'profiles' (
'full_name' TEXT,
'fields_of_study' Array of Text?
);const data = db.prepare("SELECT * FROM profiles WHERE user_id = ?").bind(id).first()`