DoboConnection

Connection class definition.

Constructor

new DoboConnection()

Members

adapter :Object

Adapter object

Type:
  • Object

client :Object

Client instance

Type:
  • Object

(async) dispose

Dispose this connection

name :string

Connection name

Type:
  • string

options :DoboConnection.TOptions

Connection options

Methods

(async) connect(noRebuildopt)

Establish this connection through the adapter to the actual database system. Adapter developer must provide a method named connect() to connect the underlying database and (optionally) return its client instance.

Parameters:
NameTypeAttributesDescription
noRebuildboolean<optional>

If true, the database table/collection won't be build automatically

(async) initAdapter(name) → {Promise.<void>}

Initialize the adapter for this connection. If the adapter is already an instance of DoboAdapter, it will be used directly. Otherwise, it will be retrieved from the plugin's adapter registry and sanitized with the connection options.

Parameters:
NameTypeDescription
namestring

Adapter name

Returns:
Type: 
Promise.<void>

Type Definitions

TOptions

Properties
NameTypeAttributesDefaultDescription
namestring<optional>
'default'

Connection name

modelsArray.<string>

List of model names to be used with this connection. Use this property to force models to be bound to this connection only.