gourav
gourav
DTDrizzle Team
Created by gourav on 9/5/2023 in #help
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
5 replies