npx prisma migrate diff with my D1 database locally (because I have a qa and prod DB instance and the command can't deal with multiple DBs). Looks like someone else ran into the same problem a few months ago: https://www.answeroverflow.com/m/1266887370653962422workers.toml file. That's the architecture I'm switching to.

db.batch operation where a step requires the result of the previous one (the id of an inserted element)? const hash = utils.hashPassword(request.json.password);
const account = await env.DB.prepare("INSERT INTO users (email, password, firstname, lastname) VALUES (?, ?, ?, ?) RETURNING pk;")
.bind(request.json.email, hash, request.json.firstname, request.json.lastname)
.run();
if (!account.success) throw new Error();
const snowflake = utils.createSnowflake(account.results[0].pk);
const set_id = await env.DB.prepare("UPDATE users SET id = ? WHERE pk = ?;")
.bind(snowflake, account.results[0].pk)
.run();
if (!set_id.success) throw new Error();db.batch