Type of `tx` when using `db.transactions`
I want to use helper functions within
db.transactions
but I can't get the type of tx
working
so basically i don't know how to type tx
in the updateUserNotifications
function
7 Replies
Did you try
The transaction class extends from the Database class
What driver are you using?
You might just lose
tx.rollback
maybe?
Only at the type level, you'll have at runtime
I'll a couple tests laterpostgres-js
yeah this seems to work, i was overcomplicated it 😅
indeed there is no rollback but it's fine for now, i dont do manual rollbacks
Try this:
You can also just throw inside and it will roll back
yeah that works
i only want to rollback now if my query throws so that's fine
thanks for the help!
You think I should refer to @amur0501 ‘s example for my question here ? https://discord.com/channels/1043890932593987624/1148843024881827890
I don't know what example you're referring to
But if it helps, you def refer to it
ah does neon not support transactions?
No transactions support in neon-http driver