HTML5 and SQLite database storage. Create, modify, and delete tables and data.
execute
Executes a statement that does not require a response like: Create, Insert, Delete, etc.
Syntax:
lg.database.execute(statement);
Arguments:
- statement – (string) Statement to be executed.
Example:
lg.database.execute('INSERT INTO Test ("itemName") VALUES ("added2")');
open
Opens a database. You must first open a database before accessing data within it.
Syntax:
lg.database.open(obj);
Arguments:
- (object) Image information from callback.
- name – (string) Name of the database to be opened. If sqlite, database must have extention .sqlite. The name will be anything before the .sqlite.
- type – (string) local (HTML5) or file (sqlite).
Example:
lg.database.open({name:'myDb', type:'local'});
query
Queries the database with the select statement.
Syntax:
lg.database.query(statement);
Arguments:
- statement – (string) Select statement to query.
Event Trigger:
- lg_database
Example:
lg.database.query('SELECT * FROM Test');
results
Syntax:
lg.database.results;
Returns:
- (array) An array of returned results. Each item contains an object with the row name as the key.
Example:
var myRow = lg.database.results[0];
