Pass a config object into the constructor, which then initializes the pool and
Initialize a pool with the apporpriate configuration and bind the pool to the current client object.
Execute a query on the specified Builder or QueryBuilder
interface. If a connection
is specified, use it, otherwise
acquire a connection, and then dispose of it when we're done.
If the builder came with a supplied connection, then we won't do anything to it (most commonly in the case of transactions)... otherwise, ensure the connection gets dumped back into the client pool.
The connection must have failed to initialize. Avoid pushing undefined into the connection pool.
Since we usually only need the sql
and bindings
to help us debug the query, output them
into a new error... this way, it console.log
's nicely for debugging, but you can also
parse them out with a JSON.parse(error.message)
. Also, use the original clientError
from the
database client is retained as a property on the newError
, for any additional info.
Debug a query.
Retrieves a connection from the connection pool, returning a promise.
Releases a connection from the connection pool, returning a promise.
Begins a transaction statement on the instance, resolving with the connection of the current transaction.
Finishes the transaction statement on the instance.
ServerBase