Skip to content

Storage APIs

Rob Parham edited this page Sep 25, 2017 · 2 revisions

jSQL databases are stored on the user's hard drive but are loaded into memory when jSQL is loaded. For query speed, all database operations are made in memory and are not saved to the user's hard drive until jSQL.commit() is called.


jSQL.load(onLoadCallback)

Register a callback to be fired when the database has been loaded into memory and is ready to be queried.

Parameters
  • onLoadCallback: A function to be called when the database has been loaded.
Example
jSQL.load(function(){
    jSQL.createTable('Users', ['Name', `Age`]).ifNotExists().execute();
    var allUsers = jSQL.select('*').from('Users').execute().fetchAll('ASSOC');
});

Clone this wiki locally