dbgate-tools 5.5.1 → 5.5.3
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/lib/DatabaseAnalyser.js +2 -0
- package/lib/driverBase.d.ts +1 -0
- package/lib/driverBase.js +5 -0
- package/lib/schemaInfoTools.d.ts +4 -0
- package/lib/schemaInfoTools.js +18 -1
- package/package.json +4 -4
package/lib/DatabaseAnalyser.js
CHANGED
|
@@ -74,6 +74,7 @@ class DatabaseAnalyser {
|
|
|
74
74
|
}
|
|
75
75
|
fullAnalysis() {
|
|
76
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
logger.info(`Performing full analysis, DB=${(0, schemaInfoTools_1.dbNameLogCategory)(this.dbhan.database)}, engine=${this.driver.engine}`);
|
|
77
78
|
const res = this.addEngineField(yield this._runAnalysis());
|
|
78
79
|
// console.log('FULL ANALYSIS', res);
|
|
79
80
|
return res;
|
|
@@ -96,6 +97,7 @@ class DatabaseAnalyser {
|
|
|
96
97
|
}
|
|
97
98
|
incrementalAnalysis(structure) {
|
|
98
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
logger.info(`Performing incremental analysis, DB=${(0, schemaInfoTools_1.dbNameLogCategory)(this.dbhan.database)}, engine=${this.driver.engine}`);
|
|
99
101
|
this.structure = structure;
|
|
100
102
|
const modifications = yield this.getModifications();
|
|
101
103
|
if (modifications == null) {
|
package/lib/driverBase.d.ts
CHANGED
package/lib/driverBase.js
CHANGED
package/lib/schemaInfoTools.d.ts
CHANGED
|
@@ -7,3 +7,7 @@ export declare function splitCompositeDbName(name: string): {
|
|
|
7
7
|
};
|
|
8
8
|
export declare function extractDbNameFromComposite(name: string): string;
|
|
9
9
|
export declare function extractSchemaNameFromComposite(name: string): string;
|
|
10
|
+
export declare function dbNameLogCategory(database: string): string;
|
|
11
|
+
export declare function compositeDbNameIfNeeded(connnection: {
|
|
12
|
+
useSeparateSchemas: boolean;
|
|
13
|
+
}, database: string, schema: string): string;
|
package/lib/schemaInfoTools.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extractSchemaNameFromComposite = exports.extractDbNameFromComposite = exports.splitCompositeDbName = exports.isCompositeDbName = exports.findDefaultSchema = void 0;
|
|
3
|
+
exports.compositeDbNameIfNeeded = exports.dbNameLogCategory = exports.extractSchemaNameFromComposite = exports.extractDbNameFromComposite = exports.splitCompositeDbName = exports.isCompositeDbName = exports.findDefaultSchema = void 0;
|
|
4
4
|
function findDefaultSchema(schemaList, dialect, schemaInStorage = null) {
|
|
5
5
|
var _a;
|
|
6
6
|
if (!schemaList) {
|
|
@@ -39,3 +39,20 @@ function extractSchemaNameFromComposite(name) {
|
|
|
39
39
|
return (_a = splitCompositeDbName(name)) === null || _a === void 0 ? void 0 : _a.schema;
|
|
40
40
|
}
|
|
41
41
|
exports.extractSchemaNameFromComposite = extractSchemaNameFromComposite;
|
|
42
|
+
function dbNameLogCategory(database) {
|
|
43
|
+
if (isCompositeDbName(database)) {
|
|
44
|
+
return '~composite';
|
|
45
|
+
}
|
|
46
|
+
if (database) {
|
|
47
|
+
return '~simple';
|
|
48
|
+
}
|
|
49
|
+
return '~nodb';
|
|
50
|
+
}
|
|
51
|
+
exports.dbNameLogCategory = dbNameLogCategory;
|
|
52
|
+
function compositeDbNameIfNeeded(connnection, database, schema) {
|
|
53
|
+
if (connnection === null || connnection === void 0 ? void 0 : connnection.useSeparateSchemas) {
|
|
54
|
+
return `${database}::${schema}`;
|
|
55
|
+
}
|
|
56
|
+
return database;
|
|
57
|
+
}
|
|
58
|
+
exports.compositeDbNameIfNeeded = compositeDbNameIfNeeded;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.5.
|
|
2
|
+
"version": "5.5.3",
|
|
3
3
|
"name": "dbgate-tools",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^13.7.0",
|
|
28
|
-
"dbgate-types": "^5.5.
|
|
28
|
+
"dbgate-types": "^5.5.3",
|
|
29
29
|
"jest": "^24.9.0",
|
|
30
30
|
"ts-jest": "^25.2.1",
|
|
31
31
|
"typescript": "^4.4.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"dbgate-query-splitter": "^4.10.
|
|
35
|
-
"dbgate-sqltree": "^5.5.
|
|
34
|
+
"dbgate-query-splitter": "^4.10.5",
|
|
35
|
+
"dbgate-sqltree": "^5.5.3",
|
|
36
36
|
"debug": "^4.3.4",
|
|
37
37
|
"json-stable-stringify": "^1.0.1",
|
|
38
38
|
"lodash": "^4.17.21",
|