@cubejs-backend/oracle-driver 1.1.16 → 1.2.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.
@@ -8,7 +8,7 @@ const {
8
8
  getEnv,
9
9
  assertDataSource,
10
10
  } = require('@cubejs-backend/shared');
11
- const { BaseDriver } = require('@cubejs-backend/base-driver');
11
+ const { BaseDriver, TableColumn } = require('@cubejs-backend/base-driver');
12
12
  const oracledb = require('oracledb');
13
13
  const { reduce } = require('ramda');
14
14
 
@@ -95,13 +95,13 @@ class OracleDriver extends BaseDriver {
95
95
  , tc.data_type "data_type"
96
96
  , c.constraint_type "key_type"
97
97
  from all_tab_columns tc
98
- left join all_cons_columns cc
99
- on (tc.owner, tc.table_name, tc.column_name)
98
+ left join all_cons_columns cc
99
+ on (tc.owner, tc.table_name, tc.column_name)
100
100
  in ((cc.owner, cc.table_name, cc.column_name))
101
- left join all_constraints c
102
- on (tc.owner, tc.table_name, cc.constraint_name)
103
- in ((c.owner, c.table_name, c.constraint_name))
104
- and c.constraint_type
101
+ left join all_constraints c
102
+ on (tc.owner, tc.table_name, cc.constraint_name)
103
+ in ((c.owner, c.table_name, c.constraint_name))
104
+ and c.constraint_type
105
105
  in ('P','U')
106
106
  where tc.owner = user
107
107
  `);
@@ -121,6 +121,14 @@ class OracleDriver extends BaseDriver {
121
121
  await this.query('SELECT 1 FROM DUAL', {});
122
122
  }
123
123
 
124
+ async createTable(quotedTableName, columns) {
125
+ if (quotedTableName.length > 128) {
126
+ throw new Error('Oracle can not work with table names longer than 128 symbols. ' +
127
+ `Consider using the 'sqlAlias' attribute in your cube definition for ${quotedTableName}.`);
128
+ }
129
+ return super.createTable(quotedTableName, columns);
130
+ }
131
+
124
132
  async query(query, values) {
125
133
  const conn = await this.getConnectionFromPool();
126
134
 
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": "Cube Dev, Inc.",
5
- "version": "1.1.16",
5
+ "version": "1.2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/cube-js/cube.git",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "main": "driver/OracleDriver.js",
15
15
  "dependencies": {
16
- "@cubejs-backend/base-driver": "1.1.16",
16
+ "@cubejs-backend/base-driver": "1.2.0",
17
17
  "ramda": "^0.27.0"
18
18
  },
19
19
  "optionalDependencies": {
@@ -26,5 +26,5 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
- "gitHead": "924a17cf930acd7ecbe4d50105e724bf17d3881a"
29
+ "gitHead": "64c572835e71fdfd7c8aaf87a4fad4cc083c55b5"
30
30
  }