@malloydata/db-duckdb 0.0.424 → 0.0.426

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.
@@ -58,7 +58,8 @@ class DuckDBCommon extends connection_1.BaseConnection {
58
58
  await this.runRawSQL(statements[0]);
59
59
  statements.shift();
60
60
  }
61
- const retVal = await this.runRawSQL(statements[0]);
61
+ // DuckDB has no native tagging mechanism; fall back to a leading comment.
62
+ const retVal = await this.runRawSQL(this.sqlWithQueryMetadata(statements[0], options.queryMetadata));
62
63
  let result = retVal.rows;
63
64
  if (result.length > rowLimit) {
64
65
  result = result.slice(0, rowLimit);
@@ -91,7 +91,7 @@ export declare class DuckDBConnection extends DuckDBCommon {
91
91
  rows: QueryRecord[];
92
92
  totalRows: number;
93
93
  }>;
94
- runSQLStream(sql: string, { rowLimit, abortSignal }?: RunSQLOptions): AsyncIterableIterator<QueryRecord>;
94
+ runSQLStream(sql: string, { rowLimit, abortSignal, queryMetadata }?: RunSQLOptions): AsyncIterableIterator<QueryRecord>;
95
95
  close(): Promise<void>;
96
96
  idle(): Promise<void>;
97
97
  private detachShareableFile;
@@ -305,7 +305,7 @@ class DuckDBConnection extends duckdb_common_1.DuckDBCommon {
305
305
  totalRows: rows.length,
306
306
  };
307
307
  }
308
- async *runSQLStream(sql, { rowLimit, abortSignal } = {}) {
308
+ async *runSQLStream(sql, { rowLimit, abortSignal, queryMetadata } = {}) {
309
309
  const defaultOptions = this.readQueryOptions();
310
310
  rowLimit !== null && rowLimit !== void 0 ? rowLimit : (rowLimit = defaultOptions.rowLimit);
311
311
  await this.setup();
@@ -317,7 +317,7 @@ class DuckDBConnection extends duckdb_common_1.DuckDBCommon {
317
317
  await this.runDuckDBQuery(statements[0]);
318
318
  statements.shift();
319
319
  }
320
- const result = await this.connection.stream(statements[0]);
320
+ const result = await this.connection.stream(this.sqlWithQueryMetadata(statements[0], queryMetadata));
321
321
  let index = 0;
322
322
  for await (const chunk of result.yieldRowObjectJson()) {
323
323
  for (const row of chunk) {
@@ -35,7 +35,7 @@ export declare abstract class DuckDBWASMConnection extends DuckDBCommon {
35
35
  rows: QueryRecord[];
36
36
  totalRows: number;
37
37
  }>;
38
- runSQLStream(sql: string, { rowLimit, abortSignal }?: RunSQLOptions): AsyncIterableIterator<QueryRecord>;
38
+ runSQLStream(sql: string, { rowLimit, abortSignal, queryMetadata }?: RunSQLOptions): AsyncIterableIterator<QueryRecord>;
39
39
  private findTables;
40
40
  fetchSchemaForSQLStruct(sqlRef: SQLSourceRequest, options: FetchSchemaOptions): Promise<{
41
41
  structDef: SQLSourceDef;
@@ -392,7 +392,7 @@ class DuckDBWASMConnection extends duckdb_common_1.DuckDBCommon {
392
392
  throw new Error('Boom');
393
393
  }
394
394
  }
395
- async *runSQLStream(sql, { rowLimit, abortSignal } = {}) {
395
+ async *runSQLStream(sql, { rowLimit, abortSignal, queryMetadata } = {}) {
396
396
  if (!this.connection) {
397
397
  throw new Error('duckdb-wasm not connected');
398
398
  }
@@ -412,7 +412,7 @@ class DuckDBWASMConnection extends duckdb_common_1.DuckDBCommon {
412
412
  statements.shift();
413
413
  }
414
414
  let index = 0;
415
- for await (const chunk of await this.connection.send(statements[0])) {
415
+ for await (const chunk of await this.connection.send(this.sqlWithQueryMetadata(statements[0], queryMetadata))) {
416
416
  if (done) {
417
417
  break;
418
418
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-duckdb",
3
- "version": "0.0.424",
3
+ "version": "0.0.426",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -61,7 +61,7 @@
61
61
  "dependencies": {
62
62
  "@duckdb/duckdb-wasm": "1.33.1-dev45.0",
63
63
  "@duckdb/node-api": "1.5.3-r.2",
64
- "@malloydata/malloy": "0.0.424",
64
+ "@malloydata/malloy": "0.0.426",
65
65
  "@motherduck/wasm-client": "0.6.6",
66
66
  "apache-arrow": "^17.0.0",
67
67
  "web-worker": "^1.5.0"