feathers-objection - A service adapter for Objection.js - A minimal SQL ORM built on top of Knex.
Transactions are atomic and isolated units of work in relational databases.
We want to create and use transaction in feathersjs application generated using the Feathers CLI.
But
We were not able to figure out how to create a transaction object and pass it to series of service calls using the transaction params operator and how to use await transaction.trx.commit() and await transaction.trx.rollback().
Help is required for the same.
Check
knex.transcationProvider()example from https://knexjs.org/#TransactionsHowever there might be a bug in documentation in the part where
await trx.commit()andawait trx.rollback()are called.Safer way would be to just call either of those without
awaitandawait trx.executionPromiseto get transaction result / error if it was rolled back.Transaction documentation in knex is currently quite messy.