@malloydata/db-trino 0.0.336 → 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.
Files changed (2) hide show
  1. package/dist/index.js +37 -0
  2. package/package.json +2 -2
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-trino",
3
- "version": "0.0.336",
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.336",
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",