Node.js mysql transaction

前端 未结 7 1329
南笙
南笙 2020-12-13 16:16

Can anyone provide an example of how I could achieve MySQL transactions in Node.js. I am trying to get my head around using the node-mysql driver and node-mysql-queue.

7条回答
  •  生来不讨喜
    2020-12-13 16:41

    You can use it with the mysql also, just use this function without any parameters /call back . Make sure you have async function and use these instead

    await con.rollback();
    await con.beginTransaction();
    await con.commit();
    

    Life set.....

提交回复
热议问题