sqlite logo


The SQLite module makes the SQLite database available in JavaScript.


sqlite.Database represents a database. When the database doens't exist, the database will be created.

var db = new sqlite.Database("person.db");

Executing SQL statements

SQL statements can be executed with exec or prepare. Use exec when you don't need information from the database:

db.exec("CREATE TABLE person(name TEXT, nr INTEGER)");

Use prepare when you need information from the database. prepare will return a sqlite.Statement object. sqlite.Statement allows you to iterate the results of the SQL statements.

var stmt = db.prepare("SELECT * FROM person");
var row;
while(row = stmt.fetchObject())

Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.