We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be2162f commit e5c3c58Copy full SHA for e5c3c58
packages/duckdb/src/DuckDB.js
@@ -3,19 +3,23 @@ import { mergeBuffers } from './merge-buffers.js';
3
4
const TEMP_DIR = '.duckdb';
5
6
-const CONFIG = [
+const DEFAULT_INIT_STATEMENTS = [
7
`PRAGMA temp_directory='${TEMP_DIR}'`,
8
`INSTALL arrow`,
9
`INSTALL httpfs`,
10
`LOAD arrow`,
11
`LOAD httpfs`
12
-];
+].join(';\n');
13
14
export class DuckDB {
15
- constructor(path = ':memory:') {
16
- this.db = new duckdb.Database(path);
+ constructor(
+ path = ':memory:',
17
+ config = {},
18
+ initStatements = DEFAULT_INIT_STATEMENTS
19
+ ) {
20
+ this.db = new duckdb.Database(path, config);
21
this.con = this.db.connect();
- this.exec(CONFIG.join(';\n'));
22
+ this.exec(initStatements);
23
}
24
25
close() {
0 commit comments