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.
Was able to achieve transaction in feathersjs using objection ORM.
Findings are as follows.
transaction-hooks
Then in your service.hooks use the following:
One can also start transaction with the knex instance: