Begin a transaction, perform some logic, then either commit the transaction if everything worked, or roll it back if there were any errors.
var Waterline = require('machinepack-waterline');
// Begin a transaction, perform some logic, then either commit the transaction if everything worked, or roll it back if there were any errors.
Waterline.transaction({
datastore: 'larrysMySQLCluster',
during: '->',
}).exec({
// An unexpected error occurred.
error: function (err) {
},
// OK.
success: function (result) {
},
});
The identity of the datastore to use.
'larrysMySQLCluster'
A function with custom logic to run once a database connection is established and a transaction has begun.
'->'
An unexpected error occurred.
OK.
'==='