transaction not working for better-sqlite3

Doing this updates the name of user. I am expecting it to do nothing as rollback is called on the next line.
await db.transaction(async (tx) => {
await tx.update(users).set({ name: "test" }).where(eq(users.id, 1));
await tx.rollback()
});
await db.transaction(async (tx) => {
await tx.update(users).set({ name: "test" }).where(eq(users.id, 1));
await tx.rollback()
});
Looks like someone else also faced the same issue yesterday. https://github.com/drizzle-team/drizzle-orm/discussions/1170
GitHub
TransactionRollbackError with BetterSQLite3 · drizzle-team drizzle-...
When performing a rollback inside a transaction I get an error: - error TransactionRollbackError [DrizzleError]: Rollback at BetterSQLiteTransaction.rollback (webpack-internal:///(rsc)/./node_modul...
4 Replies
gourav
gouravOP15mo ago
these are my package versions
"better-sqlite3": "^8.6.0",
"drizzle-orm": "^0.28.5",
"better-sqlite3": "^8.6.0",
"drizzle-orm": "^0.28.5",
Russell
Russell15mo ago
@gourav hi did u manage to fix this?
gourav
gouravOP15mo ago
no @beealpha
Russell
Russell15mo ago
damn currently facing the same issue with postgres
Want results from more Discord servers?
Add your server