itay
itay
DTDrizzle Team
Created by itay on 11/19/2023 in #help
How to create a transaction outside of callback function?
Specifically for postgres Example Usage:
const tx = db.transaction()
try {
tx.insert(...)
tx.update(...)
...
await tx.commit()
} catch {
await tx.rollback()
}
const tx = db.transaction()
try {
tx.insert(...)
tx.update(...)
...
await tx.commit()
} catch {
await tx.rollback()
}
Reiterating: https://discord.com/channels/1043890932593987624/1170095630711017503/1171878101978988645 Use-case: https://discord.com/channels/1043890932593987624/1171123409653071965
2 replies
DTDrizzle Team
Created by itay on 11/6/2023 in #help
Using transactions in automated testing like Jest
No description
7 replies