@node-c/persistance-clickhouse 1.0.0-alpha37 → 1.0.0-alpha39
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.
|
@@ -26,15 +26,28 @@ class ClickHouseConnectionModule {
|
|
|
26
26
|
provide: clientName,
|
|
27
27
|
useFactory: (configProvider) => __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
const persistanceConfig = configProvider.config.persistance;
|
|
29
|
-
const { database, failOnConnectionError = true, host, password, port, protocol, user } = persistanceConfig[persistanceModuleName];
|
|
29
|
+
const { application, database, failOnConnectionError = true, host, password, port, protocol, requestTimeout, useHostParam, user } = persistanceConfig[persistanceModuleName];
|
|
30
|
+
const connectionOptions = {
|
|
31
|
+
database,
|
|
32
|
+
password,
|
|
33
|
+
username: user
|
|
34
|
+
};
|
|
35
|
+
const url = `${protocol || 'http'}://${host}:${port}`;
|
|
30
36
|
let client;
|
|
37
|
+
if (application) {
|
|
38
|
+
connectionOptions.application = application;
|
|
39
|
+
}
|
|
40
|
+
if (requestTimeout) {
|
|
41
|
+
connectionOptions.request_timeout = requestTimeout;
|
|
42
|
+
}
|
|
43
|
+
if (useHostParam) {
|
|
44
|
+
connectionOptions.host = url;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
connectionOptions.url = url;
|
|
48
|
+
}
|
|
31
49
|
try {
|
|
32
|
-
client = (0, client_1.createClient)(
|
|
33
|
-
database,
|
|
34
|
-
password,
|
|
35
|
-
url: `${protocol || 'http'}://${host}:${port}`,
|
|
36
|
-
username: user
|
|
37
|
-
});
|
|
50
|
+
client = (0, client_1.createClient)(connectionOptions);
|
|
38
51
|
const pingResult = yield client.ping({ select: true });
|
|
39
52
|
if (!pingResult.success) {
|
|
40
53
|
throw new Error(JSON.stringify(pingResult));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clickhouse.connection.module.js","sourceRoot":"","sources":["../../src/connectionModule/clickhouse.connection.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAoE;
|
|
1
|
+
{"version":3,"file":"clickhouse.connection.module.js","sourceRoot":"","sources":["../../src/connectionModule/clickhouse.connection.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAoE;AAIpE,uCAA8E;AAI9E,uDAAkD;AAElD,MAAa,0BAA0B;IACrC,MAAM,CAAC,QAAQ,CAAC,OAA0C;QACxD,MAAM,EAAE,qBAAqB,EAAE,GAAG,OAAO,CAAC;QAC1C,MAAM,UAAU,GAAG,GAAG,uBAAS,CAAC,wBAAwB,GAAG,qBAAqB,EAAE,CAAC;QACnF,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,0BAA0B;YAClC,OAAO,EAAE,EAAE;YACX,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,UAAU;oBACnB,UAAU,EAAE,CAAO,cAAqC,EAAE,EAAE;wBAC1D,MAAM,iBAAiB,GAAG,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC;wBAC5D,MAAM,EACJ,WAAW,EACX,QAAQ,EACR,qBAAqB,GAAG,IAAI,EAC5B,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,IAAI,EACL,GAAG,iBAAiB,CAAC,qBAAuD,CAA4B,CAAC;wBAC1G,MAAM,iBAAiB,GAAsC;4BAC3D,QAAQ;4BACR,QAAQ;4BACR,QAAQ,EAAE,IAAI;yBACf,CAAC;wBACF,MAAM,GAAG,GAAG,GAAG,QAAQ,IAAI,MAAM,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;wBACtD,IAAI,MAAwB,CAAC;wBAC7B,IAAI,WAAW,EAAE,CAAC;4BAChB,iBAAiB,CAAC,WAAW,GAAG,WAAW,CAAC;wBAC9C,CAAC;wBACD,IAAI,cAAc,EAAE,CAAC;4BACnB,iBAAiB,CAAC,eAAe,GAAG,cAAc,CAAC;wBACrD,CAAC;wBACD,IAAI,YAAY,EAAE,CAAC;4BACjB,iBAAiB,CAAC,IAAI,GAAG,GAAG,CAAC;wBAC/B,CAAC;6BAAM,CAAC;4BACN,iBAAiB,CAAC,GAAG,GAAG,GAAG,CAAC;wBAC9B,CAAC;wBACD,IAAI,CAAC;4BACH,MAAM,GAAG,IAAA,qBAAY,EAAC,iBAAiB,CAAC,CAAC;4BACzC,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;4BACvD,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;gCACxB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;4BAC9C,CAAC;wBACH,CAAC;wBAAC,OAAO,GAAG,EAAE,CAAC;4BACb,OAAO,CAAC,KAAK,CACX,gCAAgC,qBAAqB,oCAAoC,EACzF,GAAG,CACJ,CAAC;4BACF,IAAI,qBAAqB,EAAE,CAAC;gCAC1B,MAAM,GAAG,CAAC;4BACZ,CAAC;wBACH,CAAC;wBACD,OAAO,MAAO,CAAC;oBACjB,CAAC,CAAA;oBACD,MAAM,EAAE,CAAC,4BAAqB,CAAC;iBAChC;aACF;YACD,OAAO,EAAE,CAAC,UAAU,CAAC;SACtB,CAAC;IACJ,CAAC;CACF;AAlED,gEAkEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-c/persistance-clickhouse",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-alpha39",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"@clickhouse/client": "^1.12.1",
|
|
17
17
|
"@nestjs/common": "^10.4.12",
|
|
18
18
|
"@nestjs/typeorm": "^10.0.2",
|
|
19
|
-
"@node-c/core": "^1.0.0-
|
|
20
|
-
"@node-c/persistance-rdb": "^1.0.0-
|
|
19
|
+
"@node-c/core": "^1.0.0-alpha39",
|
|
20
|
+
"@node-c/persistance-rdb": "^1.0.0-alpha39",
|
|
21
21
|
"class-validator": "^0.14.1",
|
|
22
22
|
"typeorm": "^0.3.20",
|
|
23
23
|
"uuid": "^11.0.5"
|