node.js - How can I use PostgreSQL transactions in SailsJs? -
my problem have complex chain of queries , make rollback if of transactions fail. i've read transactions in sails and, default, sails don't support transactions because each transaction make new connection postgres, so, 1 query have new connection. so, how can use transactions sails?
currently transactions not supported waterline. can join discussion here https://github.com/balderdashy/waterline/issues/755.
transactions on roadmap not expected in near future: https://github.com/balderdashy/waterline/blob/master/roadmap.md#pending-proposals
as workaround might try https://github.com/shyp/pg-transactions loose flexibility of waterline because code not database agnostic more.
also check sails.js best practice in using transactions promises (postgres) , sails.js + postgres: issue transactions
Comments
Post a Comment