SQLite : SQLite
Kind: global class
- SQLite :
SQLite
- new SQLite(databaseFilename, tableCreateArray, onReady)
- .debug :
number
- .onOpenComplete :
function
- .tables :
Array.<Object>
- .close()
- .resolveBind(q, params) ⇒
string
- .sql(q, callbackOrParametersObject, [callbackIfParameters])
- .createTable(name, columns, callback)
- .createTables(tablesArray, callback)
Creates and manages an sqlite3 instance.
Param | Type | Description |
---|---|---|
databaseFilename | string |
The file name of the SQLITE database file to be used. |
tableCreateArray | Array.<Object> |
An array containing the name and SQL create string describing each column |
tableCreateArray[].name | string |
Name of the column |
tableCreateArray[].columns | string |
SQL describing the content of the row |
onReady | function |
Called after the tables have been created. |
Specifies how much will be output to the console. 0 means no output, 3 means verbose output.
Kind: instance property of SQLite
Called after tables have been created.
Kind: instance property of SQLite
An array containing the name and SQL create string describing each column
Kind: instance property of SQLite
Closes the SQLite3 process gracefully. The object can however be reused.
Kind: instance method of SQLite
Injects values into a query string: ?id for identifier $id for string, #id for number, &id for binary.
Kind: instance method of SQLite
Param | Type |
---|---|
q | string |
params | object |
Runs the specified query and calls a callback when it completes. An optional object may be used to resolve bind parameters.
Kind: instance method of SQLite
Param | Type | Description |
---|---|---|
q | string |
Query |
callbackOrParametersObject | object | function |
Either the callback or if the query string contains bind parameters, an object used to look up values |
[callbackIfParameters] | function |
Callback if bind paramters are used. |
Creates a table
Kind: instance method of SQLite
Param | Type | Description |
---|---|---|
name | string |
The name of the table |
columns | string |
A string containing the SQL Syntax for all columns |
callback | function |
Callback to be run upon completion. |
Creates any number of tables and runs the specified callback upon completion.
Kind: instance method of SQLite
Param | Type | Description |
---|---|---|
tablesArray | Array.<Object> |
An array containing the name and SQL create string describing each column |
tablesArray[].name | string |
Name of the column |
tablesArray[].columns | string |
SQL describing the content of the row |
callback | function |