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
44 lines (36 loc) · 1.2 KB

File metadata and controls

44 lines (36 loc) · 1.2 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
var sqlite3 = require('..');
var assert = require('assert');
var helper = require('./support/helper');
describe('parallel', function() {
var db;
before(function(done) {
helper.deleteFile('test/tmp/test_parallel_inserts.db');
helper.ensureExists('test/tmp');
db = new sqlite3.Database('test/tmp/test_parallel_inserts.db', done);
});
var columns = [];
for (var i = 0; i < 128; i++) {
columns.push('id' + i);
}
it('should create the table', function(done) {
db.run("CREATE TABLE foo (" + columns + ")", done);
});
it('should insert in parallel', function(done) {
for (var i = 0; i < 1000; i++) {
for (var values = [], j = 0; j < columns.length; j++) {
values.push(i * j);
}
db.run("INSERT INTO foo VALUES (" + values + ")");
}
db.wait(done);
});
it('should close the database', function(done) {
db.close(done);
});
it('should verify that the database exists', function() {
assert.fileExists('test/tmp/test_parallel_inserts.db');
});
after(function() {
helper.deleteFile('test/tmp/test_parallel_inserts.db');
});
});
Morty Proxy This is a proxified and sanitized view of the page, visit original site.