I am the author of this port of the latest sqlite for javascript: https://github.com/lovasoa/sql.js
It is based on what you mentioned ( https://github.com/kripken/sql.js ), but includes many improvements, including full documentation: http://lovasoa.imtqy.com/sql.js/documentation /
Here is an example of using this version sql.js
<script src='js/sql.js'></script>
<script>
var db = new SQL.Database();
db.run("CREATE TABLE test (col1, col2);");
db.run("INSERT INTO test VALUES (?,?), (?,?)", [1,111,2,222]);
var stmt = db.prepare("SELECT * FROM test WHERE col1 BETWEEN $start AND $end");
stmt.getAsObject({$start:1, $end:1});
stmt.bind({$start:1, $end:2});
while(stmt.step()) {
var row = stmt.getAsObject();
}
</script>
source
share