Module: dbList

Maintains a list of db connection information, each identified by a dbCode
Source:

Classes

Context
DbDescriptor
dbListFile

Methods

(inner) column(columnName) → {ColumnDescriptor}

gets a column descriptor given the column name
Parameters:
Name Type Description
columnName string
Source:
Returns:
Type
ColumnDescriptor

(inner) columnNames() → {Array.<string>}

gets a column descriptor given the column name
Source:
Returns:
Type
Array.<string>

(inner) delDbInfo(dbCode) → {*}

Deletes a Db from the list
Parameters:
Name Type Description
dbCode string
Source:
Returns:
Type
*

(inner) existsDbInfo(dbCode) → {boolean}

Check if a dbCode is present in the list
Parameters:
Name Type Description
dbCode string
Source:
Returns:
Type
boolean

(inner) forgetTable(tableName) → {*}

Clears the information stored about a table
Parameters:
Name Type Description
tableName string
Source:
Returns:
Type
*

(inner) getConnection(dbCode) → {Connection}

gets a Connection eventually taking it from a pool, at the moment it simply returns a new Connection
Parameters:
Name Type Description
dbCode string
Source:
Returns:
Type
Connection

(inner) getDataAccess(dbCode) → {Promise.<DataAccess>}

Gets a promise to a DataAccess
Parameters:
Name Type Description
dbCode string
Source:
Returns:
Type
Promise.<DataAccess>

(inner) getDbInfo(dbCode) → {Object.<driver, useTrustedConnection, user, pwd, database, defaultSchema, connectionString>}

Get information about a database
Parameters:
Name Type Description
dbCode string required for sqlConnection constructor: {string} [driver='SQL Server Native Client 11.0'] Driver name {string} [useTrustedConnection=true] is assumed true if no user name is provided {string} [user] user name for connecting to db {string} [pwd] user password for connecting to db {string} [database] database name {string} [defaultSchema=options.user ||'DBO'] default schema associated with user name {string} [connectionString] connection string to connect (can be used instead of all previous listed) {string} sqlModule module name to user for getting connection
Source:
Returns:
Type
Object.<driver, useTrustedConnection, user, pwd, database, defaultSchema, connectionString>

(inner) getDescriptor(dbCode) → {DbDescriptor}

Parameters:
Name Type Description
dbCode string
Source:
Returns:
Type
DbDescriptor

(inner) getKey() → {Array}

gets an array of all primary key column names
Source:
Returns:
Type
Array

(inner) init(options)

Initializes dbList
Parameters:
Name Type Description
options
Properties
Name Type Attributes Description
fileName string <optional>
Name of the clean config file to encrypt
encryptedFileName string <optional>
name of the config file to be created
encrypt boolean true if the config file has to be encrypted
decrypt boolean true if the config file has to be decrypted
secret object <optional>
object containing key,iv,pwd to replace the config
Source:

(inner) setDbInfo(dbCode, dbData)

sets information about a database
Parameters:
Name Type Description
dbCode string
dbData Object.<driver, useTrustedConnection, user, pwd, database, defaultSchema, connectionString>
Source:

(inner) table(tableName, tableDescriptoropt) → {Promise.<TableDescriptor>}

Get/Set the structure of a table in a JQuery fashioned style
Parameters:
Name Type Attributes Description
tableName string
tableDescriptor TableDescriptor <optional>
Source:
Returns:
or undefined
Type
Promise.<TableDescriptor>