@malloydata/db-trino 0.0.434 → 0.0.435

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.
@@ -86,6 +86,9 @@ function convertArray(elementType, raw, unpack) {
86
86
  * for rowDataToDate to handle downstream
87
87
  * - BIGINT precision is limited by the Trino JS client which
88
88
  * delivers values as JS number (no bigint support)
89
+ * - A value the driver has already decoded past the scalar kinds (a map,
90
+ * a JSON document) belongs to a `sql native` field and is handed on as
91
+ * it came
89
92
  */
90
93
  function convertScalar(typeDef, raw) {
91
94
  if (raw === null || raw === undefined)
@@ -113,11 +116,6 @@ function convertScalar(typeDef, raw) {
113
116
  // Plain timestamps: Trino returns UTC values
114
117
  return new Date(raw + 'Z');
115
118
  }
116
- if (typeof raw === 'string' ||
117
- typeof raw === 'number' ||
118
- typeof raw === 'boolean') {
119
- return raw;
120
- }
121
- return null;
119
+ return raw;
122
120
  }
123
121
  //# sourceMappingURL=result-to-querydata.js.map
@@ -247,10 +247,13 @@ class TrinoPrestoConnection extends connection_1.BaseConnection {
247
247
  throw new Error(queryResult.error);
248
248
  }
249
249
  const rows = (_a = queryResult.rows) !== null && _a !== void 0 ? _a : [];
250
+ if (rows.length === 0) {
251
+ throw new Error('DESCRIBE returned no columns');
252
+ }
250
253
  this.structDefFromSchema(rows, structDef);
251
254
  }
252
255
  catch (e) {
253
- throw new Error(`Could not fetch schema for ${element} ${e instanceof Error ? e.message : e}`);
256
+ throw new Error(`Could not fetch schema for ${element}: ${e instanceof Error ? e.message : e}`);
254
257
  }
255
258
  return structDef;
256
259
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-trino",
3
- "version": "0.0.434",
3
+ "version": "0.0.435",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "scripts": {
16
16
  "lint": "eslint '**/*.ts{,x}'",
17
17
  "lint-fix": "eslint '**/*.ts{,x}' --fix",
18
- "test": "jest --config=../../jest.config.js",
18
+ "test": "cd ../.. && ts-node scripts/check_dialect_connection.ts trino presto && jest packages/malloy-db-trino",
19
19
  "build": "tsc --build",
20
20
  "dev": "tsc --build",
21
21
  "clean": "tsc --build --clean && rm -f tsconfig.tsbuildinfo",
@@ -23,7 +23,7 @@
23
23
  "prepublishOnly": "npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "@malloydata/malloy": "0.0.434",
26
+ "@malloydata/malloy": "0.0.435",
27
27
  "@prestodb/presto-js-client": "^1.1.0",
28
28
  "@trinodb/trino-js-client": "0.3.2",
29
29
  "gaxios": "^4.2.0",