-
Notifications
You must be signed in to change notification settings - Fork 0
Connection
Arian Johnson edited this page May 4, 2018
·
21 revisions
Creates a new MySQL Connection Pool.
Kind: global class
Instantiates a new Connection object. It can be configured in the following ways:
- Via a
settingsobject passed directly to theConnectionon instantiation. - Via the
database.cfg.jsfile in the/config/folder. - If neither are found,
Connectionassumes the localmysqldatabase on yourserver.
| Param | Type | Default | Description |
|---|---|---|---|
| settings opt | DBSettings |
{} |
The database server pool settings. |
connection.config : DBConfig
Describes the global database settings.Config object (used for all pool servers).
-
Kind: instance property of
Connection - Read only: true
connection.servers : DBPool
Describes the collection of DBPool servers in settings.Pool.
-
Kind: instance property of
Connection - Read only: true
A MySQL connection pool
-
Kind: instance property of
Connection - Read only: true
Whether or not the Connection is being kept alive
-
Kind: instance property of
Connection - Read only: true
Initiates the Database pool.
-
Kind: instance method of
Connection
Sends a ping to the database, expecting a response.
-
Kind: instance method of
Connection
Will continually ping the db at an interval specified in the configs.
-
Kind: instance method of
Connection
Aquires a database connection from the pool.
-
Kind: instance method of
Connection
| Param | Type | Description |
|---|---|---|
| success | CBsuccess |
A callback to handle the MySQL connection pool that was successfully acquired. |
| failure | CBfailure |
A callback to handle the failure to aquire a MySQL connection pool. |
Closes the database connection.
-
Kind: instance method of
Connection
Sends out database logs.
-
Kind: instance method of
Connection
| Param | Type | Description |
|---|---|---|
| message | string |
On success; message is displayed as-is. On error it's used as a sprintf-style template for err.message. |
| err | Error |
An error object; if applicable. |
Copyright © 2018 DFFRNT Innovation Inc. All rights reserved