Skip to content
This repository

Asynchronous, non-blocking SQLite3 bindings for Node.js

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 benchmark remove stale file
Octocat-spinner-32 examples match code formatting
Octocat-spinner-32 lib
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.md
Octocat-spinner-32 configure
Octocat-spinner-32 package.json
Octocat-spinner-32 sqlite3.js include correct file
Octocat-spinner-32 wscript
README.md

NAME

node-sqlite3 - Asynchronous, non-blocking SQLite3 bindings for node.js 0.2.* and 0.4.*.

USAGE

Install with npm install sqlite3.

var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(':memory:');

db.serialize(function() {
  db.run("CREATE TABLE lorem (info TEXT)");

  var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
  for (var i = 0; i < 10; i++) {
      stmt.run("Ipsum " + i);
  }
  stmt.finalize();

  db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
      console.log(row.id + ": " + row.info);
  });
});

db.close();

FEATURES

API

See the API documentation in the wiki.

BUILDING

Make sure you have the sources for sqlite3 installed. Mac OS X ships with these by default. If you don't have them installed, install the -dev package with your package manager, e.g. apt-get install libsqlite3-dev for Debian/Ubuntu. Make sure that you have at least libsqlite3 >= 3.6.

To obtain and build the bindings:

git clone git://github.com/developmentseed/node-sqlite3.git
cd node-sqlite3
./configure
make

You can also use npm to download and install them:

npm install sqlite3

TESTS

expresso is required to run unit tests.

npm install expresso
make test

CONTRIBUTORS

ACKNOWLEDGEMENTS

Thanks to Orlando Vazquez, Eric Fredricksen and Ryan Dahl for their SQLite bindings for node, and to mraleph on Freenode's #v8 for answering questions.

Development of this module is sponsored by Development Seed.

LICENSE

node-sqlite3 is BSD licensed.

Something went wrong with that request. Please try again.