@malloydata/db-duckdb 0.0.146-dev240514182101 → 0.0.146-dev240517191056

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.
@@ -90,6 +90,7 @@ class DuckDBConnection extends duckdb_common_1.DuckDBCommon {
90
90
  if (this.isMotherDuck) {
91
91
  if (this.motherDuckToken) {
92
92
  process.env['motherduck_token'] = this.motherDuckToken;
93
+ process.env['MOTHERDUCK_TOKEN'] = this.motherDuckToken;
93
94
  }
94
95
  if (!process.env['motherduck_token'] &&
95
96
  !process.env['MOTHERDUCK_TOKEN']) {
@@ -51,11 +51,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.DuckDBWASMConnection = exports.unwrapRow = exports.unwrapArrow = void 0;
52
52
  const duckdb = __importStar(require("@duckdb/duckdb-wasm"));
53
53
  const web_worker_1 = __importDefault(require("web-worker"));
54
- const apache_arrow_1 = require("apache-arrow");
55
54
  const duckdb_common_1 = require("./duckdb_common");
56
55
  const TABLE_MATCH = /FROM\s*('([^']*)'|"([^"]*)")/gi;
57
56
  const TABLE_FUNCTION_MATCH = /FROM\s+[a-z0-9_]+\(('([^']*)'|"([^"]*)")/gi;
58
57
  const FILE_EXTS = ['.csv', '.tsv', '.parquet'];
58
+ const isIterable = (x) => Symbol.iterator in x;
59
59
  /**
60
60
  * Arrow's toJSON() doesn't really do what I'd expect, since
61
61
  * it still includes Arrow objects like DecimalBigNums and Vectors,
@@ -69,9 +69,6 @@ const unwrapArrow = (value) => {
69
69
  if (value === null) {
70
70
  return value;
71
71
  }
72
- else if (value instanceof apache_arrow_1.Vector) {
73
- return [...value].map(exports.unwrapArrow);
74
- }
75
72
  else if (value instanceof Date) {
76
73
  return value;
77
74
  }
@@ -91,6 +88,10 @@ const unwrapArrow = (value) => {
91
88
  else if (Array.isArray(value)) {
92
89
  return value.map(exports.unwrapArrow);
93
90
  }
91
+ else if (isIterable(value)) {
92
+ // Catch Arrow Vector objects
93
+ return [...value].map(exports.unwrapArrow);
94
+ }
94
95
  else {
95
96
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
96
97
  const result = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-duckdb",
3
- "version": "0.0.146-dev240514182101",
3
+ "version": "0.0.146-dev240517191056",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -40,11 +40,11 @@
40
40
  "prepublishOnly": "npm run build"
41
41
  },
42
42
  "dependencies": {
43
- "@duckdb/duckdb-wasm": "1.28.1-dev106.0",
44
- "@malloydata/malloy": "^0.0.146-dev240514182101",
45
- "@motherduck/wasm-client": "^0.4.0",
46
- "apache-arrow": "^14.0.0",
47
- "duckdb": "0.9.2",
43
+ "@duckdb/duckdb-wasm": "1.28.1-dev195.0",
44
+ "@malloydata/malloy": "^0.0.146-dev240517191056",
45
+ "@motherduck/wasm-client": "^0.6.1",
46
+ "apache-arrow": "^15.0.2",
47
+ "duckdb": "0.10.2",
48
48
  "web-worker": "^1.2.0"
49
49
  }
50
50
  }