Some providers are SQL, and due to the No-SQL environment that exists in SettingGateway,
they require extra methods/properties to work. All the previous methods are required to work.
Example
SQL Compatibility
exports.updateColumns = (table, columns, schema) => { // code here };
exports.serialize = (data) => { // code here };
exports.sanitize = (string) => { // code here };
exports.CONSTANTS = {};
Members
-
static CONSTANTS
-
An object that helps the SQL class creating compatible schemas for the provider.
Properties:
Name Type Description Stringstring The SQL compatible string datatype. Integerstring The SQL compatible integer datatype. Floatstring The SQL compatible float datatype. Example
exports.CONSTANTS = { String: "TEXT", Integer: "INTEGER", Float: "INTEGER", AutoID: "INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE", Timestamp: "DATETIME", AutoTS: "DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL", };
Methods
-
static sanitize(string) → {string}
-
Sanitize strings to be storable into the SQL database.
Parameters:
Name Type Description string* An object or string. Returns:
string -
static serialize(data) → {Object}
-
Transform NoSQL queries into SQL.
Parameters:
Name Type Description dataObject The object. Returns:
Object -
static updateColumns(table, columns, schema) → {boolean}
-
Update the columns from a table (All the data is provided by the SQL class).
Parameters:
Name Type Description tablestring The name of the table. columnsArray.<string> Array of columns. schemaArray.<array> Tuples of keys/values from the schema. Returns:
boolean