@quillsql/node 0.3.7 → 0.4.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.
- package/dist/assets/pgtypes.js +2785 -0
- package/dist/db/BigQuery.js +201 -0
- package/dist/db/{CachedPools.js → CachedConnection.js} +11 -23
- package/dist/db/DatabaseHelper.js +187 -0
- package/dist/db/Mysql.js +192 -0
- package/dist/db/Postgres.js +161 -0
- package/dist/db/Snowflake.js +189 -0
- package/dist/index.js +80 -24
- package/dist/index.uspec.js +3 -2
- package/dist/models/Client.js +2 -0
- package/dist/utils/RunQueryProcesses.js +3 -18
- package/dist/utils/schemaConversion.js +15 -0
- package/dist/utils/textProcessing.js +17 -0
- package/examples/node-server/app.ts +40 -9
- package/package.json +6 -2
- package/src/assets/pgtypes.ts +2782 -0
- package/src/db/BigQuery.ts +213 -0
- package/src/db/{CachedPools.ts → CachedConnection.ts} +25 -21
- package/src/db/DatabaseHelper.ts +352 -0
- package/src/db/Mysql.ts +216 -0
- package/src/db/Postgres.ts +187 -0
- package/src/db/Snowflake.ts +203 -0
- package/src/index.ts +136 -34
- package/src/index.uspec.ts +9 -2
- package/src/models/Client.ts +29 -0
- package/src/models/Quill.ts +10 -6
- package/src/utils/RunQueryProcesses.ts +3 -26
- package/src/utils/schemaConversion.ts +11 -0
- package/src/utils/textProcessing.ts +13 -0
|
@@ -1,17 +1,49 @@
|
|
|
1
1
|
// Write a simple node server to test the SDK
|
|
2
2
|
|
|
3
3
|
import express from "express";
|
|
4
|
-
import Quill from "../../src/index";
|
|
5
4
|
import cors from "cors";
|
|
6
5
|
|
|
7
6
|
const app = express();
|
|
8
|
-
const port =
|
|
7
|
+
const port = 3001;
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
// postgresqlConfigExample {
|
|
10
|
+
// connectionString: process.env.DB_URL,
|
|
11
|
+
// ssl: {
|
|
12
|
+
// rejectUnauthorized: false,
|
|
13
|
+
// },
|
|
14
|
+
// };
|
|
15
|
+
|
|
16
|
+
// bigqueryConfigExample {
|
|
17
|
+
// projectId: process.env.PROJECT_ID,
|
|
18
|
+
// credentials: serviceAccount // You need to make the serviceAccount JSON
|
|
19
|
+
// }
|
|
20
|
+
|
|
21
|
+
// snowflakeConfigExample {
|
|
22
|
+
// account: process.env.ACCOUNT,
|
|
23
|
+
// username: process.env.USERNAME,
|
|
24
|
+
// password: process.env.PASSWORD,
|
|
25
|
+
// warehouse: process.env.WAREHOUSE,
|
|
26
|
+
// database: process.env.DATABASE,
|
|
27
|
+
// }
|
|
28
|
+
|
|
29
|
+
// mysqlConfigExample {
|
|
30
|
+
// host: process.env.HOST,
|
|
31
|
+
// user: process.env.USER,
|
|
32
|
+
// password: process.env.PASSWORD,
|
|
33
|
+
// database: process.env.DATABASE,
|
|
34
|
+
// }
|
|
35
|
+
|
|
36
|
+
const quill = require("../../src/index")({
|
|
37
|
+
privateKey: process.env.PRIVATE_KEY,
|
|
38
|
+
databaseConnectionString: process.env.DB_URL,
|
|
39
|
+
// databaseConfig: {
|
|
40
|
+
// connectionString: process.env.DB_URL,
|
|
41
|
+
// ssl: {
|
|
42
|
+
// rejectUnauthorized: false,
|
|
43
|
+
// },
|
|
44
|
+
// },
|
|
45
|
+
databaseType: process.env.DB_TYPE,
|
|
46
|
+
});
|
|
15
47
|
|
|
16
48
|
app.use(cors());
|
|
17
49
|
app.use(express.json());
|
|
@@ -21,10 +53,9 @@ app.get("/", (req, res) => {
|
|
|
21
53
|
});
|
|
22
54
|
|
|
23
55
|
app.post("/quill", async (req, res) => {
|
|
24
|
-
const organizationId = req.body.orgId;
|
|
25
56
|
const { metadata } = req.body;
|
|
26
57
|
const result = await quill.query({
|
|
27
|
-
orgId:
|
|
58
|
+
orgId: metadata.orgId,
|
|
28
59
|
metadata,
|
|
29
60
|
});
|
|
30
61
|
res.send(result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillsql/node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Quill's client SDK for node backends.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@types/jest": "^29.5.11",
|
|
19
19
|
"@types/node": "^20.10.7",
|
|
20
20
|
"@types/pg": "^8.10.9",
|
|
21
|
+
"@types/snowflake-sdk": "^1.6.20",
|
|
21
22
|
"cors": "^2.8.5",
|
|
22
23
|
"express": "^4.18.2",
|
|
23
24
|
"jest": "^29.7.0",
|
|
@@ -26,10 +27,13 @@
|
|
|
26
27
|
"typescript": "^5.3.3"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
30
|
+
"@google-cloud/bigquery": "^7.4.0",
|
|
29
31
|
"axios": "^1.6.5",
|
|
30
32
|
"dotenv": "^16.3.1",
|
|
33
|
+
"mysql2": "^3.9.1",
|
|
31
34
|
"pg": "^8.11.3",
|
|
32
35
|
"redis": "^4.6.12",
|
|
36
|
+
"snowflake-sdk": "^1.9.3",
|
|
33
37
|
"ts-jest": "^29.1.1"
|
|
34
38
|
}
|
|
35
|
-
}
|
|
39
|
+
}
|