Global

Members

(readonly) LockContention :number

Enum to identify row locking modes.
Type:
  • number
Source:
Example
LockContention.NOWAIT
LockContention.SKIP_LOCKED

Methods

execute(rowcb, metacbopt) → {Promise}

Execute a raw SQL query.
Parameters:
Name Type Attributes Description
rowcb function | Object Callback function to handle results, or an object with both callback functions.
metacb function <optional>
Callback function to handle metadata.
Source:
Returns:
Type
Promise
Example
// provide only a callback to handle results
query.execute(result => {})
query.execute({ result () {} })

// provide only a callback to handle metadata
query.execute({ meta () {} })

// provide callbacks to handle results and metadata
query.execute(result => {}, meta => {})
query.execute({ result () {}, meta () {} })

module:Result(state) → {Result}

Result set object returned by each database operation.
Parameters:
Name Type Description
state Object result details
Source:
Returns:
Type
Result

Type Definitions

documentCallback(object)

Cursor callback.
Parameters:
Name Type Description
object object the document in the cursor position
Source:

DocumentOrJSON

Literal object or JSON counterpart.
Type:
  • Object | string
Source:
Example
// literal object
{ foo: 'bar' }
// JSON string
'{ "foo": "bar" }'

metadataCursor(metadata)

Does something with the operation metada.
Parameters:
Name Type Description
metadata Object metadata object
Source:

resultSetCursor(item)

Does something for each element in the result set.
Parameters:
Name Type Description
item Object | Array document or row instance
Source:

SchemaList

An object with a list of schema names as key and schema objects as value
Type:
  • object
Source:

SearchConditionStr

Expression that establishes the filtering criteria.
Type:
  • string
Source:
See:

URI

URI object
Type:
  • Object
Properties:
Name Type Description
host string Hostname to connect to
port number Port number
dbUser string Username
dbPassword string Password
auth string Name of an authentication mehod to use (default: PLAIN)
socketFactory SocketFactory A factory which can creaes socket, usually not needed outside tests
ssl bool Enable SSL, defaults to true
sslOption object options passed to tls.TLSSocket constructor, see https://nodejs.org/api/tls.html#tls_new_tls_tlssocket_socket_options
Source:

Warning

MySQL Warning
Type:
  • Object
Properties:
Name Type Description
level Number
code Number
msg String
Source: