new PgPool()
A pool of connection.
- Source:
Methods
begin(handler)
Borrow a connection from the pool and begin a transaction, the underlying connection will be returned
to the pool when the transaction ends.
Parameters:
Name |
Type |
Description |
handler |
function
|
|
- Source:
close()
Close the pool and release the associated resources.
- Source:
getConnection(handler)
Get a connection from the pool.
Parameters:
Name |
Type |
Description |
handler |
function
|
the handler that will get the connection result |
- Source:
preparedBatch(sql, batch, handler) → {PgPool}
Parameters:
Name |
Type |
Description |
sql |
string
|
|
batch |
Array.<Tuple>
|
|
handler |
function
|
|
- Source:
Returns:
-
Type
-
PgPool
preparedQuery(sql, arguments, handler) → {PgPool}
Parameters:
Name |
Type |
Description |
sql |
string
|
|
arguments |
Tuple
|
|
handler |
function
|
|
- Source:
Returns:
-
Type
-
PgPool
query(sql, handler) → {PgPool}
Parameters:
Name |
Type |
Description |
sql |
string
|
|
handler |
function
|
|
- Source:
Returns:
-
Type
-
PgPool