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:

  1. statement – (string) Statement to be executed.


Example:

lg.database.execute('INSERT INTO Test ("itemName") VALUES ("added2")');

Back to Top

 

 

open

Opens a database. You must first open a database before accessing data within it.


Syntax:

lg.database.open(obj);

Arguments:

  1. (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'});

Back to Top

 

 

query

Queries the database with the select statement.


Syntax:

lg.database.query(statement);

Arguments:

  1. statement – (string) Select statement to query.


Event Trigger:

  • lg_database


Example:

lg.database.query('SELECT * FROM Test');

Back to Top

 

 

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];

Back to Top