@cubejs-backend/dremio-driver 0.30.75 → 0.31.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.31.0](https://github.com/cube-js/cube.js/compare/v0.30.75...v0.31.0) (2022-10-03)
7
+
8
+
9
+ ### Features
10
+
11
+ * multiple data source ([#5326](https://github.com/cube-js/cube.js/issues/5326)) ([334af8c](https://github.com/cube-js/cube.js/commit/334af8c56cd02ae551844e9d1e9ab5e107fb1555))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.30.75](https://github.com/cube-js/cube.js/compare/v0.30.74...v0.30.75) (2022-09-22)
7
18
 
8
19
  **Note:** Version bump only for package @cubejs-backend/dremio-driver
@@ -1,7 +1,7 @@
1
1
  const axios = require('axios');
2
2
  const SqlString = require('sqlstring');
3
3
  const { BaseDriver } = require('@cubejs-backend/base-driver');
4
- const { getEnv, pausePromise } = require('@cubejs-backend/shared');
4
+ const { getEnv, assertDataSource, pausePromise } = require('@cubejs-backend/shared');
5
5
 
6
6
  const DremioQuery = require('./DremioQuery');
7
7
 
@@ -11,6 +11,9 @@ const DREMIO_JOB_LIMIT = 500;
11
11
 
12
12
  const applyParams = (query, params) => SqlString.format(query, params);
13
13
 
14
+ /**
15
+ * Dremio driver class.
16
+ */
14
17
  class DremioDriver extends BaseDriver {
15
18
  static dialectClass() {
16
19
  return DremioQuery;
@@ -18,29 +21,59 @@ class DremioDriver extends BaseDriver {
18
21
 
19
22
  /**
20
23
  * Returns default concurrency value.
24
+ * @return {number}
21
25
  */
22
26
  static getDefaultConcurrency() {
23
27
  return 2;
24
28
  }
25
29
 
30
+ /**
31
+ * Class constructor.
32
+ */
26
33
  constructor(config = {}) {
27
34
  super();
28
35
 
36
+ const dataSource =
37
+ config.dataSource ||
38
+ assertDataSource('default');
39
+
29
40
  this.config = {
30
- host: config.host || process.env.CUBEJS_DB_HOST || 'localhost',
31
- port: config.port || process.env.CUBEJS_DB_PORT || 9047,
32
- user: config.user || process.env.CUBEJS_DB_USER,
33
- password: config.password || process.env.CUBEJS_DB_PASS,
34
- database: config.database || process.env.CUBEJS_DB_NAME,
35
- ssl: config.ssl || process.env.CUBEJS_DB_SSL,
41
+ host:
42
+ config.host ||
43
+ getEnv('dbHost', { dataSource }) ||
44
+ 'localhost',
45
+ port:
46
+ config.port ||
47
+ getEnv('dbPort', { dataSource }) ||
48
+ 9047,
49
+ user:
50
+ config.user ||
51
+ getEnv('dbUser', { dataSource }),
52
+ password:
53
+ config.password ||
54
+ getEnv('dbPass', { dataSource }),
55
+ database:
56
+ config.database ||
57
+ getEnv('dbName', { dataSource }),
58
+ ssl:
59
+ config.ssl ||
60
+ getEnv('dbSsl', { dataSource }),
36
61
  ...config,
37
- pollTimeout: (config.pollTimeout || getEnv('dbPollTimeout') || getEnv('dbQueryTimeout')) * 1000,
38
- pollMaxInterval: (config.pollMaxInterval || getEnv('dbPollMaxInterval')) * 1000,
62
+ pollTimeout: (
63
+ config.pollTimeout ||
64
+ getEnv('dbPollTimeout', { dataSource }) ||
65
+ getEnv('dbQueryTimeout', { dataSource })
66
+ ) * 1000,
67
+ pollMaxInterval: (
68
+ config.pollMaxInterval ||
69
+ getEnv('dbPollMaxInterval', { dataSource })
70
+ ) * 1000,
39
71
  };
40
-
41
- const protocol = (this.config.ssl === true || this.config.ssl === 'true') ? 'https' : 'http';
42
-
43
- this.config.url = `${protocol}://${this.config.host}:${this.config.port}`;
72
+ const protocol = (this.config.ssl === true || this.config.ssl === 'true')
73
+ ? 'https'
74
+ : 'http';
75
+ this.config.url =
76
+ `${protocol}://${this.config.host}:${this.config.port}`;
44
77
  }
45
78
 
46
79
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@cubejs-backend/dremio-driver",
3
3
  "description": "Cube.js Dremio driver",
4
4
  "author": "Cube Dev, Inc.",
5
- "version": "0.30.75",
5
+ "version": "0.31.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/cube-js/cube.js.git",
@@ -17,15 +17,15 @@
17
17
  "lint:fix": "eslint driver/*.js"
18
18
  },
19
19
  "dependencies": {
20
- "@cubejs-backend/base-driver": "^0.30.73",
21
- "@cubejs-backend/schema-compiler": "^0.30.75",
22
- "@cubejs-backend/shared": "^0.30.69",
20
+ "@cubejs-backend/base-driver": "^0.31.0",
21
+ "@cubejs-backend/schema-compiler": "^0.31.0",
22
+ "@cubejs-backend/shared": "^0.31.0",
23
23
  "axios": "^0.21.1",
24
24
  "moment-timezone": "^0.5.31",
25
25
  "sqlstring": "^2.3.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@cubejs-backend/linter": "^0.30.0",
28
+ "@cubejs-backend/linter": "^0.31.0",
29
29
  "jest": "^26.6.3"
30
30
  },
31
31
  "license": "Apache-2.0",
@@ -35,5 +35,5 @@
35
35
  "eslintConfig": {
36
36
  "extends": "../cubejs-linter"
37
37
  },
38
- "gitHead": "ae78a8d80115a61b688bba55ffcab5454d929616"
38
+ "gitHead": "8cdec759f298fb20c48194254ccc04b6fdad46bf"
39
39
  }