Commit 7b2cd3c8 by Eric Fredricksen Committed by Eric Fredricksen

Rename sqlite3.js without the 3

parent d1550a2b
...@@ -4,11 +4,11 @@ Node.js bindings for sqlite3 ...@@ -4,11 +4,11 @@ Node.js bindings for sqlite3
Functions Functions
------------------- -------------------
### `new sqlite3.Db(filename)` ### `sqlite.openDatabaseSync(filename)`
Returns an object representing the sqlite3 database with given filename. Returns an object representing the sqlite3 database with given filename.
### `sqlite3.Db.query(sql [,bindings] [,callback])` ### `DatabaseSync.query(sql [,bindings] [,callback])`
Executes the query `sql`, with variables bound from `bindings`. The Executes the query `sql`, with variables bound from `bindings`. The
variables can take the form `?` or `?NNN` where `NNN` is a number, in which variables can take the form `?` or `?NNN` where `NNN` is a number, in which
...@@ -29,7 +29,7 @@ Within the callback, `this` is an array of all such arrays, with a ...@@ -29,7 +29,7 @@ Within the callback, `this` is an array of all such arrays, with a
`count` property giving the total number of rows affected. That same `count` property giving the total number of rows affected. That same
`this` object is returned by `query`. `this` object is returned by `query`.
### `sqlite3.Db.close()` ### `sqlite.Db.close()`
Closes the database. Closes the database.
...@@ -37,8 +37,8 @@ Closes the database. ...@@ -37,8 +37,8 @@ Closes the database.
Example Example
-------- --------
var sqlite3 = require("./sqlite3"); var sqlite = require("./sqlite");
var db = new sqlite3.Db("test.db"); var db = new sqlite.Db("test.db");
db.query("INSERT INTO test (column) VALUES ($value)", {$value: 10}); db.query("INSERT INTO test (column) VALUES ($value)", {$value: 10});
db.query("SELECT column FROM test WHERE rowid<?", [5], function (rows) { db.query("SELECT column FROM test WHERE rowid<?", [5], function (rows) {
process.assert(rows[0].column == 10); process.assert(rows[0].column == 10);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import os, sys, time import os, sys, time
#filenames = sys.argv[1:] #filenames = sys.argv[1:]
filenames = ["sqlite3_bindings.cc", "wscript", "sqlite3.js", "test.js"] filenames = ["sqlite3_bindings.cc", "wscript", "sqlite.js", "test.js"]
mdname = "README" mdname = "README"
def handler(): def handler():
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
var sys = require("sys"); var sys = require("sys");
var posix = require("posix"); var posix = require("posix");
var sqlite3 = require("./sqlite3"); var sqlite = require("./sqlite");
posix.unlink('test.db'); posix.unlink('test.db');
var db = sqlite3.openDatabaseSync('test.db'); var db = sqlite.openDatabaseSync('test.db');
db.query("CREATE TABLE egg (a,y,e)"); db.query("CREATE TABLE egg (a,y,e)");
db.query("INSERT INTO egg (a) VALUES (1)", function () { db.query("INSERT INTO egg (a) VALUES (1)", function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment