@malloydata/db-trino 0.0.432 → 0.0.434

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- /*import {Trino, BasicAuth} from 'trino-client';
3
+ /*import {Trino, BasicAuth} from '@trinodb/trino-js-client';
4
4
  import PrestoClient from '@prestodb/presto-js-client';
5
5
 
6
6
  // function CallPresto(client: Client, query: string ) {
@@ -10,7 +10,7 @@ const internal_1 = require("@malloydata/malloy/internal");
10
10
  const connection_1 = require("@malloydata/malloy/connection");
11
11
  const presto_js_client_1 = require("@prestodb/presto-js-client");
12
12
  const crypto_1 = require("crypto");
13
- const trino_client_1 = require("trino-client");
13
+ const trino_js_client_1 = require("@trinodb/trino-js-client");
14
14
  const result_to_querydata_1 = require("./result-to-querydata");
15
15
  class PrestoRunner {
16
16
  constructor(config) {
@@ -58,7 +58,7 @@ class PrestoRunner {
58
58
  class TrinoRunner {
59
59
  constructor(config) {
60
60
  let server = config.server;
61
- // trino-client has no separate port field — merge into the server URL
61
+ // the client has no separate port field — merge into the server URL
62
62
  if (server && config.port) {
63
63
  try {
64
64
  const url = new URL(server);
@@ -71,13 +71,13 @@ class TrinoRunner {
71
71
  // If server isn't a parseable URL, leave it as-is
72
72
  }
73
73
  }
74
- this.client = trino_client_1.Trino.create({
74
+ this.client = trino_js_client_1.Trino.create({
75
75
  ...config.extraConfig,
76
76
  source: config.source,
77
77
  catalog: config.catalog,
78
78
  server,
79
79
  schema: config.schema,
80
- auth: new trino_client_1.BasicAuth(config.user, config.password || ''),
80
+ auth: new trino_js_client_1.BasicAuth(config.user, config.password || ''),
81
81
  });
82
82
  }
83
83
  async runSQL(sql, options = {}, queryMetadataComment = '') {
@@ -364,9 +364,16 @@ class TrinoPrestoSchemaParser extends internal_1.TinyParser {
364
364
  this.input = input;
365
365
  this.dialect = dialect;
366
366
  }
367
+ /**
368
+ * Presto 0.284+ writes "Output[PlanNodeId N][NAME_LIST] => ...",
369
+ * earlier versions write "Output[NAME_LIST] => ...".
370
+ */
367
371
  fieldNameList() {
368
- this.skipTo(']'); // Skip to end of plan
369
- this.expect('['); // Expect start of name list
372
+ this.skipTo('[');
373
+ if (this.match('id', 'id')) {
374
+ // [PlanNodeId N] is the only group with two adjacent ids
375
+ this.skipTo('[');
376
+ }
370
377
  const fieldNames = [];
371
378
  for (;;) {
372
379
  const nmToken = this.expect('id');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-trino",
3
- "version": "0.0.432",
3
+ "version": "0.0.434",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,11 +23,11 @@
23
23
  "prepublishOnly": "npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "@malloydata/malloy": "0.0.432",
26
+ "@malloydata/malloy": "0.0.434",
27
27
  "@prestodb/presto-js-client": "^1.1.0",
28
+ "@trinodb/trino-js-client": "0.3.2",
28
29
  "gaxios": "^4.2.0",
29
- "luxon": "^3.7.2",
30
- "trino-client": "^0.2.2"
30
+ "luxon": "^3.7.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/luxon": "^3.7.2"