duckdb 0.3.5-dev1323.0 → 0.3.5-dev1334.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.
@@ -0,0 +1,82 @@
1
+ var sqlite3 = require("..");
2
+ var assert = require("assert");
3
+
4
+ describe("pathname search support", function () {
5
+ let db;
6
+ describe("without search paths", () => {
7
+ before((done) => {
8
+ db = new sqlite3.Database(":memory:", done);
9
+ });
10
+
11
+ it("supports a full path", function (done) {
12
+ db.prepare('select * from "test/support/prepare.csv"').all(
13
+ (err, result) => {
14
+ assert(err === null);
15
+ assert(result.length === 5000);
16
+ done();
17
+ }
18
+ );
19
+ });
20
+
21
+ it("don't not support a partial path", function (done) {
22
+ db.prepare('select * from "prepare.csv"').all((err, result) => {
23
+ assert(err.code === "DUCKDB_NODEJS_ERROR");
24
+ assert(err.errno === -1);
25
+ assert(result == null);
26
+ done();
27
+ });
28
+ });
29
+ });
30
+
31
+ describe("with search paths", () => {
32
+ before((done) => {
33
+ db = new sqlite3.Database(":memory:", () => {
34
+ db.prepare("SET FILE_SEARCH_PATH='test/support'").run(done);
35
+ });
36
+ });
37
+
38
+ it("supports a full path", function (done) {
39
+ db.prepare('select * from "test/support/prepare.csv"').all(
40
+ (err, result) => {
41
+ assert(err === null);
42
+ assert(result.length === 5000);
43
+ done();
44
+ }
45
+ );
46
+ });
47
+
48
+ it("supports a partial path", function (done) {
49
+ db.prepare('select * from "prepare.csv"').all((err, result) => {
50
+ assert(err === null);
51
+ assert(result.length === 5000);
52
+ done();
53
+ });
54
+ });
55
+ });
56
+
57
+ describe("with multiple search paths", () => {
58
+ before((done) => {
59
+ db = new sqlite3.Database(":memory:", () => {
60
+ db.prepare("SET FILE_SEARCH_PATH='test/support'").run(done);
61
+ });
62
+ });
63
+
64
+ it("supports a full path", function (done) {
65
+ db.prepare('select * from "test/support/prepare.csv"').all(
66
+ (err, result) => {
67
+ assert(err === null);
68
+ assert(result.length === 5000);
69
+ done();
70
+ }
71
+ );
72
+ });
73
+
74
+ it("supports a partial path", function (done) {
75
+ db.prepare('select * from "prepare.csv"').all((err, result) => {
76
+ assert(err === null);
77
+ assert(result.length === 5000);
78
+ done();
79
+ });
80
+ });
81
+ });
82
+ });