@malloydata/db-trino 0.0.221-dev241206191821 → 0.0.221-dev241209191943

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.
@@ -31,11 +31,11 @@ export interface BaseRunner {
31
31
  }
32
32
  export declare abstract class TrinoPrestoConnection extends BaseConnection implements Connection, PersistSQLResults {
33
33
  name: string;
34
+ private client;
35
+ private queryOptions?;
34
36
  protected readonly dialect: TrinoDialect;
35
37
  static DEFAULT_QUERY_OPTIONS: RunSQLOptions;
36
- private queryOptions?;
37
- private client;
38
- constructor(name: string, queryOptions?: QueryOptionsReader, pConfig?: TrinoConnectionConfiguration);
38
+ constructor(name: string, client: BaseRunner, queryOptions?: QueryOptionsReader | undefined);
39
39
  get dialectName(): string;
40
40
  private readQueryOptions;
41
41
  canPersist(): this is PersistSQLResults;
@@ -103,19 +103,14 @@ class TrinoRunner {
103
103
  }
104
104
  }
105
105
  class TrinoPrestoConnection extends connection_1.BaseConnection {
106
- constructor(name, queryOptions, pConfig) {
106
+ constructor(name, client, queryOptions) {
107
107
  super();
108
+ this.name = name;
109
+ this.client = client;
110
+ this.queryOptions = queryOptions;
108
111
  this.dialect = new malloy_1.TrinoDialect();
109
- const config = pConfig || {};
110
112
  this.name = name;
111
- if (name === 'trino') {
112
- this.client = new TrinoRunner(config);
113
- }
114
- else {
115
- this.client = new PrestoRunner(config);
116
- }
117
113
  this.queryOptions = queryOptions;
118
- //this.config = config;
119
114
  }
120
115
  get dialectName() {
121
116
  return this.name;
@@ -394,7 +389,7 @@ TrinoPrestoConnection.DEFAULT_QUERY_OPTIONS = {
394
389
  };
395
390
  class PrestoConnection extends TrinoPrestoConnection {
396
391
  constructor(arg, queryOptions, config = {}) {
397
- super('presto', queryOptions, config);
392
+ super(typeof arg === 'string' ? arg : arg.name, new PrestoRunner(config), queryOptions);
398
393
  }
399
394
  async fillStructDefForSqlBlockSchema(sql, structDef) {
400
395
  const explainResult = await this.runSQL(`EXPLAIN ${sql}`, {});
@@ -423,7 +418,7 @@ class PrestoConnection extends TrinoPrestoConnection {
423
418
  exports.PrestoConnection = PrestoConnection;
424
419
  class TrinoConnection extends TrinoPrestoConnection {
425
420
  constructor(arg, queryOptions, config = {}) {
426
- super('trino', queryOptions, config);
421
+ super(typeof arg === 'string' ? arg : arg.name, new TrinoRunner(config), queryOptions);
427
422
  }
428
423
  async fillStructDefForSqlBlockSchema(sql, structDef) {
429
424
  const tmpQueryName = `myMalloyQuery${(0, crypto_1.randomUUID)().replace(/-/g, '')}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-trino",
3
- "version": "0.0.221-dev241206191821",
3
+ "version": "0.0.221-dev241209191943",
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.221-dev241206191821",
25
+ "@malloydata/malloy": "^0.0.221-dev241209191943",
26
26
  "@prestodb/presto-js-client": "^1.0.0",
27
27
  "gaxios": "^4.2.0",
28
28
  "trino-client": "^0.2.2"