Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
32 lines (29 loc) · 1007 Bytes

File metadata and controls

32 lines (29 loc) · 1007 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var sqlite3 = require('..');
var assert = require('assert');
describe('query properties', function() {
var db;
before(function(done) {
db = new sqlite3.Database(':memory:');
db.run("CREATE TABLE foo (id INT, txt TEXT)", done);
});
it('should return the correct lastID', function(done) {
var stmt = db.prepare("INSERT INTO foo VALUES(?, ?)");
var j = 1;
for (var i = 0; i < 5000; i++) {
stmt.run(i, "demo", function(err) {
if (err) throw err;
// Relies on SQLite's row numbering to be gapless and starting
// from 1.
assert.equal(j++, this.lastID);
});
}
db.wait(done);
});
it('should return the correct changes count', function(done) {
db.run("UPDATE foo SET id = id + 1 WHERE id % 2 = 0", function(err) {
if (err) throw err;
assert.equal(2500, this.changes);
done();
});
});
});
Morty Proxy This is a proxified and sanitized view of the page, visit original site.