cubejs-jdbc-driver-for-msfabric 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. package/README.md +86 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  # Cube.js JDBC Database Driver custom for MS Fabric
9
9
 
10
- JDBC driver.
10
+ JDBC driver for MS Fabric
11
11
 
12
12
  ## Support
13
13
 
@@ -42,13 +42,7 @@ all native packages or just delete `node_modules` and run `yarn` again.
42
42
  ### Debian, Ubuntu, etc.
43
43
 
44
44
  ```sh
45
- sudo apt install openjdk-8-jdk
46
- ```
47
-
48
- ### Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.
49
-
50
- ```sh
51
- su -c "yum install java-1.8.0-openjdk"
45
+ sudo apt install openjdk-24-jdk
52
46
  ```
53
47
 
54
48
  ### Windows
@@ -59,6 +53,90 @@ If you have Chocolatey packet manager:
59
53
  choco install openjdk
60
54
  ```
61
55
 
56
+ ## How to use
57
+
58
+ ### Install packages
59
+ ```bash
60
+ npm install cubejs-jdbc-driver-for-msfabric @cubejs-backend/server @cubejs-backend/mssql-driver
61
+ ```
62
+
63
+ ### Setup a `cube.js` file
64
+ ```javascript
65
+ // Cube.js configuration options: https://cube.dev/docs/config
66
+
67
+ const { MSFabricDriver } = require("cubejs-jdbc-driver-for-msfabric");
68
+ const path = require('path');
69
+
70
+ module.exports = {
71
+ dialectFactory: MSFabricDriver.dialectClass,
72
+
73
+ driverFactory: ({ securityContext }) => {
74
+ const baseConfig = {
75
+ drivername: 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
76
+ customClassPath: [
77
+ // Core SQL Server JDBC driver - Required for basic database connectivity
78
+ path.resolve('drivers/mssql-jdbc-12.10.1.jre11.jar'),
79
+
80
+ // MSAL4J - Microsoft Authentication Library for Java
81
+ // Handles Azure AD authentication and token acquisition
82
+ path.resolve('drivers/msal4j-1.13.10.jar'),
83
+ // Azure Identity SDK - get token AAD
84
+ path.resolve('drivers/azure-identity-1.15.4.jar'),
85
+
86
+ // Required for MSAL4J token handling
87
+ path.resolve('drivers/oauth2-oidc-sdk-11.26.jar'),
88
+ path.resolve('drivers/nimbus-jose-jwt-10.3.1.jar'),
89
+ path.resolve('drivers/content-type-2.3.jar'),
90
+ path.resolve('drivers/slf4j-api-2.0.17.jar'),
91
+ path.resolve('drivers/slf4j-simple-1.7.36.jar'),
92
+ path.resolve('drivers/json-smart-2.5.2.jar'),
93
+ path.resolve('drivers/accessors-smart-2.5.2.jar'),
94
+ path.resolve('drivers/jackson-core-2.13.3.jar'),
95
+ path.resolve('drivers/jackson-annotations-2.12.7.jar'),
96
+ path.resolve('drivers/jackson-databind-2.12.7.2.jar'),
97
+ ],
98
+ properties: {
99
+ user: process.env.DB_USER,
100
+ password: process.env.DB_PASS,
101
+ },
102
+ maxRows: 50000,
103
+ queryTimeout: 600,
104
+ poolOptions: {
105
+ min: 0,
106
+ max: 8,
107
+ idleTimeoutMillis: 30000
108
+ }
109
+ };
110
+
111
+ const host = process.env.DB_HOST_US;
112
+ const database = process.env.DB_NAME_US;
113
+
114
+ const jdbcUrl =[
115
+ `jdbc:sqlserver://${host}`,
116
+ `;database=${database}`,
117
+ `;encrypt=true`,
118
+ `;trustServerCertificate=false`
119
+ ];
120
+
121
+ if (securityContext.entity_name === 'local') {
122
+ jdbcUrl.push(`;UserName=${process.env.DB_USER_LOCAL}`);
123
+ jdbcUrl.push(`;Password=${process.env.DB_USER_LOCAL}`);
124
+ } else {
125
+ jdbcUrl.push(`;authentication=${process.env.DB_AUTHENTICATION}`);
126
+ jdbcUrl.push(`;UserName=${process.env.CUBEJS_FABRIC_CLIENT_ID}`);
127
+ jdbcUrl.push(`;Password=${process.env.CUBEJS_FABRIC_CLIENT_SECRET}`);
128
+ }
129
+
130
+ return new MSFabricDriver({
131
+ ...baseConfig,
132
+ database,
133
+ url: jdbcUrl.join(''),
134
+ });
135
+ },
136
+ };
137
+
138
+ ```
139
+
62
140
  ## License
63
141
 
64
142
  Cube.js JDBC Database Driver is [Apache 2.0 licensed](./LICENSE).
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "cubejs-jdbc-driver-for-msfabric",
3
3
  "description": "Cube.js MS Fabric database driver",
4
4
  "author": "RamSoft Inc.",
5
- "version": "0.0.1",
5
+ "version": "0.0.2",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",