@malloydata/db-trino 0.0.338 → 0.0.339

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.
@@ -73,10 +73,24 @@ class PrestoRunner {
73
73
  }
74
74
  class TrinoRunner {
75
75
  constructor(config) {
76
+ let server = config.server;
77
+ // trino-client has no separate port field — merge into the server URL
78
+ if (server && config.port) {
79
+ try {
80
+ const url = new URL(server);
81
+ if (!url.port) {
82
+ url.port = String(config.port);
83
+ server = url.toString().replace(/\/$/, '');
84
+ }
85
+ }
86
+ catch {
87
+ // If server isn't a parseable URL, leave it as-is
88
+ }
89
+ }
76
90
  this.client = trino_client_1.Trino.create({
77
91
  ...config.extraConfig,
78
92
  catalog: config.catalog,
79
- server: config.server,
93
+ server,
80
94
  schema: config.schema,
81
95
  auth: new trino_client_1.BasicAuth(config.user, config.password || ''),
82
96
  });
@@ -166,9 +180,8 @@ class TrinoPrestoConnection extends connection_1.BaseConnection {
166
180
  return true;
167
181
  }
168
182
  getDigest() {
169
- var _a;
170
183
  const { server, port, catalog, schema, user } = this.connectionConfig;
171
- return (0, malloy_1.makeDigest)('trino', server !== null && server !== void 0 ? server : '', String(port !== null && port !== void 0 ? port : ''), catalog !== null && catalog !== void 0 ? catalog : '', schema !== null && schema !== void 0 ? schema : '', user !== null && user !== void 0 ? user : '', (_a = this.setupSQL) !== null && _a !== void 0 ? _a : '');
184
+ return (0, malloy_1.makeDigest)('trino', server, port !== undefined ? String(port) : undefined, catalog, schema, user, this.setupSQL);
172
185
  }
173
186
  get supportsNesting() {
174
187
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-trino",
3
- "version": "0.0.338",
3
+ "version": "0.0.339",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "prepublishOnly": "npm run build"
23
23
  },
24
24
  "dependencies": {
25
- "@malloydata/malloy": "0.0.338",
25
+ "@malloydata/malloy": "0.0.339",
26
26
  "@prestodb/presto-js-client": "^1.0.0",
27
27
  "gaxios": "^4.2.0",
28
28
  "luxon": "^3.5.0",