Transactional SQL with Sails.js

后端 未结 3 1547
离开以前
离开以前 2021-02-05 17:36

So I have been playing with NodeJS/Express for a little with now and I would really like to try to rewrite a relatively large side project using a full JavaScript stack just to

3条回答
  •  无人共我
    2021-02-05 18:12

    Transactions in SailsJS turned out to be much trickier than anticipated. The goal is to let the ORM adapter know that two very disparate controller actions on models are to be sent through a single MySQL connection.

    The natural way to do it is two write a new adapter that accepts an additional info to indicate that a query belongs to a transaction call. Doing that requires a change in waterline (sails ORM abstraction module) itself.

    Checkout if this helps - https://www.npmjs.com/package/sails-mysql-transactions

提交回复
热议问题