@malloydata/db-duckdb 0.0.226-dev250113222119 → 0.0.226-dev250113232418

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.
@@ -137,6 +137,22 @@ describe('DuckDBConnection', () => {
137
137
  ],
138
138
  });
139
139
  });
140
+ it('parses struct with sql native field', () => {
141
+ const structDef = makeStructDef();
142
+ connection.fillStructDefFromTypeMap(structDef, { test: PROFESSOR_SCHEMA });
143
+ expect(structDef.fields[0]).toEqual({
144
+ 'name': 'test',
145
+ 'type': 'array',
146
+ 'elementTypeDef': { type: 'record_element' },
147
+ 'join': 'many',
148
+ 'fields': [
149
+ { 'name': 'professor_id', 'type': 'sql native', 'rawType': 'UUID' },
150
+ { 'name': 'name', 'type': 'string' },
151
+ { 'name': 'age', 'numberType': 'integer', 'type': 'number' },
152
+ { 'name': 'total_sections', 'numberType': 'integer', 'type': 'number' },
153
+ ],
154
+ });
155
+ });
140
156
  it('parses a simple type', () => {
141
157
  const structDef = makeStructDef();
142
158
  connection.fillStructDefFromTypeMap(structDef, { test: 'varchar(60)' });
@@ -145,6 +161,15 @@ describe('DuckDBConnection', () => {
145
161
  'type': 'string',
146
162
  });
147
163
  });
164
+ it('parses unknown type', () => {
165
+ const structDef = makeStructDef();
166
+ connection.fillStructDefFromTypeMap(structDef, { test: 'UUID' });
167
+ expect(structDef.fields[0]).toEqual({
168
+ 'name': 'test',
169
+ 'type': 'sql native',
170
+ 'rawType': 'UUID',
171
+ });
172
+ });
148
173
  });
149
174
  });
150
175
  /**
@@ -221,4 +246,5 @@ const NESTED_SCHEMA = 'STRUCT(a double, b integer, c varchar(60))[]';
221
246
  const intTyp = { type: 'number', numberType: 'integer' };
222
247
  const strTyp = { type: 'string' };
223
248
  const dblType = { type: 'number', numberType: 'float' };
249
+ const PROFESSOR_SCHEMA = 'STRUCT(professor_id UUID, "name" VARCHAR, age BIGINT, total_sections BIGINT)[]';
224
250
  //# sourceMappingURL=duckdb.spec.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-duckdb",
3
- "version": "0.0.226-dev250113222119",
3
+ "version": "0.0.226-dev250113232418",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@duckdb/duckdb-wasm": "1.29.0",
44
- "@malloydata/malloy": "^0.0.226-dev250113222119",
44
+ "@malloydata/malloy": "^0.0.226-dev250113232418",
45
45
  "@motherduck/wasm-client": "^0.6.6",
46
46
  "apache-arrow": "^17.0.0",
47
47
  "duckdb": "1.1.1",