Version 0.0.2 (31.01.2015) Changelog Release plan
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.
To use WebSQLShim add the websqlshim.js library to your page:
<script src="websqlshim.js"></script>
<script>
var db = 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:
<script src="websqlshim.js"></script>
<script>
if (typeof openDatabase == 'undefined') openDatabase = WebSQLShim.openDatabase;
//...
var db = openDatabase("mybase",'0.1','',100000);
//...
</script>
WebSQL/SQLite language Jison grammar file and JavaScript parser.
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