dbgate-datalib 6.6.0 → 6.6.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.
package/lib/DataReplicator.js
CHANGED
|
@@ -257,7 +257,7 @@ class ReplicatorItemHolder {
|
|
|
257
257
|
missing += 1;
|
|
258
258
|
}
|
|
259
259
|
if (new Date().getTime() - lastLogged.getTime() > 5000) {
|
|
260
|
-
logger.info(`Replicating ${this.item.name} in progress, inserted ${inserted} rows, mapped ${mapped} rows, missing ${missing} rows, skipped ${skipped} rows, updated ${updated} rows`);
|
|
260
|
+
logger.info(`DBGM-00105 Replicating ${this.item.name} in progress, inserted ${inserted} rows, mapped ${mapped} rows, missing ${missing} rows, skipped ${skipped} rows, updated ${updated} rows`);
|
|
261
261
|
lastLogged = new Date();
|
|
262
262
|
}
|
|
263
263
|
// this.idMap[oldId] = newId;
|
|
@@ -407,20 +407,20 @@ class DataReplicator {
|
|
|
407
407
|
try {
|
|
408
408
|
for (const item of this.itemPlan) {
|
|
409
409
|
const stats = yield item.runImport();
|
|
410
|
-
logger.info(`Replicated ${item.name}, inserted ${stats.inserted} rows, mapped ${stats.mapped} rows, missing ${stats.missing} rows, skipped ${stats.skipped} rows, updated ${stats.updated} rows, deleted ${stats.deleted} rows`);
|
|
410
|
+
logger.info(`DBGM-00106 Replicated ${item.name}, inserted ${stats.inserted} rows, mapped ${stats.mapped} rows, missing ${stats.missing} rows, skipped ${stats.skipped} rows, updated ${stats.updated} rows, deleted ${stats.deleted} rows`);
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
catch (err) {
|
|
414
|
-
logger.error((0, dbgate_tools_1.extractErrorLogData)(err), `Failed replicator job, rollbacking. ${err.message}`);
|
|
414
|
+
logger.error((0, dbgate_tools_1.extractErrorLogData)(err), `DBGM-00179 Failed replicator job, rollbacking. ${err.message}`);
|
|
415
415
|
yield this.runDumperCommand(dmp => dmp.rollbackTransaction());
|
|
416
416
|
return;
|
|
417
417
|
}
|
|
418
418
|
if (this.options.rollbackAfterFinish) {
|
|
419
|
-
logger.info('Rollbacking transaction, nothing was changed');
|
|
419
|
+
logger.info('DBGM-00107 Rollbacking transaction, nothing was changed');
|
|
420
420
|
yield this.runDumperCommand(dmp => dmp.rollbackTransaction());
|
|
421
421
|
}
|
|
422
422
|
else {
|
|
423
|
-
logger.info('Committing replicator transaction');
|
|
423
|
+
logger.info('DBGM-00108 Committing replicator transaction');
|
|
424
424
|
yield this.runDumperCommand(dmp => dmp.commitTransaction());
|
|
425
425
|
}
|
|
426
426
|
this.result = this.dumper.s;
|
|
@@ -46,10 +46,10 @@ class ScriptDrivedDeployer {
|
|
|
46
46
|
try {
|
|
47
47
|
const { rows } = yield (0, dbgate_tools_1.runQueryOnDriver)(this.dbhan, this.driver, dmp => dmp.put('select * from ~dbgate_deploy_journal'));
|
|
48
48
|
this.journalItems = rows;
|
|
49
|
-
logger.debug(`Loaded ${rows.length} items from DbGate deploy journal`);
|
|
49
|
+
logger.debug(`DBGM-00109 Loaded ${rows.length} items from DbGate deploy journal`);
|
|
50
50
|
}
|
|
51
51
|
catch (err) {
|
|
52
|
-
logger.warn((0, dbgate_tools_1.extractErrorLogData)(err), 'Error loading DbGate deploy journal, creating table dbgate_deploy_journal');
|
|
52
|
+
logger.warn((0, dbgate_tools_1.extractErrorLogData)(err), 'DBGM-00110 Error loading DbGate deploy journal, creating table dbgate_deploy_journal');
|
|
53
53
|
const dmp = this.driver.createDumper();
|
|
54
54
|
dmp.createTable({
|
|
55
55
|
pureName: 'dbgate_deploy_journal',
|
|
@@ -122,13 +122,13 @@ class ScriptDrivedDeployer {
|
|
|
122
122
|
if (this.driver.supportsTransactions) {
|
|
123
123
|
(0, dbgate_tools_1.runCommandOnDriver)(this.dbhan, this.driver, dmp => dmp.beginTransaction());
|
|
124
124
|
}
|
|
125
|
-
logger.debug(`Running ${category} script ${file.name}`);
|
|
125
|
+
logger.debug(`DBGM-00111 Running ${category} script ${file.name}`);
|
|
126
126
|
try {
|
|
127
127
|
yield this.driver.script(this.dbhan, file.text, { useTransaction: false });
|
|
128
128
|
yield this.saveToJournal(file, category, hash);
|
|
129
129
|
}
|
|
130
130
|
catch (err) {
|
|
131
|
-
logger.error((0, dbgate_tools_1.extractErrorLogData)(err), `Error running ${category} script ${file.name}`);
|
|
131
|
+
logger.error((0, dbgate_tools_1.extractErrorLogData)(err), `DBGM-00180 Error running ${category} script ${file.name}`);
|
|
132
132
|
if (this.driver.supportsTransactions) {
|
|
133
133
|
(0, dbgate_tools_1.runCommandOnDriver)(this.dbhan, this.driver, dmp => dmp.rollbackTransaction());
|
|
134
134
|
return;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "6.6.
|
|
2
|
+
"version": "6.6.2",
|
|
3
3
|
"name": "dbgate-datalib",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"date-fns": "^4.1.0",
|
|
18
|
-
"dbgate-filterparser": "^6.6.
|
|
19
|
-
"dbgate-sqltree": "^6.6.
|
|
20
|
-
"dbgate-tools": "^6.6.
|
|
18
|
+
"dbgate-filterparser": "^6.6.2",
|
|
19
|
+
"dbgate-sqltree": "^6.6.2",
|
|
20
|
+
"dbgate-tools": "^6.6.2",
|
|
21
21
|
"uuid": "^3.4.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^13.7.0",
|
|
25
|
-
"dbgate-types": "^6.6.
|
|
25
|
+
"dbgate-types": "^6.6.2",
|
|
26
26
|
"jest": "^28.1.3",
|
|
27
27
|
"ts-jest": "^28.0.7",
|
|
28
28
|
"typescript": "^4.4.3"
|