Protected
_Protected
_Protected
Prepares the columns for a CREATE statement
Protected
_Protected
Prepares any foreign key constraints based upon the field supplied
Protected
_Protected
_Protected
_Protected
_Protected
_Protected
beginProtected
Starts a transaction on the specified connection
Closes all the pooled connections
Protected
commitProtected
Commits a transaction on the specified connection
Protected
connectionProtected
Returns 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 specified database
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
Protected
rollbackProtected
Rolls back a transaction on the specified connection
Truncates the specified table(s)
Switches the default database referenced by the connection
Creates a new instance of the class