Class: zDatabaseService

zDatabaseService()

Service that contains the functions related to the database.

Constructor

new zDatabaseService()

Executes the database connection function and stores it.
Author:
Source:

Classes

zDatabaseService

Members

connection

Sequelize instance containing the database connection.
Author:
Source:

isInitialized

Stores if initialized service.
Author:
Source:

tService

Stores instance zTranslateService.
Author:
Source:

Methods

(static) destroyInstance()

Function used to destroy instance of zDatabaseService
Author:
Source:

(static) getInstance()

Function used to get instance of zDatabaseService
Author:
Source:
Returns:
zDatabaseService

checkField(tableName, fieldName)

Function to check field in table.
Parameters:
Name Type Description
tableName string Table Name.
fieldName string Field Name.
Author:
Source:
Returns:
Observable

checkTable(tableName)

Function to check table in database.
Parameters:
Name Type Description
tableName string Table Name.
Author:
Source:
Returns:
Observable

connectionDatabase(config)

Function responsible for connecting to the database and testing the connection.
Parameters:
Name Type Description
config zIConfigDB Database Configs
Author:
Source:
Returns:
Observable

createTable(table)

Function to create tables and add columns.
Parameters:
Name Type Description
table zITableDB Table.
Author:
Source:
Returns:
Observable

generateAttribute(data)

Function to generate attributes table.
Parameters:
Name Type Description
data zITableDB | zIFieldDB Table Generate Attributes | Field Generate Attributes
Author:
Source:
Returns:
Observable

getConnection()

Function to pick up the connection.
Author:
Source:
Returns:
Observable

getDialectDatabase(dialect)

Function to take the selected bank type in addition to checking if it is valid.
Parameters:
Name Type Description
dialect string Database type.
Author:
Source:
Returns:
Observable

getFieldType(field)

Function to get field type.
Parameters:
Name Type Description
field zIFieldDB Database Field
Author:
Source:
Returns:
Observable

setTableModel(table)

Function used to set table model.
Parameters:
Name Type Description
table zITableDB Table.
Author:
Source:
Returns:
Observable>>