Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sqlite3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
node-sqlite3
Commits
7b2cd3c8
Commit
7b2cd3c8
authored
Dec 07, 2009
by
Eric Fredricksen
Committed by
Eric Fredricksen
Dec 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename sqlite3.js without the 3
parent
d1550a2b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
README
README
+5
-5
compiloop.py
compiloop.py
+1
-1
sqlite.js
sqlite.js
+0
-0
test.js
test.js
+2
-2
No files found.
README
View file @
7b2cd3c8
...
@@ -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`.
### `sqlite
3
.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 sqlite
3 = require("./sqlite3
");
var sqlite
= require("./sqlite
");
var db = new sqlite
3
.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);
...
...
compiloop.py
View file @
7b2cd3c8
...
@@ -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"
,
"sqlite
3
.js"
,
"test.js"
]
filenames
=
[
"sqlite3_bindings.cc"
,
"wscript"
,
"sqlite.js"
,
"test.js"
]
mdname
=
"README"
mdname
=
"README"
def
handler
():
def
handler
():
...
...
sqlite
3
.js
→
sqlite.js
View file @
7b2cd3c8
File moved
test.js
View file @
7b2cd3c8
...
@@ -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
sqlite
3
=
require
(
"./sqlite3
"
);
var
sqlite
=
require
(
"./sqlite
"
);
posix
.
unlink
(
'test.db'
);
posix
.
unlink
(
'test.db'
);
var
db
=
sqlite
3
.
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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment