Skip to content

Repository files navigation

WebSQLShim - SQLite/WebSQL SQL Parser

Version 0.0.2 (31.01.2015) ChangelogRelease plan

Warning

Sorry, work still in progress. Only WebSQL/SQLite SQL parser is ready for the moment.

You can also look at the AlaSQL project with IndexedDB support.

Usage

To use WebSQLShim add the websqlshim.js library to your page:

<scriptsrc="websqlshim.js"></script><script>vardb=WebSQLShim.openDatabase("mybase",'0.1','',100000);db.transaction(function(tx){tx.executeSql('SELECT * FROM one WHERE a = ?',[10],function(result){},function(error){console.log(error);});});</script>

In case you want to use WebSQLShim as WebSQL shim add this replacement code:

<scriptsrc="websqlshim.js"></script><script>if(typeofopenDatabase=='undefined')openDatabase=WebSQLShim.openDatabase;//...vardb=openDatabase("mybase",'0.1','',100000);//...</script>

SQL parser

WebSQL/SQLite language Jison grammar file and JavaScript parser.

Tests

Use Mocha.js test package. To run tests in Node.js:

 cd test/main // main function tests
mocha .
cd test/parser // parser tests
mocha .

Andrey Gershun MIT LICENSE

About

WebSQLShim - WebSQL shim over IndexedDB

Resources

Stars

18 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages