K
Kysely14mo ago
tzezar

Can you mix kysely with pg transactions?

For example:
try {
await client.query('BEGIN')

<KYSELY CODE HERE>

await client.query('COMMIT')
} catch (e) {
await client.query('ROLLBACK')
throw e
} finally {
client.release()
}
try {
await client.query('BEGIN')

<KYSELY CODE HERE>

await client.query('COMMIT')
} catch (e) {
await client.query('ROLLBACK')
throw e
} finally {
client.release()
}
3 Replies
koskimas
koskimas14mo ago
You can use Kysely only to build the SQL and then exceute that any way you like.
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?