duckdb 0.9.3-dev12.0 → 0.9.3-dev16.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/.github/workflows/NodeJS.yml +1 -1
- package/package.json +1 -1
- package/src/database.cpp +1 -0
- package/test/config.test.ts +30 -0
|
@@ -114,7 +114,7 @@ jobs:
|
|
|
114
114
|
strategy:
|
|
115
115
|
matrix:
|
|
116
116
|
target_arch: [ x64, arm64 ]
|
|
117
|
-
node: [ '
|
|
117
|
+
node: [ '16', '17', '18', '19', '20', '21']
|
|
118
118
|
isRelease:
|
|
119
119
|
- ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
|
|
120
120
|
exclude:
|
package/package.json
CHANGED
package/src/database.cpp
CHANGED
|
@@ -33,6 +33,7 @@ struct OpenTask : public Task {
|
|
|
33
33
|
: Task(database_, callback_), filename(filename_) {
|
|
34
34
|
|
|
35
35
|
duckdb_config.options.access_mode = access_mode_;
|
|
36
|
+
duckdb_config.SetOptionByName("duckdb_api", duckdb::Value("nodejs"));
|
|
36
37
|
Napi::Env env = database_.Env();
|
|
37
38
|
Napi::HandleScope scope(env);
|
|
38
39
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as duckdb from '..';
|
|
2
|
+
import * as assert from 'assert';
|
|
3
|
+
import {TableData} from "..";
|
|
4
|
+
|
|
5
|
+
describe('user_agent', () => {
|
|
6
|
+
|
|
7
|
+
it('default value', (done) => {
|
|
8
|
+
const db: duckdb.Database = new duckdb.Database(':memory:');
|
|
9
|
+
|
|
10
|
+
db.all('PRAGMA USER_AGENT', (err: null | Error, rows: TableData) => {
|
|
11
|
+
if (err) {
|
|
12
|
+
throw err;
|
|
13
|
+
}
|
|
14
|
+
assert.match(rows[0].user_agent, /duckdb\/.*\(*\) nodejs/);
|
|
15
|
+
done();
|
|
16
|
+
});
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('with custom_user_agent', (done) => {
|
|
20
|
+
const db: duckdb.Database = new duckdb.Database(':memory:', { 'custom_user_agent': 'a_framework' });
|
|
21
|
+
|
|
22
|
+
db.all('PRAGMA USER_AGENT', (err: null | Error, rows: TableData) => {
|
|
23
|
+
if (err) {
|
|
24
|
+
throw err;
|
|
25
|
+
}
|
|
26
|
+
assert.match(rows[0].user_agent, /duckdb\/.*\(*\) nodejs a_framework/);
|
|
27
|
+
done();
|
|
28
|
+
});
|
|
29
|
+
})
|
|
30
|
+
})
|