pg-promise v11.10
All documentation here is for the latest official release only.
Initialization Options
Below is the complete list of Initialization Options for the library that can be passed in during the library's initialization:
const initOptions = {/* options as documented below */};
const pgp = require('pg-promise')(initOptions);
Properties:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Library Initialization Options. Properties
|
- Source:
- See:
-
- end, as, errors, helpers, minify, ParameterizedQuery, PreparedStatement, pg, QueryFile, queryResult, spex, txMode, utils
Members
(inner, readonly) ParameterizedQuery :ParameterizedQuery
ParameterizedQuery class.
Available as pgp.ParameterizedQuery
, before and after initializing the library.
Type:
(inner, readonly) PreparedStatement :PreparedStatement
PreparedStatement class.
Available as pgp.PreparedStatement
, before and after initializing the library.
Type:
(inner, readonly) PromiseAdapter :PromiseAdapter
PromiseAdapter class.
Available as pgp.PromiseAdapter
, before and after initializing the library.
Type:
(inner, readonly) QueryFile :QueryFile
QueryFile class.
Available as pgp.QueryFile
, before and after initializing the library.
Type:
(inner, readonly) as :formatting
Namespace for all query-formatting functions.
Available as pgp.as
, before and after initializing the library.
Type:
- Source:
- See:
(inner, readonly) end :function
Shuts down all connection pools created in the process, so it can terminate without delay.
It is available as pgp.end
, after initializing the library.
All Database objects created previously can no longer be used, and their query methods will be rejecting
with Error = Connection pool of the database object has been destroyed.
And if you want to shut down only a specific connection pool, you do so via the Database
object that owns the pool: db.$pool.end()
(see Database.$pool).
For more details see Library de-initialization.
Type:
- function
(inner, readonly) errors :errors
errors - namespace for all error types.
Available as pgp.errors
, before and after initializing the library.
Type:
(inner, readonly) helpers :helpers
Namespace for all query-formatting helper functions.
Available as pgp.helpers
, after initializing the library.
Type:
(inner, readonly) minify :external:pg-minify
Instance of the pg-minify library used internally to minify SQL scripts.
Available as pgp.minify
, before and after initializing the library.
Type:
(inner) pg :external:PG
Instance of the pg library that's being used, depending on initialization option pgNative
:
- regular
pg
module instance, without optionpgNative
, or equal tofalse
(default) pg
module instance with Native Bindings, if optionpgNative
was set.
Available as pgp.pg
, after initializing the library.
Type:
(inner, readonly) queryResult :queryResult
Query Result Mask enumerator.
Available as pgp.queryResult
, before and after initializing the library.
Type:
(inner, readonly) spex :external:spex
Initialized instance of the spex module, used by the library within tasks and transactions.
Available as pgp.spex
, after initializing the library.
Type:
- Source:
- See:
(inner, readonly) txMode :txMode
Transaction Mode namespace.
Available as pgp.txMode
, before and after initializing the library.
Type:
(inner, readonly) utils :utils
utils - namespace for utility functions.
Available as pgp.utils
, before and after initializing the library.