Global

Type Definitions

PGConnectionOptions

PostgreSQL specific extension of the SQLERConnectionOptions from the sqler module.

Properties:
Properties
Name Type Description
driverOptions Object

The pg module specific options. Both client and pool will be merged when generating the connection pool.

Name Type Attributes Description
client Object <optional>

An object that will contain properties/values that will be used to construct the PostgreSQL Client (e.g. { database: 'mydb', statement_timeout: 10000 }). See the pg module documentation for a full listing of available Client options. When a property value is a string surrounded by ${}, it will be assumed to be a property that resides on either the SQLERPrivateOptions passed into the Manager constructor or a property on the PGConnectionOptions itself (in that order of precedence). For example, clientOpts.host = '127.0.0.1' and driverOptions.client.host = '${host}' would be interpolated into driverOptions.client.host = '127.0.0.1'. In contrast to privOpts.username = 'someUsername' and driverOptions.client.user = '${username}'would be interpolated intodriverOptions.client.user = 'someUsername'`.

pool Object <optional>

The pool conf options that will be passed into pg.createPool(conf). See the pg module for a full listing of avialable connection pooling options. Using any of the generic pool.someOption will override the conf options set on driverOptions.pool (e.g. pool.max = 10 would override driverOptions.pool.max = 20). When a value is a string surrounded by ${}, it will be assumed to be a constant property that resides on the pg module and will be interpolated accordingly. For example driverOptions.pool.someProp = '${SOME_PG_CONSTANT}' will be interpolated as pool.someProp = pg.SOME_PG_CONSTANT.

Source:
Type:
  • SQLERConnectionOptions

PGExecOptions

PostgreSQL specific extension of the SQLERExecOptions from the sqler module. When a property of binds contains an object it will be interpolated for property values on the pg module. For example, binds.name = '${SOME_PG_CONSTANT}' will be interpolated as binds.name = pg.SOME_PG_CONSTANT.

Properties:
Properties
Name Type Attributes Description
driverOptions Object <optional>

The pg module specific options.

Properties
Name Type Attributes Description
query Object <optional>

The options passed into pg.Client.query during Manager.exec. See the pg module documentation for a full listing of available query options. When a value is a string surrounded by ${}, it will be assumed to be a constant property that resides on the pg module and will be interpolated accordingly. For example driverOptions.query.someDriverProp = '${SOME_PG_CONSTANT}' will be interpolated as driverOptions.query.someDriverProp = pg.SOME_PG_CONSTANT.

Name Type Attributes Description
name String | Boolean <optional>

As stated in the pg documentation, the name option will cause a perpared statemenet to be used. sqler-postgres allows a true value to be set to utilize the internally generated SQL file name to be used instead of explicitly defining a name (which is of course, also supported).

Source:
Type:
  • SQLERExecOptions

PGTransactionObject

Transactions are wrapped in a parent transaction object so private properties can be added (e.g. prepared statements)

Properties:
Name Type Description
tx SQLERTransaction

The transaction

conn Object

The connection

unprepares Map

Map of prepared statement names (key) and no-argument async functions that will be called as a pre-operation call prior to commit or rollback (value)

Source:
Type:
  • Object

2.0.0 (2021-02-25)

Full Changelog

Features: