pga2.1.6 • Public • Published
npm install --save pga
const pga = ;var db =;
Closes the database connection. An alias for
Performs a series of parameterized queries in parallel over multiple connections from the underlying pool.
Query execution order is arbitrary, but the results are returned in the expected order.
If a single query results in an error,
parallel will immediately execute the specified callback function with both the error and potentially a partial array of results from other successful queries. When returning a Promise, one error among any of the queries will result in the Promise being rejected.
parallel is provided as a means of efficiently performing multiple
SELECT queries at once rather than one after the other in sequence. Do not use
parallel to execute grouped SQL queries that may potentially alter the database- use
// Parallelized queries with a callback function.db;// Parallelized queries that return a Promise object.db;
pga also accepts comma-separated queries and optional callback functions for parallel queries if passing in an array is too unwieldy:
Performs a single parameterized query. An alias for
// A regular query with a callback function.db;// A regular query with a parameter and callback function.db;// A regular query that returns a Promise object.db;// A regular query with a parameter that returns a Promise object.db;
Performs a database transaction on an array of parameterized queries.
// A transaction with a callback function.db;// A transaction that returns a Promise object.db;
pga also accepts comma-separated queries and optional callback functions for transactions if passing in an array is too unwieldy: