@malloydata/db-trino 0.0.335 → 0.0.337

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.
package/dist/index.js CHANGED
@@ -29,4 +29,41 @@ Object.defineProperty(exports, "TrinoConnection", { enumerable: true, get: funct
29
29
  Object.defineProperty(exports, "TrinoPrestoConnection", { enumerable: true, get: function () { return trino_connection_1.TrinoPrestoConnection; } });
30
30
  var trino_executor_1 = require("./trino_executor");
31
31
  Object.defineProperty(exports, "TrinoExecutor", { enumerable: true, get: function () { return trino_executor_1.TrinoExecutor; } });
32
+ const malloy_1 = require("@malloydata/malloy");
33
+ const trino_connection_2 = require("./trino_connection");
34
+ function configToTrinoConfig(config) {
35
+ return {
36
+ name: config.name,
37
+ trinoConfig: {
38
+ server: typeof config['server'] === 'string' ? config['server'] : undefined,
39
+ port: typeof config['port'] === 'number' ? config['port'] : undefined,
40
+ catalog: typeof config['catalog'] === 'string' ? config['catalog'] : undefined,
41
+ schema: typeof config['schema'] === 'string' ? config['schema'] : undefined,
42
+ user: typeof config['user'] === 'string' ? config['user'] : undefined,
43
+ password: typeof config['password'] === 'string' ? config['password'] : undefined,
44
+ },
45
+ };
46
+ }
47
+ const trinoProperties = [
48
+ { name: 'server', displayName: 'Server', type: 'string', optional: true },
49
+ { name: 'port', displayName: 'Port', type: 'number', optional: true },
50
+ { name: 'catalog', displayName: 'Catalog', type: 'string', optional: true },
51
+ { name: 'schema', displayName: 'Schema', type: 'string', optional: true },
52
+ { name: 'user', displayName: 'User', type: 'string', optional: true },
53
+ { name: 'password', displayName: 'Password', type: 'password', optional: true },
54
+ ];
55
+ (0, malloy_1.registerConnectionType)('trino', {
56
+ factory: (config) => {
57
+ const { name, trinoConfig } = configToTrinoConfig(config);
58
+ return new trino_connection_2.TrinoConnection(name, undefined, trinoConfig);
59
+ },
60
+ properties: trinoProperties,
61
+ });
62
+ (0, malloy_1.registerConnectionType)('presto', {
63
+ factory: (config) => {
64
+ const { name, trinoConfig } = configToTrinoConfig(config);
65
+ return new trino_connection_2.PrestoConnection(name, undefined, trinoConfig);
66
+ },
67
+ properties: trinoProperties,
68
+ });
32
69
  //# sourceMappingURL=index.js.map
@@ -43,6 +43,7 @@ export declare abstract class TrinoPrestoConnection extends BaseConnection imple
43
43
  get dialectName(): string;
44
44
  private readQueryOptions;
45
45
  canPersist(): this is PersistSQLResults;
46
+ getDigest(): string;
46
47
  get supportsNesting(): boolean;
47
48
  manifestTemporaryTable(_sqlCommand: string): Promise<string>;
48
49
  unpackArray(_fields: FieldDef[], data: unknown): unknown[];
@@ -144,6 +144,10 @@ class TrinoPrestoConnection extends connection_1.BaseConnection {
144
144
  canPersist() {
145
145
  return true;
146
146
  }
147
+ getDigest() {
148
+ const data = `trino:${this.name}`;
149
+ return (0, malloy_1.makeDigest)(data);
150
+ }
147
151
  get supportsNesting() {
148
152
  return true;
149
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-trino",
3
- "version": "0.0.335",
3
+ "version": "0.0.337",
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.335",
25
+ "@malloydata/malloy": "0.0.337",
26
26
  "@prestodb/presto-js-client": "^1.0.0",
27
27
  "gaxios": "^4.2.0",
28
28
  "luxon": "^3.5.0",