@cubejs-backend/vertica-driver 1.5.7 → 1.5.9
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 +10 -0
- package/package.json +8 -7
- package/src/VerticaDriver.js +14 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
## [1.5.9](https://github.com/cube-js/cube.js/compare/v1.5.8...v1.5.9) (2025-11-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @cubejs-backend/vertica-driver
|
|
9
|
+
|
|
10
|
+
## [1.5.8](https://github.com/cube-js/cube.js/compare/v1.5.7...v1.5.8) (2025-11-26)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **base-driver, other drivers:** Support numeric types with precision and scale for cube store data exports ([#10175](https://github.com/cube-js/cube.js/issues/10175)) ([9ba6e77](https://github.com/cube-js/cube.js/commit/9ba6e77e934791ee7ff80643a7a9a862f2a97e2b))
|
|
15
|
+
|
|
6
16
|
## [1.5.7](https://github.com/cube-js/cube.js/compare/v1.5.6...v1.5.7) (2025-11-24)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @cubejs-backend/vertica-driver
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@cubejs-backend/vertica-driver",
|
|
3
3
|
"description": "Cube.js Vertica database driver",
|
|
4
4
|
"author": "Eduard Karacharov, Tim Brown, Cube Dev, Inc.",
|
|
5
|
-
"version": "1.5.
|
|
5
|
+
"version": "1.5.9",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/cube-js/cube.js.git",
|
|
@@ -19,15 +19,16 @@
|
|
|
19
19
|
"lint:fix": "eslint --fix **/*.js"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@cubejs-backend/base-driver": "1.5.
|
|
23
|
-
"@cubejs-backend/query-orchestrator": "1.5.
|
|
24
|
-
"@cubejs-backend/schema-compiler": "1.5.
|
|
22
|
+
"@cubejs-backend/base-driver": "1.5.9",
|
|
23
|
+
"@cubejs-backend/query-orchestrator": "1.5.9",
|
|
24
|
+
"@cubejs-backend/schema-compiler": "1.5.9",
|
|
25
|
+
"@cubejs-backend/shared": "1.5.9",
|
|
25
26
|
"vertica-nodejs": "^1.0.3"
|
|
26
27
|
},
|
|
27
28
|
"license": "Apache-2.0",
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"@cubejs-backend/linter": "1.5.
|
|
30
|
-
"@cubejs-backend/testing-shared": "1.5.
|
|
30
|
+
"@cubejs-backend/linter": "1.5.9",
|
|
31
|
+
"@cubejs-backend/testing-shared": "1.5.9",
|
|
31
32
|
"@types/jest": "^29",
|
|
32
33
|
"jest": "^29",
|
|
33
34
|
"testcontainers": "^10.28.0"
|
|
@@ -38,5 +39,5 @@
|
|
|
38
39
|
"eslintConfig": {
|
|
39
40
|
"extends": "../cubejs-linter"
|
|
40
41
|
},
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "b7b631855a4875a8b0a64622efa24d3123f5c2ca"
|
|
42
43
|
}
|
package/src/VerticaDriver.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { Pool } = require('vertica-nodejs');
|
|
2
2
|
const { BaseDriver } = require('@cubejs-backend/query-orchestrator');
|
|
3
|
+
const { getEnv } = require('@cubejs-backend/shared');
|
|
3
4
|
const VerticaQuery = require('./VerticaQuery');
|
|
4
5
|
|
|
5
6
|
const defaultGenericType = 'text';
|
|
@@ -61,7 +62,7 @@ class VerticaDriver extends BaseDriver {
|
|
|
61
62
|
return `
|
|
62
63
|
SELECT
|
|
63
64
|
column_name,
|
|
64
|
-
table_name,
|
|
65
|
+
table_name,
|
|
65
66
|
table_schema,
|
|
66
67
|
data_type
|
|
67
68
|
FROM v_catalog.columns;
|
|
@@ -85,19 +86,27 @@ class VerticaDriver extends BaseDriver {
|
|
|
85
86
|
const columns = await this.query(
|
|
86
87
|
`SELECT
|
|
87
88
|
column_name,
|
|
88
|
-
data_type
|
|
89
|
+
data_type,
|
|
90
|
+
numeric_precision,
|
|
91
|
+
numeric_scale
|
|
89
92
|
FROM v_catalog.columns
|
|
90
93
|
WHERE table_name = ${this.param(0)}
|
|
91
94
|
AND table_schema = ${this.param(1)}`,
|
|
92
95
|
[name, schema]
|
|
93
96
|
);
|
|
94
97
|
|
|
95
|
-
return columns.map(c => ({ name: c.column_name, type: this.toGenericType(c.data_type) }));
|
|
98
|
+
return columns.map(c => ({ name: c.column_name, type: this.toGenericType(c.data_type, c.numeric_precision, c.numeric_scale) }));
|
|
96
99
|
}
|
|
97
100
|
|
|
98
|
-
toGenericType(columnType) {
|
|
101
|
+
toGenericType(columnType, precision, scale) {
|
|
99
102
|
const type = columnType.toLowerCase().replace(/\([0-9,]+\)/, '');
|
|
100
|
-
|
|
103
|
+
const genericType = VerticaTypeToGenericType[type] || defaultGenericType;
|
|
104
|
+
|
|
105
|
+
if (genericType === 'decimal' && precision && scale && getEnv('preciseDecimalInCubestore')) {
|
|
106
|
+
return `decimal(${precision}, ${scale})`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return genericType;
|
|
101
110
|
}
|
|
102
111
|
}
|
|
103
112
|
|