Dialect

Dialect

Abstract class that each database vendor/driver should extend from

Constructor

new Dialect(priv, connConf, trackopt, errorLoggeropt, loggeropt, debugopt)

Abstract constructor that sets each passed parameter on the current instance as a property. Extending classes should override the constructor using the same parameters since Manager internally invokes the constructor.

Source:
Parameters:
Name Type Attributes Description
priv typedefs.SQLERPrivateOptions

The private configuration options

connConf typedefs.SQLERConnectionOptions

The individual connection configuration for the given dialect that was passed into the originating Manager

track typedefs.SQLERTrack <optional>

A tracking mechanism that can be used to share configuration between dialect implementations

errorLogger function <optional>

A function that takes one or more arguments and logs the results as an error (similar to console.error)

logger function <optional>

A function that takes one or more arguments and logs the results (similar to console.log)

debug Boolean <optional>

A flag that indicates the dialect should be run in debug mode (if supported)

Members

(protected) driver

The driver module used by the Dialect

Source:

state

Source:

Methods

(async) beginTransaction(txId, opts) → {typedefs.SQLERTransaction}

Starts a transaction. A transaction will typically get/open a connection from the pool and will remain open until commit or rollback are called from the return typedefs.SQLERTransaction. Care must be taken not to drain the pool of available connections.

Source:
Parameters:
Name Type Description
txId String

The internally generated transaction identifier

opts typedefs.SQLERTransactionOptions

The transaction options passed in via the public API

Returns:
Type:
typedefs.SQLERTransaction

The transaction that was started

(async) close() → {Integer}

Closes any dialaect resources that may have been opened during Dialect.init

Source:
Returns:
Type:
Integer

The number of connections that were closed

(async) exec(sql, opts, frags, meta, errorOptsopt) → {typedefs.SQLERExecResults}

Executes a SQL statement

Source:
Parameters:
Name Type Attributes Description
sql String

The SQL to execute

opts typedefs.SQLERExecOptions

The execution options

frags Array.<String>

The frament keys within the SQL that will be retained

meta typedefs.SQLERExecMeta

The metadata used to generate the execution

errorOpts typedefs.SQLERExecErrorOptions | Boolean <optional>

The error options to use

Returns:
Type:
typedefs.SQLERExecResults

The execution results

(async) init(opts) → {*}

Initializes the Dialect implementation and optionally opens any resources that be need to Dialect.exec

Source:
Parameters:
Name Type Description
opts typedefs.SQLERInitOptions

The initialization options

Returns:
Type:
*

Any truthy value that indicates the initialization was successful (or an error when returning errors instead of throwing them)


9.0.0 (2021-08-18)

Full Changelog

Breaking Changes:

Features: