MySQL.sendNativeQuery()

Send a native query to the MySQL database.

Usage

Hover over inputs/exits for more info.

var MySQL = require('machinepack-mysql');


// Send a native query to the MySQL database.

MySQL.sendNativeQuery({

connection: '===',

nativeQuery: '*',

meta: '===',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// The database returned an error when attempting to execute the native query.

queryFailed: function (result) {

 

},

: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

connection required

An active database connection.

'==='
nativeQuery required

A SQL statement as a string (or to use built-in escaping, this should be provided as a dictionary).

'*'
meta

Additional stuff to pass to the driver.

'==='

Exits

error

An unexpected error occurred.

queryFailed

The database returned an error when attempting to execute the native query.

{ error: '===', meta: '===' }
undefined
success

OK.

{ result: '===', meta: '===' }