dbgate-tools 5.5.2 → 5.5.4-alpha.1

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.
@@ -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) {
@@ -49,4 +49,5 @@ export declare const driverBase: {
49
49
  createSaveChangeSetScript(changeSet: any, dbinfo: any, defaultCreator: any): any;
50
50
  adaptTableInfo(table: any): any;
51
51
  listSchemas(pool: any): Promise<any>;
52
+ writeQueryFromStream(dbhan: any, sql: any): Promise<any>;
52
53
  };
package/lib/driverBase.js CHANGED
@@ -212,4 +212,9 @@ exports.driverBase = {
212
212
  return null;
213
213
  });
214
214
  },
215
+ writeQueryFromStream(dbhan, sql) {
216
+ return __awaiter(this, void 0, void 0, function* () {
217
+ return null;
218
+ });
219
+ },
215
220
  };
@@ -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;
@@ -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",
2
+ "version": "5.5.4-alpha.1",
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.2",
28
+ "dbgate-types": "^5.5.4-alpha.1",
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.3",
35
- "dbgate-sqltree": "^5.5.2",
34
+ "dbgate-query-splitter": "^4.10.5",
35
+ "dbgate-sqltree": "^5.5.4-alpha.1",
36
36
  "debug": "^4.3.4",
37
37
  "json-stable-stringify": "^1.0.1",
38
38
  "lodash": "^4.17.21",