Initialization Options
Below is the complete list of Initialization Options for the library that can be passed during the library's initialization:
const initOptions = {/* options as documented below */};
const pgp = require('pg-promise')(initOptions);Parameters:
| 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) 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 currently allocated, so the process can terminate without delay.
It is available as pgp.end, after initializing the library.
All Database objects created previously can no longer be used, throwing
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).
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, readonly) ParameterizedQuery :ParameterizedQuery
ParameterizedQuery class.
Available as pgp.ParameterizedQuery, before and after initializing the library.
Type:
(inner, readonly) pg :external:PG
Instance of the pg library that's being used, depending on initialization option pgNative:
- regular
pgmodule instance, without optionpgNative, or equal tofalse(default) pgmodule instance with Native Bindings, if optionpgNativewas set.
Available as pgp.pg, 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) 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.