Gets the total number of idle connections in the pool
Gets the total number of connections in the pool
StatictypeProtected_Protected_ProtectedPrepares the columns for a CREATE statement
Protected_ProtectedPrepares any foreign key constraints based upon the field supplied
Protected_Protected_Protected_Protected_Protected_Prepares a query to perform a multi-update statement which is based upon a multi-insert statement that performs an UPSERT and this is a lot faster than a bunch of individual update statements
ProtectedbeginProtectedStarts a transaction on the specified connection
Closes all pooled connections
ProtectedcommitProtectedCommits a transaction on the specified connection
ProtectedconnectionProtectedReturns a database connection from the pool
Prepares and executes the creation of an index on the table specified
Prepares and executes the creation of a table including the relevant indexes and constraints
Escapes the value for SQL
Escapes the ID for sql
Lists the tables in the current schema
Prepares and executes a query to that performs a multi-update statement which is based upon a multi-insert statement that performs an UPSERT which is a lot faster than a bunch of update statements
Adds the listener function to the end of the listeners array for the event
named eventName. No checks are made to see if the listener has already
been added. Multiple calls passing the same combination of eventName and
listener will result in the listener being added, and called, multiple times.
server.on('connection', (stream) => {
console.log('someone connected!');
});
Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a
The callback function
ProtectedreleaseProtectedAssists with releasing connections once we are done with them
ProtectedrollbackProtectedRolls back a transaction on the specified connection
ProtectedtransformProtectedTransforms a query from using ?-based placeholders to pgsql placeholders
Truncates the specified table(s)
Creates a new instance connected to the specified database using the same configuration options
Optionaluser: stringOptionalpassword: string
Creates a new instance of the class