Web SQL promise helper
Promise-based Web SQL interface. Specify Web or Cordova SQL batch in multiple steps (useful with libraries like Oboe.js).
LICENSE: ISC, MIT, or Apache 2.0
Promise dependency
This module depends on the standard Promise
object. Please use a polyfill if necessary.
Sample usage
Normal CommonJS
var newPromiseHelper = newPromiseHelper; var db = window; var helper = ; var tx = helper;tx;tx;tx; tx;
or with sqlite plugin:
var newPromiseHelper = newPromiseHelper; var db = windowsqlitePlugin; var helper = ; var tx = helper;tx;tx;tx; tx;
ES6
; const db = window; const helper = ; const tx = helper;tx;tx;tx; tx;
Then assemble the bundle using a tool such as RollupJS or JSPM.
GENERAL NOTE: Use of const
and let
may not work with some older browsers and devices. Possible solutions include:
- Just use
var
instead. - Use a tool like BabelJS (commonly used with JSPM, RollupJS, WebPack, etc.)
FUTURE TBD
- Full sqlBatch call with Promise-based API
- Read-only API functions