Constructor
new exports(priv, connConf, track, errorLoggeropt, loggeropt, debugopt)
Constructor
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
priv |
SQLERPrivateOptions
|
The private configuration options |
|
connConf |
MSConnectionOptions
|
The individual SQL connection configuration for the given dialect that was passed into the originating |
|
track |
SQLERTrack
|
Container for sharing data between |
|
errorLogger |
function
|
<optional> |
A function that takes one or more arguments and logs the results as an error (similar to |
logger |
function
|
<optional> |
A function that takes one or more arguments and logs the results (similar to |
debug |
Boolean
|
<optional> |
A flag that indicates the dialect should be run in debug mode (if supported) |
Members
Methods
(async) beginTransaction(txId, opts) → {SQLERTransaction}
Begins a transaction by opening a connection from the pool
Parameters:
Name | Type | Description |
---|---|---|
txId |
String
|
The transaction ID that will be started |
opts |
MSTransactionOptions
|
The transaction options |
Returns:
- Type:
-
SQLERTransaction
The transaction
(async) close() → {Integer}
Closes the MSSQL connection pool
Returns:
- Type:
-
Integer
The number of connections closed
(async) exec(sql, opts, frags, meta, errorOptsopt) → {Dialect~ExecResults}
Executes a SQL statement
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sql |
String
|
the SQL to execute |
|
opts |
MSExecOptions
|
The execution options |
|
frags |
Array.<String>
|
The frament keys within the SQL that will be retained |
|
meta |
SQLERExecMeta
|
The SQL execution metadata |
|
errorOpts |
SQLERExecErrorOptions
|
Boolean
|
<optional> |
The error options to use |
Returns:
- Type:
-
Dialect~ExecResults
The execution results
(async) init(opts) → {Object}
Initializes MSDialect
by creating the connection pool
Parameters:
Name | Type | Description |
---|---|---|
opts |
Dialect~DialectInitOptions
|
The options described by the |
Returns:
- Type:
-
Object
The MSSQL connection pool
(async, protected) planner(opts, metaopt) → {MSPlan}
Gets the currently open execution plan or generates a new execution plan (ensures transactions are ran in series , even when user execution is in parallel)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opts |
MSExecOptions
|
The execution options |
|
meta |
SQLERExecMeta
|
<optional> |
Pass meta to establish a connection |