@absolunet/ioc2.1.0

View on GitHub

Builder

Database connection builder that uses configuration to create connection without effort.

Members

(static) dependencies :Array.<string>

Source:
Class dependencies: ['config', 'db.connection'].

Methods

getConnection(nameopt)

Source:
Get connection by name.
Parameters:
Name Type Attributes Default Description
name string <optional>
"default" The connection name.
Returns:
A Knex connection instance.
Type
Knex

getDefaultConnection()

Source:
Get default connection.
Returns:
A Knex connection instance.
Type
Knex

getDriverForConnection(name)

Source:
Retrieve driver for connection by name.
Parameters:
Name Type Default Description
name string | Knex default Either a connection name or a Knex connection instance.
Returns:
The underlying driver instance.
Type
database.services.Connector.drivers.Driver

getForward()

Source:
Get default connection for forward calls.
Returns:
The connection instance.
Type
Knex