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
07baf0f0
Commit
07baf0f0
authored
Mar 29, 2010
by
Orlando Vazquez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove some dead code
parent
c380ceb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
65 deletions
+1
-65
sqlite.js
sqlite.js
+1
-65
.speedtest.js.swp
tests/.speedtest.js.swp
+0
-0
No files found.
sqlite.js
View file @
07baf0f0
...
@@ -24,12 +24,6 @@ var Database = exports.Database = function () {
...
@@ -24,12 +24,6 @@ var Database = exports.Database = function () {
var
db
=
new
sqlite
.
Database
();
var
db
=
new
sqlite
.
Database
();
db
.
__proto__
=
Database
.
prototype
;
db
.
__proto__
=
Database
.
prototype
;
// this.queue = [];
//
// this.addListener("ready", function () {
// db.dispatch();
// });
return
db
;
return
db
;
};
};
...
@@ -38,21 +32,6 @@ Database.prototype = {
...
@@ -38,21 +32,6 @@ Database.prototype = {
constructor
:
Database
,
constructor
:
Database
,
};
};
// Database.prototype.dispatch = function () {
// if (!this.queue || this.currentQuery
// || !this.queue.length) {
// return;
// }
// this.currentQuery = this.queue.shift();
// this.executeQuery.apply(this, this.currentQuery);
// }
// Database.prototype.query = function (sql, bindings, queryCallback) {
// this.queue = this.queue || [];
// this.queue.push([sql, bindings, queryCallback]);
// this.dispatch();
// }
// Iterate over the list of bindings. Since we can't use something as
// Iterate over the list of bindings. Since we can't use something as
// simple as a for or while loop, we'll just chain them via the event loop
// simple as a for or while loop, we'll just chain them via the event loop
function
_setBindingsByIndex
(
db
,
function
_setBindingsByIndex
(
db
,
...
@@ -97,7 +76,7 @@ function _doStep(db, statement, rowCallback) {
...
@@ -97,7 +76,7 @@ function _doStep(db, statement, rowCallback) {
return
;
return
;
}
}
rowCallback
(
row
);
rowCallback
(
row
);
process
.
nextTick
(
function
()
{
_doStep
(
db
,
statement
,
rowCallback
);
}
);
_doStep
(
db
,
statement
,
rowCallback
);
});
});
}
}
...
@@ -130,49 +109,6 @@ Database.prototype.query = function(sql, bindings, rowCallback) {
...
@@ -130,49 +109,6 @@ Database.prototype.query = function(sql, bindings, rowCallback) {
}
else
{
}
else
{
rowCallback
();
rowCallback
();
self
.
currentQuery
=
undefined
;
self
.
currentQuery
=
undefined
;
// if there are any queries queued, let them know it's safe to go
// self.dispatch();
}
}
});
});
}
}
function
SQLTransactionSync
(
db
,
txCallback
,
errCallback
,
successCallback
)
{
this
.
database
=
db
;
this
.
rolledBack
=
false
;
this
.
executeSql
=
function
(
sqlStatement
,
arguments
,
callback
)
{
if
(
this
.
rolledBack
)
return
;
var
result
=
db
.
query
(
sqlStatement
,
arguments
);
if
(
callback
)
{
var
tx
=
this
;
callback
.
apply
(
result
,
[
tx
].
concat
(
result
.
all
));
}
return
result
;
}
var
that
=
this
;
function
unroll
()
{
that
.
rolledBack
=
true
;
}
db
.
addListener
(
"rollback"
,
unroll
);
this
.
executeSql
(
"BEGIN TRANSACTION"
);
txCallback
(
this
);
this
.
executeSql
(
"COMMIT"
);
db
.
removeListener
(
"rollback"
,
unroll
);
if
(
!
this
.
rolledBack
&&
successCallback
)
successCallback
(
this
);
}
Database
.
prototype
.
transaction
=
function
(
txCallback
,
errCallback
,
successCallback
)
{
var
tx
=
new
SQLTransactionSync
(
this
,
txCallback
,
errCallback
,
successCallback
);
}
// TODO: readTransaction()
tests/.speedtest.js.swp
deleted
100644 → 0
View file @
c380ceb5
File deleted
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