-
Notifications
You must be signed in to change notification settings - Fork 7
Storage APIs
There are currently 5 ways jSQL can store data. If you're using Node, it will always use the filesystem API to store raw data in a file called .jsqldatastore
, otherwise jSQL will attempt to use one of four other available APIs: indexedDB
, WebSQL
, localStorage
or cookies
- in that order. jSQL provides methods for you to prioritize which APIs are tried first and for you to see which one is actually used.
Change the default API priority order. This method must be called before jSQL.load()
.
Pass it the name of the APIs you want to use in the order you want them tried. API names are: indexedDBAPI
, WebSQLAPI
, localStorageAPI
, cookieAPI
.
jSQL.setApiPriority('localStorageAPI', 'WebSQLAPI');
Get the name of the API that is being used. Will return any of these: indexedDBAPI
, WebSQLAPI
, localStorageAPI
, cookieAPI
. This method must be called after jSQL has loaded (ie, inside the jSQL.load()
callback.
jSQL.load(function(){
alert("jSQL is storing your data in: "+jSQL.getApi());
});
jSQLTable.name
jSQLTable.columns
jSQLTable.data
jSQLTable.colmap
jSQLTable.renameColumn
jSQLTable.addColumn
jSQLTable.loadData
jSQLTable.insertRow
jSQLQuery.ifNotExists
jSQLQuery.ignore
jSQLQuery.execute
jSQLQuery.fetch
jSQLQuery.fetchAll
jSQLQuery.values
jSQLQuery.set
jSQLQuery.where
jSQLQuery.from
jSQLQuery.limit
jSQLQuery.orderBy
jSQLQuery.asc
jSQLQuery.desc
jSQLQuery.distinct
jSQLWhereClause.where
jSQLWhereClause.equals
jSQLWhereClause.preparedLike
jSQLWhereClause.doesNotEqual
jSQLWhereClause.lessThan
jSQLWhereClause.contains
jSQLWhereClause.endsWith
jSQLWhereClause.beginsWith
jSQLWhereClause.and
jSQLWhereClause.or
jSQLWhereClause.limit
jSQLWhereClause.orderBy
jSQLWhereClause.asc
jSQLWhereClause.desc
jSQLWhereClause.execute