@cubejs-backend/oracle-driver 0.31.63 → 0.31.65

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.65](https://github.com/cube-js/cube.js/compare/v0.31.64...v0.31.65) (2023-02-23)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **oracle-driver:** Release connection after query execution ([#5469](https://github.com/cube-js/cube.js/issues/5469)) ([ff1af78](https://github.com/cube-js/cube.js/commit/ff1af789c6326e25b3a341c4bae1829da95c36c1))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.31.63](https://github.com/cube-js/cube.js/compare/v0.31.62...v0.31.63) (2023-02-20)
7
18
 
8
19
  **Note:** Version bump only for package @cubejs-backend/oracle-driver
@@ -69,7 +69,7 @@ class OracleDriver extends BaseDriver {
69
69
  this.db.partRows = 100000;
70
70
  this.db.maxRows = 100000;
71
71
  this.db.prefetchRows = 500;
72
- this.config = config || {
72
+ this.config = {
73
73
  user: getEnv('dbUser', { dataSource }),
74
74
  password: getEnv('dbPass', { dataSource }),
75
75
  db: getEnv('dbName', { dataSource }),
@@ -80,11 +80,9 @@ class OracleDriver extends BaseDriver {
80
80
  config.maxPoolSize ||
81
81
  getEnv('dbMaxPoolSize', { dataSource }) ||
82
82
  50,
83
+ ...config
83
84
  };
84
-
85
- if (!this.config.connectionString) {
86
- this.config.connectionString = `${this.config.host}/${this.config.db}`
87
- }
85
+ this.config.connectionString = this.config.connectionString || `${this.config.host}:${this.config.port}/${this.config.db}`;
88
86
  }
89
87
 
90
88
  async tablesSchema() {
@@ -113,22 +111,28 @@ class OracleDriver extends BaseDriver {
113
111
  if (!this.pool) {
114
112
  this.pool = await this.db.createPool(this.config);
115
113
  }
114
+
116
115
  return this.pool.getConnection()
117
116
  }
118
117
 
119
118
  async testConnection() {
120
- return (
121
- await this.getConnectionFromPool()
122
- ).execute('SELECT 1 FROM DUAL');
119
+ await this.query('SELECT 1 FROM DUAL', {});
123
120
  }
124
121
 
125
122
  async query(query, values) {
126
123
  const conn = await this.getConnectionFromPool();
124
+
127
125
  try {
128
126
  const res = await conn.execute(query, values || {});
129
127
  return res && res.rows;
130
128
  } catch (e) {
131
129
  throw (e);
130
+ } finally {
131
+ try {
132
+ await conn.close();
133
+ } catch (e) {
134
+ throw e;
135
+ }
132
136
  }
133
137
  }
134
138
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@cubejs-backend/oracle-driver",
3
3
  "description": "Cube.js oracle database driver",
4
4
  "author": "Trikoz I.",
5
- "version": "0.31.63",
5
+ "version": "0.31.65",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/cube-js/cube.js.git",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "main": "driver/OracleDriver.js",
15
15
  "dependencies": {
16
- "@cubejs-backend/base-driver": "^0.31.63",
16
+ "@cubejs-backend/base-driver": "^0.31.65",
17
17
  "ramda": "^0.27.0"
18
18
  },
19
19
  "optionalDependencies": {
@@ -23,5 +23,5 @@
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
26
- "gitHead": "30a19b5f0ef293048561783d614c77b6e3f3d231"
26
+ "gitHead": "2572ea30accf8e84e2dec7da7916da171cbca1ba"
27
27
  }