cubejs-jdbc-driver-for-msfabric 1.3.3 → 1.3.5

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.
@@ -1,86 +1,86 @@
1
- /**
2
- * @copyright Cube Dev, Inc.
3
- * @license Apache-2.0
4
- * @fileoverview The `MSFabricDriver` and related types declaration.
5
- */
6
- import { DriverCapabilities } from "@cubejs-backend/base-driver";
7
- import { JDBCDriver, JDBCDriverConfiguration } from "@cubejs-backend/jdbc-driver";
8
- import { MSFabricQuery } from "./MSFabricQuery";
9
- export type MSFabricDriverConfiguration = JDBCDriverConfiguration & {
10
- /**
11
- * Driver read-only mode flag.
12
- */
13
- readOnly?: boolean;
14
- /**
15
- * Poll interval.
16
- */
17
- pollInterval?: number;
18
- };
19
- /**
20
- * MSFabric driver class.
21
- */
22
- export declare class MSFabricDriver extends JDBCDriver {
23
- mvnPromise: Promise<void> | null;
24
- /**
25
- * Read-only mode flag.
26
- */
27
- protected readonly config: MSFabricDriverConfiguration;
28
- static mvnPromise: any;
29
- static ensureInitialized(): Promise<any>;
30
- static dialectClass(): typeof MSFabricQuery;
31
- /**
32
- * Returns default concurrency value.
33
- */
34
- static getDefaultConcurrency(): number;
35
- /**
36
- * Class constructor.
37
- */
38
- constructor(conf?: Partial<MSFabricDriverConfiguration> & {
39
- /**
40
- * Data source name.
41
- */
42
- dataSource?: string;
43
- /**
44
- * Max pool size value for the [cube]<-->[db] pool.
45
- */
46
- maxPoolSize?: number;
47
- /**
48
- * Time to wait for a response from a connection after validation
49
- * request before determining it as not valid. Default - 10000 ms.
50
- */
51
- testConnectionTimeout?: number;
52
- });
53
- /**
54
- * @override
55
- */
56
- readOnly(): boolean;
57
- /**
58
- * @override
59
- */
60
- capabilities(): DriverCapabilities;
61
- /**
62
- * @override
63
- */
64
- setLogger(logger: any): void;
65
- /**
66
- * @override
67
- */
68
- loadPreAggregationIntoTable(preAggregationTableName: string, loadSql: string, params: unknown[], _options: any): Promise<unknown[]>;
69
- /**
70
- * @override
71
- */
72
- query<R = unknown>(query: string, values: unknown[]): Promise<R[]>;
73
- /**
74
- * Returns pre-aggregation schema name.
75
- */
76
- getPreaggsSchemaName(): string;
77
- showDeprecations(): void;
78
- /**
79
- * Returns quoted string.
80
- */
81
- quoteIdentifier(identifier: string): string;
82
- /**
83
- * Returns the JS type by the MSFabric type.
84
- */
85
- toGenericType(columnType: string): string;
86
- }
1
+ /**
2
+ * @copyright Cube Dev, Inc.
3
+ * @license Apache-2.0
4
+ * @fileoverview The `MSFabricDriver` and related types declaration.
5
+ */
6
+ import { DriverCapabilities } from "@cubejs-backend/base-driver";
7
+ import { JDBCDriver, JDBCDriverConfiguration } from "@cubejs-backend/jdbc-driver";
8
+ import { MSFabricQuery } from "./MSFabricQuery";
9
+ export type MSFabricDriverConfiguration = JDBCDriverConfiguration & {
10
+ /**
11
+ * Driver read-only mode flag.
12
+ */
13
+ readOnly?: boolean;
14
+ /**
15
+ * Poll interval.
16
+ */
17
+ pollInterval?: number;
18
+ };
19
+ /**
20
+ * MSFabric driver class.
21
+ */
22
+ export declare class MSFabricDriver extends JDBCDriver {
23
+ mvnPromise: Promise<void> | null;
24
+ /**
25
+ * Read-only mode flag.
26
+ */
27
+ protected readonly config: MSFabricDriverConfiguration;
28
+ static mvnPromise: any;
29
+ static ensureInitialized(): Promise<any>;
30
+ static dialectClass(): typeof MSFabricQuery;
31
+ /**
32
+ * Returns default concurrency value.
33
+ */
34
+ static getDefaultConcurrency(): number;
35
+ /**
36
+ * Class constructor.
37
+ */
38
+ constructor(conf?: Partial<MSFabricDriverConfiguration> & {
39
+ /**
40
+ * Data source name.
41
+ */
42
+ dataSource?: string;
43
+ /**
44
+ * Max pool size value for the [cube]<-->[db] pool.
45
+ */
46
+ maxPoolSize?: number;
47
+ /**
48
+ * Time to wait for a response from a connection after validation
49
+ * request before determining it as not valid. Default - 10000 ms.
50
+ */
51
+ testConnectionTimeout?: number;
52
+ });
53
+ /**
54
+ * @override
55
+ */
56
+ readOnly(): boolean;
57
+ /**
58
+ * @override
59
+ */
60
+ capabilities(): DriverCapabilities;
61
+ /**
62
+ * @override
63
+ */
64
+ setLogger(logger: any): void;
65
+ /**
66
+ * @override
67
+ */
68
+ loadPreAggregationIntoTable(preAggregationTableName: string, loadSql: string, params: unknown[], _options: any): Promise<unknown[]>;
69
+ /**
70
+ * @override
71
+ */
72
+ query<R = unknown>(query: string, values: unknown[]): Promise<R[]>;
73
+ /**
74
+ * Returns pre-aggregation schema name.
75
+ */
76
+ getPreaggsSchemaName(): string;
77
+ showDeprecations(): void;
78
+ /**
79
+ * Returns quoted string.
80
+ */
81
+ quoteIdentifier(identifier: string): string;
82
+ /**
83
+ * Returns the JS type by the MSFabric type.
84
+ */
85
+ toGenericType(columnType: string): string;
86
+ }
@@ -1,110 +1,110 @@
1
- "use strict";
2
- /**
3
- * @copyright Cube Dev, Inc.
4
- * @license Apache-2.0
5
- * @fileoverview The `MSFabricDriver` and related types declaration.
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.MSFabricDriver = void 0;
9
- const shared_1 = require("@cubejs-backend/shared");
10
- const jdbc_driver_1 = require("@cubejs-backend/jdbc-driver");
11
- const MSFabricQuery_1 = require("./MSFabricQuery");
12
- const initializeDriver_1 = require("./initializeDriver");
13
- const MSFabricToGenericType = {
14
- "decimal(10,0)": "bigint",
15
- };
16
- /**
17
- * MSFabric driver class.
18
- */
19
- class MSFabricDriver extends jdbc_driver_1.JDBCDriver {
20
- static async ensureInitialized() {
21
- if (!this.mvnPromise) {
22
- this.mvnPromise = (0, initializeDriver_1.initMvn)();
23
- }
24
- return this.mvnPromise;
25
- }
26
- static dialectClass() {
27
- return MSFabricQuery_1.MSFabricQuery;
28
- }
29
- /**
30
- * Returns default concurrency value.
31
- */
32
- static getDefaultConcurrency() {
33
- return 2;
34
- }
35
- /**
36
- * Class constructor.
37
- */
38
- constructor(conf = {}) {
39
- const config = {
40
- ...conf,
41
- properties: (conf === null || conf === void 0 ? void 0 : conf.properties) || {},
42
- database: (conf === null || conf === void 0 ? void 0 : conf.database) || "master",
43
- url: (conf === null || conf === void 0 ? void 0 : conf.url) || `jdbc:sqlserver://localhost`,
44
- dbType: "msfabric-jdbc",
45
- drivername: "com.microsoft.sqlserver.jdbc.SQLServerDriver",
46
- };
47
- super(config);
48
- this.mvnPromise = null;
49
- this.config = config;
50
- }
51
- /**
52
- * @override
53
- */
54
- readOnly() {
55
- return !!this.config.readOnly;
56
- }
57
- /**
58
- * @override
59
- */
60
- capabilities() {
61
- return { unloadWithoutTempTable: true };
62
- }
63
- /**
64
- * @override
65
- */
66
- setLogger(logger) {
67
- super.setLogger(logger);
68
- this.showDeprecations();
69
- }
70
- /**
71
- * @override
72
- */
73
- async loadPreAggregationIntoTable(preAggregationTableName, loadSql, params, _options) {
74
- return super.loadPreAggregationIntoTable(preAggregationTableName, loadSql, params, _options);
75
- }
76
- /**
77
- * @override
78
- */
79
- async query(query, values) {
80
- return super.query(query, values);
81
- }
82
- /**
83
- * Returns pre-aggregation schema name.
84
- */
85
- getPreaggsSchemaName() {
86
- const schema = (0, shared_1.getEnv)("preAggregationsSchema");
87
- if (schema) {
88
- return schema;
89
- }
90
- else {
91
- const devMode = process.env.NODE_ENV !== "production" || (0, shared_1.getEnv)("devMode");
92
- return devMode ? "dev_pre_aggregations" : "prod_pre_aggregations";
93
- }
94
- }
95
- showDeprecations() { }
96
- /**
97
- * Returns quoted string.
98
- */
99
- quoteIdentifier(identifier) {
100
- return `\`${identifier}\``;
101
- }
102
- /**
103
- * Returns the JS type by the MSFabric type.
104
- */
105
- toGenericType(columnType) {
106
- return (MSFabricToGenericType[columnType.toLowerCase()] ||
107
- super.toGenericType(columnType));
108
- }
109
- }
110
- exports.MSFabricDriver = MSFabricDriver;
1
+ "use strict";
2
+ /**
3
+ * @copyright Cube Dev, Inc.
4
+ * @license Apache-2.0
5
+ * @fileoverview The `MSFabricDriver` and related types declaration.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.MSFabricDriver = void 0;
9
+ const shared_1 = require("@cubejs-backend/shared");
10
+ const jdbc_driver_1 = require("@cubejs-backend/jdbc-driver");
11
+ const MSFabricQuery_1 = require("./MSFabricQuery");
12
+ const initializeDriver_1 = require("./initializeDriver");
13
+ const MSFabricToGenericType = {
14
+ "decimal(10,0)": "bigint",
15
+ };
16
+ /**
17
+ * MSFabric driver class.
18
+ */
19
+ class MSFabricDriver extends jdbc_driver_1.JDBCDriver {
20
+ static async ensureInitialized() {
21
+ if (!this.mvnPromise) {
22
+ this.mvnPromise = (0, initializeDriver_1.initMvn)();
23
+ }
24
+ return this.mvnPromise;
25
+ }
26
+ static dialectClass() {
27
+ return MSFabricQuery_1.MSFabricQuery;
28
+ }
29
+ /**
30
+ * Returns default concurrency value.
31
+ */
32
+ static getDefaultConcurrency() {
33
+ return 2;
34
+ }
35
+ /**
36
+ * Class constructor.
37
+ */
38
+ constructor(conf = {}) {
39
+ const config = {
40
+ ...conf,
41
+ properties: (conf === null || conf === void 0 ? void 0 : conf.properties) || {},
42
+ database: (conf === null || conf === void 0 ? void 0 : conf.database) || "master",
43
+ url: (conf === null || conf === void 0 ? void 0 : conf.url) || `jdbc:sqlserver://localhost`,
44
+ dbType: "msfabric-jdbc",
45
+ drivername: "com.microsoft.sqlserver.jdbc.SQLServerDriver",
46
+ };
47
+ super(config);
48
+ this.mvnPromise = null;
49
+ this.config = config;
50
+ }
51
+ /**
52
+ * @override
53
+ */
54
+ readOnly() {
55
+ return !!this.config.readOnly;
56
+ }
57
+ /**
58
+ * @override
59
+ */
60
+ capabilities() {
61
+ return { unloadWithoutTempTable: true };
62
+ }
63
+ /**
64
+ * @override
65
+ */
66
+ setLogger(logger) {
67
+ super.setLogger(logger);
68
+ this.showDeprecations();
69
+ }
70
+ /**
71
+ * @override
72
+ */
73
+ async loadPreAggregationIntoTable(preAggregationTableName, loadSql, params, _options) {
74
+ return super.loadPreAggregationIntoTable(preAggregationTableName, loadSql, params, _options);
75
+ }
76
+ /**
77
+ * @override
78
+ */
79
+ async query(query, values) {
80
+ return super.query(query, values);
81
+ }
82
+ /**
83
+ * Returns pre-aggregation schema name.
84
+ */
85
+ getPreaggsSchemaName() {
86
+ const schema = (0, shared_1.getEnv)("preAggregationsSchema");
87
+ if (schema) {
88
+ return schema;
89
+ }
90
+ else {
91
+ const devMode = process.env.NODE_ENV !== "production" || (0, shared_1.getEnv)("devMode");
92
+ return devMode ? "dev_pre_aggregations" : "prod_pre_aggregations";
93
+ }
94
+ }
95
+ showDeprecations() { }
96
+ /**
97
+ * Returns quoted string.
98
+ */
99
+ quoteIdentifier(identifier) {
100
+ return `\`${identifier}\``;
101
+ }
102
+ /**
103
+ * Returns the JS type by the MSFabric type.
104
+ */
105
+ toGenericType(columnType) {
106
+ return (MSFabricToGenericType[columnType.toLowerCase()] ||
107
+ super.toGenericType(columnType));
108
+ }
109
+ }
110
+ exports.MSFabricDriver = MSFabricDriver;
@@ -1,7 +1,7 @@
1
- import { MssqlQuery } from '@cubejs-backend/schema-compiler';
2
- export declare class MSFabricQuery extends MssqlQuery {
3
- /**
4
- * @override
5
- */
6
- newParamAllocator(): any;
7
- }
1
+ import { MssqlQuery } from '@cubejs-backend/schema-compiler';
2
+ export declare class MSFabricQuery extends MssqlQuery {
3
+ /**
4
+ * @override
5
+ */
6
+ newParamAllocator(): any;
7
+ }
@@ -1,18 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MSFabricQuery = void 0;
4
- const schema_compiler_1 = require("@cubejs-backend/schema-compiler");
5
- class MSFabricParamAllocator extends schema_compiler_1.ParamAllocator {
6
- paramPlaceHolder(paramIndex) {
7
- return '?';
8
- }
9
- }
10
- class MSFabricQuery extends schema_compiler_1.MssqlQuery {
11
- /**
12
- * @override
13
- */
14
- newParamAllocator() {
15
- return new MSFabricParamAllocator();
16
- }
17
- }
18
- exports.MSFabricQuery = MSFabricQuery;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MSFabricQuery = void 0;
4
+ const schema_compiler_1 = require("@cubejs-backend/schema-compiler");
5
+ class MSFabricParamAllocator extends schema_compiler_1.ParamAllocator {
6
+ paramPlaceHolder(paramIndex) {
7
+ return '?';
8
+ }
9
+ }
10
+ class MSFabricQuery extends schema_compiler_1.MssqlQuery {
11
+ /**
12
+ * @override
13
+ */
14
+ newParamAllocator() {
15
+ return new MSFabricParamAllocator();
16
+ }
17
+ }
18
+ exports.MSFabricQuery = MSFabricQuery;
@@ -1 +1 @@
1
- export * from './MSFabricDriver';
1
+ export * from './MSFabricDriver';
package/dist/src/index.js CHANGED
@@ -1,17 +1,17 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./MSFabricDriver"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./MSFabricDriver"), exports);
@@ -1 +1 @@
1
- export declare const initMvn: () => Promise<string[]>;
1
+ export declare const initMvn: () => Promise<string[]>;
@@ -1,26 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initMvn = void 0;
4
- // eslint-disable-next-line @typescript-eslint/no-var-requires
5
- // const mvn = require('@cubejs-backend/node-java-maven');
6
- const mvn = require('node-java-maven');
7
- let mvnPromise = null;
8
- const initMvn = () => {
9
- if (!mvnPromise) {
10
- mvnPromise = new Promise((resolve, reject) => {
11
- const options = {
12
- // packageJsonPath: path.join(process.cwd(), 'package.json')
13
- };
14
- mvn(options, (err, mvnResults) => {
15
- if (err && !err.message.includes('Could not find java property')) {
16
- reject(err);
17
- }
18
- else {
19
- resolve((mvnResults === null || mvnResults === void 0 ? void 0 : mvnResults.classpath) || []);
20
- }
21
- });
22
- });
23
- }
24
- return mvnPromise;
25
- };
26
- exports.initMvn = initMvn;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initMvn = void 0;
4
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
5
+ // const mvn = require('@cubejs-backend/node-java-maven');
6
+ const mvn = require('node-java-maven');
7
+ let mvnPromise = null;
8
+ const initMvn = () => {
9
+ if (!mvnPromise) {
10
+ mvnPromise = new Promise((resolve, reject) => {
11
+ const options = {
12
+ // packageJsonPath: path.join(process.cwd(), 'package.json')
13
+ };
14
+ mvn(options, (err, mvnResults) => {
15
+ if (err && !err.message.includes('Could not find java property')) {
16
+ reject(err);
17
+ }
18
+ else {
19
+ resolve((mvnResults === null || mvnResults === void 0 ? void 0 : mvnResults.classpath) || []);
20
+ }
21
+ });
22
+ });
23
+ }
24
+ return mvnPromise;
25
+ };
26
+ exports.initMvn = initMvn;
package/package.json CHANGED
@@ -1,50 +1,56 @@
1
- {
2
- "name": "cubejs-jdbc-driver-for-msfabric",
3
- "description": "Cube.js MS Fabric database driver",
4
- "author": "RamSoft Inc.",
5
- "version": "1.3.3",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/ramsoft-inc/CubeFabricDriver"
9
- },
10
- "engines": {
11
- "node": ">=22.0.0"
12
- },
13
- "main": "dist/src/index.js",
14
- "typings": "dist/src/index.d.ts",
15
- "scripts": {
16
- "build": "rimraf dist && npm run tsc",
17
- "tsc": "tsc",
18
- "watch": "tsc -w",
19
- "lint": "eslint src/* --ext .ts",
20
- "lint:fix": "eslint --fix src/* --ext .ts"
21
- },
22
- "files": [
23
- "README.md",
24
- "dist/src/*",
25
- "bin"
26
- ],
27
- "dependencies": {
28
- "@cubejs-backend/base-driver": "1.3.44",
29
- "@cubejs-backend/jdbc-driver": "1.3.44",
30
- "@cubejs-backend/schema-compiler": "1.3.44",
31
- "@cubejs-backend/shared": "1.3.44",
32
- "node-java-maven": "0.1.2",
33
- "source-map-support": "^0.5.19"
34
- },
35
- "devDependencies": {
36
- "@cubejs-backend/linter": "^0.33.0",
37
- "typescript": "~5.2.2",
38
- "rimraf": "^6.0.1"
39
- },
40
- "optionalDependencies": {
41
- "@cubejs-backend/jdbc": "^0.8.1",
42
- "java": "^0.14.0"
43
- },
44
- "publishConfig": {
45
- "access": "public"
46
- },
47
- "eslintConfig": {
48
- "extends": "../cubejs-linter"
49
- }
50
- }
1
+ {
2
+ "name": "cubejs-jdbc-driver-for-msfabric",
3
+ "description": "Cube.js MS Fabric database driver",
4
+ "author": "RamSoft Inc.",
5
+ "version": "1.3.5",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/ramsoft-inc/CubeFabricDriver"
9
+ },
10
+ "engines": {
11
+ "node": ">=22.0.0"
12
+ },
13
+ "main": "dist/src/index.js",
14
+ "typings": "dist/src/index.d.ts",
15
+ "scripts": {
16
+ "build": "rimraf dist && npm run tsc",
17
+ "tsc": "tsc",
18
+ "watch": "tsc -w",
19
+ "lint": "eslint src/* --ext .ts",
20
+ "lint:fix": "eslint --fix src/* --ext .ts"
21
+ },
22
+ "files": [
23
+ "README.md",
24
+ "dist/src/*",
25
+ "bin"
26
+ ],
27
+ "dependencies": {
28
+ "@cubejs-backend/base-driver": "1.3.44",
29
+ "@cubejs-backend/jdbc-driver": "1.3.44",
30
+ "@cubejs-backend/schema-compiler": "1.3.44",
31
+ "@cubejs-backend/shared": "1.3.44",
32
+ "node-java-maven-secure": "^0.1.5",
33
+ "source-map-support": "^0.5.19"
34
+ },
35
+ "devDependencies": {
36
+ "@cubejs-backend/linter": "^0.33.0",
37
+ "typescript": "~5.2.2",
38
+ "rimraf": "^6.0.1"
39
+ },
40
+ "overrides": {
41
+ "@cubejs-backend/node-java-maven": "npm:node-java-maven-secure@^0.1.5"
42
+ },
43
+ "resolutions": {
44
+ "@cubejs-backend/node-java-maven": "npm:node-java-maven-secure@^0.1.5"
45
+ },
46
+ "optionalDependencies": {
47
+ "@cubejs-backend/jdbc": "^0.8.1",
48
+ "java": "^0.14.0"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "eslintConfig": {
54
+ "extends": "../cubejs-linter"
55
+ }
56
+ }