How to use a prepared query inside a transaction?

I have a prepared query like this:
const userAddressBookQuery = db.query.userAddressTable
.findMany({
where: (fields) => eq(fields.userId, sql.placeholder('userId')),
})
.prepare('user_address_book');
const userAddressBookQuery = db.query.userAddressTable
.findMany({
where: (fields) => eq(fields.userId, sql.placeholder('userId')),
})
.prepare('user_address_book');
I want to use this inside a db.transaction(async (tx) => { ... }) block. what's the correct way to use .prepare() inside a transaction?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?