CodeFoodPixels / node-promise-mysql

A wrapper for mysqljs/mysql that wraps function calls with Bluebird promises.
MIT License
338 stars 63 forks source link

Can we use batch operations in promise-mysql pool? #49

Closed lakshmipriyamukundan closed 7 years ago

CodeFoodPixels commented 7 years ago

Can you give an example of what you're trying to do?

On Tue, 9 May 2017 at 13:53 Lakshmipriya notifications@github.com wrote:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lukeb-uk/node-promise-mysql/issues/49, or mute the thread https://github.com/notifications/unsubscribe-auth/AEjy1EO-fVd4e6x3UjK3NTax5RVy_3wzks5r4GGtgaJpZM4NVRZb .

lakshmipriyamukundan commented 7 years ago

From technet.microsoft.com

A transaction is a sequence of operations performed as a single logical unit of work. A logical unit of work must exhibit four properties, called the atomicity, consistency, isolation, and durability (ACID) properties, to qualify as a transaction.

where, Atomicity is

A transaction must be an atomic unit of work; either all of its data modifications are performed, or none of them is performed.

Say, I've 4 sql queries to issue. Either all should pass or none. How to handle such a case? Thanks in advance.

CodeFoodPixels commented 7 years ago

Try this https://github.com/mysqljs/mysql#transactions and use promise chains instead of callbacks. Please try and refer to those docs in the future as promise-mysql just wraps mysqljs.

On Wed, 10 May 2017, 05:29 Lakshmipriya, notifications@github.com wrote:

From technet.microsoft.com https://technet.microsoft.com/en-us/library/ms190612(v=sql.105).aspx

A transaction is a sequence of operations performed as a single logical unit of work. A logical unit of work must exhibit four properties, called the atomicity, consistency, isolation, and durability (ACID) properties, to qualify as a transaction.

where, Atomicity is

A transaction must be an atomic unit of work; either all of its data modifications are performed, or none of them is performed.

Say, I've 4 sql queries to issue. Either all should pass or none. How to handle such a case? Thanks in advance.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/lukeb-uk/node-promise-mysql/issues/49#issuecomment-300370570, or mute the thread https://github.com/notifications/unsubscribe-auth/AEjy1Og69fvqgGqHFasJUnRz4UGEyOC8ks5r4T04gaJpZM4NVRZb .