duckdb 0.6.2-dev6.0 → 0.6.2-dev604.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.json +2 -2
- package/README.md +17 -0
- package/lib/duckdb.d.ts +29 -11
- package/lib/duckdb.js +6 -0
- package/package.json +1 -1
- package/src/duckdb.cpp +17094 -14736
- package/src/duckdb.hpp +9807 -9354
- package/src/parquet-amalgamation.cpp +35355 -35128
- package/src/parquet-amalgamation.hpp +46 -4
- package/test/{affected.test.js → affected.test.ts} +8 -10
- package/test/{arrow.test.js → arrow.test.ts} +12 -11
- package/test/{data_type_support.test.js → data_type_support.test.ts} +36 -35
- package/test/{database_fail.test.js → database_fail.test.ts} +25 -24
- package/test/{each.test.js → each.test.ts} +10 -9
- package/test/{exec.test.js → exec.test.ts} +7 -6
- package/test/{extension.test.js → extension.test.ts} +20 -19
- package/test/{interrupt.test.js → interrupt.test.ts} +7 -7
- package/test/{jsdoc.test.js → jsdoc.test.ts} +19 -20
- package/test/{named_columns.test.js → named_columns.test.ts} +4 -6
- package/test/{null_error.test.js → null_error.test.ts} +5 -6
- package/test/{open_close.test.js → open_close.test.ts} +10 -10
- package/test/{parallel_insert.test.js → parallel_insert.test.ts} +6 -7
- package/test/{parquet.js → parquet.test.ts} +2 -4
- package/test/{pathnames.test.js → pathnames.test.ts} +24 -22
- package/test/{prepare.test.js → prepare.test.ts} +53 -50
- package/test/{query_result.test.js → query_result.test.ts} +4 -4
- package/test/{serialization.test.js → serialization.test.ts} +10 -9
- package/test/support/helper.ts +42 -0
- package/test/{syntax_error.test.js → syntax_error.test.ts} +4 -4
- package/test/{udf.test.js → udf.test.ts} +26 -25
- package/test/{unicode.test.js → unicode.test.ts} +23 -22
- package/test/support/helper.js +0 -37
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as duckdb from '..';
|
|
2
|
+
import {Database, TableData} from '..';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as assert from 'assert';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import {Done} from "mocha";
|
|
5
7
|
|
|
6
8
|
const extension_base_path = "../../../build/release/extension";
|
|
7
9
|
|
|
8
10
|
// Look for extensions that we can load and test
|
|
9
|
-
let extension_paths = [];
|
|
11
|
+
let extension_paths: string[] = [];
|
|
10
12
|
const extension_full_path = path.resolve(__dirname, extension_base_path);
|
|
11
13
|
if (fs.existsSync(extension_full_path)) {
|
|
12
|
-
extension_paths =
|
|
13
|
-
if (!fs.statSync(extension_full_path+'/'+file).isDirectory())
|
|
14
|
+
extension_paths = fs.readdirSync(extension_full_path).map(function (file) {
|
|
15
|
+
if (!fs.statSync(extension_full_path + '/' + file).isDirectory())
|
|
14
16
|
return undefined;
|
|
15
|
-
const potential_extension_path = extension_full_path
|
|
17
|
+
const potential_extension_path = extension_full_path + `/${file}/${file}.duckdb_extension`;
|
|
16
18
|
if (fs.existsSync(potential_extension_path)) {
|
|
17
19
|
return potential_extension_path;
|
|
18
20
|
}
|
|
19
|
-
}).filter(a=>a)
|
|
21
|
+
}).filter(a => a) as string[];
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
// Note: test will pass on http request failing due to connection issues.
|
|
23
|
-
const test_httpfs = async function (db, done) {
|
|
24
|
-
db.all("SELECT id, first_name, last_name FROM PARQUET_SCAN('https://raw.githubusercontent.com/cwida/duckdb/master/data/parquet-testing/userdata1.parquet') LIMIT 3;", function(err, rows) {
|
|
25
|
+
const test_httpfs = async function (db: duckdb.Database, done: Done) {
|
|
26
|
+
db.all("SELECT id, first_name, last_name FROM PARQUET_SCAN('https://raw.githubusercontent.com/cwida/duckdb/master/data/parquet-testing/userdata1.parquet') LIMIT 3;", function(err: null | Error, rows: TableData) {
|
|
25
27
|
if (err) {
|
|
26
28
|
if (err.message.startsWith("Unable to connect to URL")) {
|
|
27
29
|
console.warn("Warning: HTTP request failed in extension.test.js");
|
|
@@ -40,8 +42,8 @@ const test_httpfs = async function (db, done) {
|
|
|
40
42
|
});
|
|
41
43
|
};
|
|
42
44
|
|
|
43
|
-
const test_tpch = async function (db, done) {
|
|
44
|
-
db.all("CALL DBGEN(sf=0.01);", function(err) {
|
|
45
|
+
const test_tpch = async function (db: Database, done:Done) {
|
|
46
|
+
db.all("CALL DBGEN(sf=0.01);", function(err: null | Error) {
|
|
45
47
|
if (err) {
|
|
46
48
|
throw err;
|
|
47
49
|
}
|
|
@@ -49,7 +51,7 @@ const test_tpch = async function (db, done) {
|
|
|
49
51
|
});
|
|
50
52
|
};
|
|
51
53
|
|
|
52
|
-
const test_extension = function(extension_name, db, done) {
|
|
54
|
+
const test_extension = function(extension_name: string, db: duckdb.Database, done: Done) {
|
|
53
55
|
switch(extension_name) {
|
|
54
56
|
case 'httpfs.duckdb_extension':
|
|
55
57
|
test_httpfs(db, done);
|
|
@@ -64,22 +66,21 @@ const test_extension = function(extension_name, db, done) {
|
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
describe('Extension loading', function() {
|
|
67
|
-
var db;
|
|
69
|
+
var db: Database;
|
|
68
70
|
|
|
69
71
|
before(function(done) {
|
|
70
72
|
db = new duckdb.Database(':memory:', {"allow_unsigned_extensions":"true"}, done);
|
|
71
73
|
});
|
|
72
74
|
|
|
73
|
-
for (
|
|
74
|
-
const
|
|
75
|
-
const extension_name = ext.replace(/^.*[\\\/]/, '');
|
|
75
|
+
for (let extension_path of extension_paths) {
|
|
76
|
+
const extension_name = extension_path.replace(/^.*[\\\/]/, '');
|
|
76
77
|
|
|
77
78
|
if (extension_name.startsWith('parquet')) { // Parquet is built-in in the Node client, so skip
|
|
78
79
|
continue;
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
it(extension_name, function(done) {
|
|
82
|
-
db.run(`LOAD '${extension_path}';`, function(err) {
|
|
83
|
+
db.run(`LOAD '${extension_path}';`, function(err: null | Error) {
|
|
83
84
|
if (err) {
|
|
84
85
|
throw err;
|
|
85
86
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as sqlite3 from '..';
|
|
2
|
+
import * as assert from 'assert';
|
|
3
|
+
import {DuckDbError} from "..";
|
|
3
4
|
|
|
4
5
|
// FIXME each is not streaming yet
|
|
5
|
-
return
|
|
6
6
|
|
|
7
|
-
describe('interrupt', function() {
|
|
7
|
+
describe.skip('interrupt', function() {
|
|
8
8
|
it('should interrupt queries', function(done) {
|
|
9
9
|
var interrupted = false;
|
|
10
|
-
var saved = null;
|
|
10
|
+
var saved: DuckDbError | null = null;
|
|
11
11
|
|
|
12
12
|
var db = new sqlite3.Database(':memory:', function() {
|
|
13
13
|
db.serialize();
|
|
@@ -17,7 +17,7 @@ describe('interrupt', function() {
|
|
|
17
17
|
setup += 'insert into t values (' + i + ');';
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
db.exec(setup, function(err) {
|
|
20
|
+
db.exec(setup, function(err: null | Error) {
|
|
21
21
|
if (err) {
|
|
22
22
|
return done(err);
|
|
23
23
|
}
|
|
@@ -25,7 +25,7 @@ describe('interrupt', function() {
|
|
|
25
25
|
var query = 'select last.n ' +
|
|
26
26
|
'from t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t as last';
|
|
27
27
|
|
|
28
|
-
db.each(query, function(err) {
|
|
28
|
+
db.each(query, function(err: null | DuckDbError) {
|
|
29
29
|
if (err) {
|
|
30
30
|
saved = err;
|
|
31
31
|
} else if (!interrupted) {
|
|
@@ -2,46 +2,43 @@
|
|
|
2
2
|
* Intended to be similar to stubtest for python
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import * as duckdb from "..";
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
import jsdoc from "jsdoc3-parser";
|
|
7
8
|
const { expect } = require('chai');
|
|
8
9
|
const { promisify } = require('util');
|
|
9
10
|
|
|
10
|
-
function lastDot(string) {
|
|
11
|
+
function lastDot(string: string) {
|
|
11
12
|
if (string.endsWith(')')) {
|
|
12
|
-
string = string.
|
|
13
|
+
string = string.substring(0, string.length - 1);
|
|
13
14
|
}
|
|
14
15
|
const array = string.split('.');
|
|
15
16
|
return array[array.length - 1];
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
export interface Node {
|
|
20
|
+
undocumented: boolean;
|
|
21
|
+
name: string;
|
|
22
|
+
memberof: string;
|
|
23
|
+
longname: string;
|
|
24
|
+
scope: string;
|
|
25
|
+
}
|
|
26
26
|
describe("JSDoc contains all methods", () => {
|
|
27
|
-
|
|
28
|
-
* @type {Node[]}
|
|
29
|
-
*/
|
|
30
|
-
let docs;
|
|
27
|
+
let docs: Node[];
|
|
31
28
|
before(async () => {
|
|
32
29
|
docs = await promisify(jsdoc)(require.resolve("../lib/duckdb"));
|
|
33
30
|
})
|
|
34
31
|
|
|
35
|
-
function checkDocs(obj, scope) {
|
|
32
|
+
function checkDocs(obj: object, scope: string) {
|
|
36
33
|
const symbols = Object.getOwnPropertySymbols(obj).map(i => lastDot(i.toString()));
|
|
37
34
|
const expected = Object
|
|
38
35
|
.getOwnPropertyNames(obj)
|
|
39
36
|
.concat(symbols)
|
|
40
37
|
.sort()
|
|
41
|
-
.filter(name => name !== 'constructor');
|
|
38
|
+
.filter(name => name !== 'constructor' && name !== 'default');
|
|
42
39
|
|
|
43
40
|
const actual = docs
|
|
44
|
-
.filter((node) => node.memberof === scope && !node.undocumented)
|
|
41
|
+
.filter((node) => node.memberof === scope && !node.undocumented && node.name !== 'sql') // `sql` is a field, so won't show up in the prototype
|
|
45
42
|
.map((node) => lastDot(node.name))
|
|
46
43
|
.sort();
|
|
47
44
|
|
|
@@ -50,7 +47,9 @@ describe("JSDoc contains all methods", () => {
|
|
|
50
47
|
|
|
51
48
|
for (const clazz of ['Database', 'QueryResult', 'Connection', 'Statement']) {
|
|
52
49
|
it(clazz, () => {
|
|
53
|
-
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
let clazzObj = duckdb[clazz];
|
|
52
|
+
checkDocs(clazzObj.prototype, `module:duckdb~${clazz}`);
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
55
|
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as sqlite3 from '..';
|
|
2
|
+
import * as assert from 'assert';
|
|
3
3
|
|
|
4
4
|
// TODO
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
describe('named columns', function() {
|
|
8
|
-
var db;
|
|
5
|
+
describe.skip('named columns', function() {
|
|
6
|
+
var db: sqlite3.Database;
|
|
9
7
|
before(function(done) {
|
|
10
8
|
db = new sqlite3.Database(':memory:', done);
|
|
11
9
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var helper = require('./support/helper');
|
|
1
|
+
import * as sqlite3 from '..';
|
|
2
|
+
import * as helper from './support/helper';
|
|
4
3
|
|
|
5
4
|
describe('null error', function() {
|
|
6
5
|
var filename = 'test/tmp/test_sqlite_ok_error.db';
|
|
7
|
-
var db;
|
|
6
|
+
var db: sqlite3.Database;
|
|
8
7
|
|
|
9
8
|
before(function(done) {
|
|
10
9
|
helper.ensureExists('test/tmp');
|
|
@@ -17,7 +16,7 @@ describe('null error', function() {
|
|
|
17
16
|
});
|
|
18
17
|
|
|
19
18
|
it('should insert rows with lots of null values', function(done) {
|
|
20
|
-
var stmt = db.prepare('INSERT INTO febp_data VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', function(err) {
|
|
19
|
+
var stmt = db.prepare('INSERT INTO febp_data VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', function(err: null | Error) {
|
|
21
20
|
if (err) throw err;
|
|
22
21
|
|
|
23
22
|
for (var i = 0; i < 100; i++) {
|
|
@@ -32,7 +31,7 @@ describe('null error', function() {
|
|
|
32
31
|
});
|
|
33
32
|
|
|
34
33
|
it('should have created the database', function() {
|
|
35
|
-
|
|
34
|
+
helper.fileExists(filename);
|
|
36
35
|
});
|
|
37
36
|
|
|
38
37
|
after(function() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as sqlite3 from '..';
|
|
2
|
+
import * as assert from 'assert';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as helper from './support/helper';
|
|
5
5
|
|
|
6
6
|
describe('open/close', function() {
|
|
7
7
|
before(function() {
|
|
@@ -13,7 +13,7 @@ describe('open/close', function() {
|
|
|
13
13
|
helper.deleteFile('test/tmp/test_create.db');
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
var db;
|
|
16
|
+
var db: sqlite3.Database;
|
|
17
17
|
it('should open the database', function(done) {
|
|
18
18
|
db = new sqlite3.Database('test/tmp/test_create.db', done);
|
|
19
19
|
});
|
|
@@ -23,7 +23,7 @@ describe('open/close', function() {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
it('should have created the file', function() {
|
|
26
|
-
|
|
26
|
+
helper.fileExists('test/tmp/test_create.db');
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
after(function() {
|
|
@@ -123,7 +123,7 @@ describe('open/close', function() {
|
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
it('should not have created the file', function() {
|
|
126
|
-
|
|
126
|
+
helper.fileDoesNotExist('test/tmp/test_readonly.db');
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
after(function() {
|
|
@@ -132,7 +132,7 @@ describe('open/close', function() {
|
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
describe('open and close memory database queuing', function() {
|
|
135
|
-
var db;
|
|
135
|
+
var db: sqlite3.Database;
|
|
136
136
|
it('should open the database', function(done) {
|
|
137
137
|
db = new sqlite3.Database(':memory:', done);
|
|
138
138
|
});
|
|
@@ -155,7 +155,7 @@ describe('open/close', function() {
|
|
|
155
155
|
var completedSecond = false;
|
|
156
156
|
var closed = false;
|
|
157
157
|
|
|
158
|
-
var db;
|
|
158
|
+
var db: sqlite3.Database;
|
|
159
159
|
before(function(done) {
|
|
160
160
|
db = new sqlite3.Database(':memory:', done);
|
|
161
161
|
});
|
|
@@ -164,7 +164,7 @@ describe('open/close', function() {
|
|
|
164
164
|
db.run("CREATE TABLE foo (id INT, num INT)", done);
|
|
165
165
|
});
|
|
166
166
|
|
|
167
|
-
var stmt;
|
|
167
|
+
var stmt: sqlite3.Statement;
|
|
168
168
|
it('should prepare/run a statement', function(done) {
|
|
169
169
|
stmt = db.prepare('INSERT INTO foo VALUES (?, ?)');
|
|
170
170
|
stmt.run(1, 2, done);
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var helper = require('./support/helper');
|
|
1
|
+
import * as sqlite3 from '..';
|
|
2
|
+
import * as helper from './support/helper';
|
|
4
3
|
|
|
5
4
|
describe('parallel', function() {
|
|
6
|
-
var db;
|
|
5
|
+
var db: sqlite3.Database;
|
|
7
6
|
before(function(done) {
|
|
8
7
|
helper.deleteFile('test/tmp/test_parallel_inserts.db');
|
|
9
8
|
helper.ensureExists('test/tmp');
|
|
10
9
|
db = new sqlite3.Database('test/tmp/test_parallel_inserts.db', done);
|
|
11
10
|
});
|
|
12
11
|
|
|
13
|
-
var columns = [];
|
|
12
|
+
var columns: string[] = [];
|
|
14
13
|
for (var i = 0; i < 128; i++) {
|
|
15
14
|
columns.push('id' + i + " INTEGER");
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
it('should create the table', function(done) {
|
|
19
|
-
db.run("CREATE TABLE foo (" + columns + ")", function(err) {
|
|
18
|
+
db.run("CREATE TABLE foo (" + columns + ")", function(err: null | Error) {
|
|
20
19
|
done();
|
|
21
20
|
});
|
|
22
21
|
});
|
|
@@ -37,7 +36,7 @@ describe('parallel', function() {
|
|
|
37
36
|
});
|
|
38
37
|
|
|
39
38
|
it('should verify that the database exists', function() {
|
|
40
|
-
|
|
39
|
+
helper.fileExists('test/tmp/test_parallel_inserts.db');
|
|
41
40
|
});
|
|
42
41
|
|
|
43
42
|
after(function() {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
var assert = require('assert');
|
|
3
|
-
var helper = require('./support/helper');
|
|
1
|
+
import * as sqlite3 from '..';
|
|
4
2
|
|
|
5
3
|
describe('can query parquet', function() {
|
|
6
|
-
var db;
|
|
4
|
+
var db: sqlite3.Database;
|
|
7
5
|
|
|
8
6
|
before(function(done) {
|
|
9
7
|
db = new sqlite3.Database(':memory:', done);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as sqlite3 from "..";
|
|
2
|
+
import * as assert from "assert";
|
|
3
|
+
import {DuckDbError, TableData} from "..";
|
|
3
4
|
|
|
4
5
|
describe("pathname search support", function () {
|
|
5
|
-
let db;
|
|
6
|
+
let db: sqlite3.Database;
|
|
6
7
|
describe("without search paths", () => {
|
|
7
8
|
before((done) => {
|
|
8
9
|
db = new sqlite3.Database(":memory:", done);
|
|
@@ -10,19 +11,20 @@ describe("pathname search support", function () {
|
|
|
10
11
|
|
|
11
12
|
it("supports a full path", function (done) {
|
|
12
13
|
db.prepare('select * from "test/support/prepare.csv"').all(
|
|
13
|
-
(err, result) => {
|
|
14
|
-
assert(err
|
|
15
|
-
assert(result.length
|
|
14
|
+
(err: null | Error, result: TableData) => {
|
|
15
|
+
assert.equal(err, null);
|
|
16
|
+
assert.equal(result.length, 5000);
|
|
16
17
|
done();
|
|
17
18
|
}
|
|
18
19
|
);
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
it("don't not support a partial path", function (done) {
|
|
22
|
-
db.prepare('select * from "prepare.csv"').all((err, result) => {
|
|
23
|
-
assert(err
|
|
24
|
-
assert(err.
|
|
25
|
-
assert(
|
|
23
|
+
db.prepare('select * from "prepare.csv"').all((err: null | DuckDbError, result: TableData) => {
|
|
24
|
+
assert.ok(err);
|
|
25
|
+
assert.equal(err.code, "DUCKDB_NODEJS_ERROR");
|
|
26
|
+
assert.equal(err.errno, -1);
|
|
27
|
+
assert.equal(result, null);
|
|
26
28
|
done();
|
|
27
29
|
});
|
|
28
30
|
});
|
|
@@ -37,18 +39,18 @@ describe("pathname search support", function () {
|
|
|
37
39
|
|
|
38
40
|
it("supports a full path", function (done) {
|
|
39
41
|
db.prepare('select * from "test/support/prepare.csv"').all(
|
|
40
|
-
(err, result) => {
|
|
41
|
-
assert(err
|
|
42
|
-
assert(result.length
|
|
42
|
+
(err: null | Error, result: TableData) => {
|
|
43
|
+
assert.equal(err, null);
|
|
44
|
+
assert.equal(result.length, 5000);
|
|
43
45
|
done();
|
|
44
46
|
}
|
|
45
47
|
);
|
|
46
48
|
});
|
|
47
49
|
|
|
48
50
|
it("supports a partial path", function (done) {
|
|
49
|
-
db.prepare('select * from "prepare.csv"').all((err, result) => {
|
|
50
|
-
assert(err
|
|
51
|
-
assert(result.length
|
|
51
|
+
db.prepare('select * from "prepare.csv"').all((err: null | Error, result: TableData) => {
|
|
52
|
+
assert.equal(err, null);
|
|
53
|
+
assert.equal(result.length, 5000);
|
|
52
54
|
done();
|
|
53
55
|
});
|
|
54
56
|
});
|
|
@@ -63,18 +65,18 @@ describe("pathname search support", function () {
|
|
|
63
65
|
|
|
64
66
|
it("supports a full path", function (done) {
|
|
65
67
|
db.prepare('select * from "test/support/prepare.csv"').all(
|
|
66
|
-
(err, result) => {
|
|
67
|
-
assert(err
|
|
68
|
-
assert(result.length
|
|
68
|
+
(err: null | Error, result: TableData) => {
|
|
69
|
+
assert.equal(err, null);
|
|
70
|
+
assert.equal(result.length, 5000);
|
|
69
71
|
done();
|
|
70
72
|
}
|
|
71
73
|
);
|
|
72
74
|
});
|
|
73
75
|
|
|
74
76
|
it("supports a partial path", function (done) {
|
|
75
|
-
db.prepare('select * from "prepare.csv"').all((err, result) => {
|
|
76
|
-
assert(err
|
|
77
|
-
assert(result.length
|
|
77
|
+
db.prepare('select * from "prepare.csv"').all((err: null | Error, result: TableData) => {
|
|
78
|
+
assert.equal(err, null);
|
|
79
|
+
assert.equal(result.length, 5000);
|
|
78
80
|
done();
|
|
79
81
|
});
|
|
80
82
|
});
|