KyselyK
Kyselyโ€ข3y ago
ladal1

Rollback transaction

Hi, I'm trying to figure out if it's possible to intentionally rollback a transaction, the idea is that if one insert into the database ends with certain return value, the whole transaction should end and the insert rolled back. Knex has
trx.rollback
on the callback parameter, but I couldn't find anything like that on Kysely, am I missing something or is this not yet implemented?
Solution
await sql<void>`rollback`.execute(trx)

Okay I was doing raw sql badly, this does work at least
Was this page helpful?