@proteinjs/db 1.21.2 → 1.21.4
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/CHANGELOG.md +11 -0
- package/dist/generated/index.js +1 -1
- package/dist/generated/index.js.map +1 -1
- package/dist/generated/test/index.js +1 -1
- package/dist/generated/test/index.js.map +1 -1
- package/dist/src/source/SourceRecordLoader.d.ts +18 -0
- package/dist/src/source/SourceRecordLoader.d.ts.map +1 -1
- package/dist/src/source/SourceRecordLoader.js +125 -18
- package/dist/src/source/SourceRecordLoader.js.map +1 -1
- package/generated/index.ts +1 -1
- package/generated/test/index.ts +1 -1
- package/package.json +11 -11
- package/src/source/SourceRecordLoader.ts +104 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../generated/test/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,+BAA6B;AAC7B,6BAA2B;AAC3B,iCAA+B;AAC/B,iCAA+B;AAC/B,iCAA+B;AAC/B,8BAA4B;AAC5B,gCAA8B;AAC9B,2BAAyB;AACzB,kBAAgB;AAChB,gBAAc;AAGd,4BAA4B;AAE5B,IAAM,WAAW,GAAG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../generated/test/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,+BAA6B;AAC7B,6BAA2B;AAC3B,iCAA+B;AAC/B,iCAA+B;AAC/B,iCAA+B;AAC/B,8BAA4B;AAC5B,gCAA8B;AAC9B,2BAAyB;AACzB,kBAAgB;AAChB,gBAAc;AAGd,4BAA4B;AAE5B,IAAM,WAAW,GAAG,+ltFAA+ltF,CAAC;AAGpntF,4BAA4B;AAE5B,0FAAgF;AAChF,yCAAwC;AACxC,0FAA+E;AAC/E,0FAAgF;AAChF,0FAA+E;AAC/E,0FAAgF;AAChF,0FAA+E;AAC/E,0FAA2E;A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,EAAE,iCAAe;IAChD,yBAAyB,EAAE,qBAAS;IACpC,8BAA8B,EAAE,+BAAc;IAC9C,wCAAwC,EAAE,mDAAwB;IAClE,mCAAmC,EAAE,yCAAmB;IACxD,+BAA+B,EAAE,iCAAe;IAChD,kCAAkC,EAAE,uCAAkB;IACtD,8BAA8B,EAAE,+BAAc;IAC9C,iCAAiC,EAAE,qCAAiB;CACpD,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,mDAAiC"}
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
export declare class SourceRecordLoader {
|
|
2
2
|
private logger;
|
|
3
3
|
load(): Promise<void>;
|
|
4
|
+
/**
|
|
5
|
+
* Compare source record fields against the existing DB record to detect actual changes.
|
|
6
|
+
* Only fields present on the source record are compared (ignoring `created`, `updated`).
|
|
7
|
+
* Uses serialization to normalize values (e.g. Reference objects, Moment, JSON) before comparison.
|
|
8
|
+
*
|
|
9
|
+
* The comparison checks that every value in the source record exists with the same value
|
|
10
|
+
* in the existing DB record. Extra keys in the DB record are ignored — table watchers
|
|
11
|
+
* and hooks may enrich records with additional data after insert/update.
|
|
12
|
+
*/
|
|
13
|
+
private hasChanges;
|
|
14
|
+
/**
|
|
15
|
+
* Find the first point of divergence between source and existing values.
|
|
16
|
+
* Returns a description of the mismatch path, or null if they match.
|
|
17
|
+
* For objects, extra keys in `existing` are ignored — they may have been added by
|
|
18
|
+
* table watchers or hooks after the source record was loaded.
|
|
19
|
+
* For arrays, order and length must match exactly.
|
|
20
|
+
*/
|
|
21
|
+
private findMismatchPath;
|
|
4
22
|
private getSourceRecordsMap;
|
|
5
23
|
}
|
|
6
24
|
//# sourceMappingURL=SourceRecordLoader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceRecordLoader.d.ts","sourceRoot":"","sources":["../../../src/source/SourceRecordLoader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SourceRecordLoader.d.ts","sourceRoot":"","sources":["../../../src/source/SourceRecordLoader.ts"],"names":[],"mappings":"AAYA,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAA+C;IAEvD,IAAI;IAmDV;;;;;;;;OAQG;YACW,UAAU;IAmBxB;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;YA0DV,mBAAmB;CAyBlC"}
|
|
@@ -53,13 +53,14 @@ var db_query_1 = require("@proteinjs/db-query");
|
|
|
53
53
|
var SourceRecord_1 = require("./SourceRecord");
|
|
54
54
|
var Db_1 = require("../Db");
|
|
55
55
|
var SourceRecordRepo_1 = require("./SourceRecordRepo");
|
|
56
|
+
var Record_1 = require("../Record");
|
|
56
57
|
var SourceRecordLoader = /** @class */ (function () {
|
|
57
58
|
function SourceRecordLoader() {
|
|
58
59
|
this.logger = new logger_1.Logger({ name: this.constructor.name });
|
|
59
60
|
}
|
|
60
61
|
SourceRecordLoader.prototype.load = function () {
|
|
61
62
|
return __awaiter(this, void 0, void 0, function () {
|
|
62
|
-
var sourceRecordsMap, db, _a, _b, _c, _i, tableName, insertCount, updateCount, deleteCount, table, sourceRecordIds, qb, sourceRecords, _d, sourceRecords_1, sourceRecord,
|
|
63
|
+
var sourceRecordsMap, db, _a, _b, _c, _i, tableName, insertCount, updateCount, unchangedCount, deleteCount, table, sourceRecordIds, qb, sourceRecords, _d, sourceRecords_1, sourceRecord, existingRecord, dbSourceRecord;
|
|
63
64
|
return __generator(this, function (_e) {
|
|
64
65
|
switch (_e.label) {
|
|
65
66
|
case 0: return [4 /*yield*/, this.getSourceRecordsMap()];
|
|
@@ -73,12 +74,13 @@ var SourceRecordLoader = /** @class */ (function () {
|
|
|
73
74
|
_i = 0;
|
|
74
75
|
_e.label = 2;
|
|
75
76
|
case 2:
|
|
76
|
-
if (!(_i < _b.length)) return [3 /*break*/,
|
|
77
|
+
if (!(_i < _b.length)) return [3 /*break*/, 17];
|
|
77
78
|
_c = _b[_i];
|
|
78
|
-
if (!(_c in _a)) return [3 /*break*/,
|
|
79
|
+
if (!(_c in _a)) return [3 /*break*/, 16];
|
|
79
80
|
tableName = _c;
|
|
80
81
|
insertCount = 0;
|
|
81
82
|
updateCount = 0;
|
|
83
|
+
unchangedCount = 0;
|
|
82
84
|
deleteCount = 0;
|
|
83
85
|
table = sourceRecordsMap[tableName].table;
|
|
84
86
|
sourceRecordIds = sourceRecordsMap[tableName].recordIds;
|
|
@@ -96,45 +98,150 @@ var SourceRecordLoader = /** @class */ (function () {
|
|
|
96
98
|
_d = 0, sourceRecords_1 = sourceRecords;
|
|
97
99
|
_e.label = 5;
|
|
98
100
|
case 5:
|
|
99
|
-
if (!(_d < sourceRecords_1.length)) return [3 /*break*/,
|
|
101
|
+
if (!(_d < sourceRecords_1.length)) return [3 /*break*/, 15];
|
|
100
102
|
sourceRecord = sourceRecords_1[_d];
|
|
101
103
|
sourceRecord.isLoadedFromSource = true;
|
|
102
|
-
return [4 /*yield*/, db.
|
|
104
|
+
return [4 /*yield*/, db.get(table, { id: sourceRecord.id })];
|
|
103
105
|
case 6:
|
|
104
|
-
|
|
105
|
-
if (!
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
existingRecord = _e.sent();
|
|
107
|
+
if (!existingRecord) return [3 /*break*/, 11];
|
|
108
|
+
return [4 /*yield*/, this.hasChanges(table, sourceRecord, existingRecord)];
|
|
109
|
+
case 7:
|
|
110
|
+
if (!_e.sent()) return [3 /*break*/, 9];
|
|
111
|
+
return [4 /*yield*/, db.update(table, sourceRecord)];
|
|
109
112
|
case 8:
|
|
113
|
+
_e.sent();
|
|
114
|
+
updateCount += 1;
|
|
115
|
+
return [3 /*break*/, 10];
|
|
116
|
+
case 9:
|
|
117
|
+
unchangedCount += 1;
|
|
118
|
+
_e.label = 10;
|
|
119
|
+
case 10: return [3 /*break*/, 13];
|
|
120
|
+
case 11: return [4 /*yield*/, db.insert(table, sourceRecord)];
|
|
121
|
+
case 12:
|
|
110
122
|
dbSourceRecord = _e.sent();
|
|
111
123
|
sourceRecord = __assign(__assign({}, sourceRecord), dbSourceRecord);
|
|
112
124
|
insertCount += 1;
|
|
113
|
-
_e.label =
|
|
114
|
-
case
|
|
125
|
+
_e.label = 13;
|
|
126
|
+
case 13:
|
|
115
127
|
new SourceRecordRepo_1.SourceRecordRepo().loadSourceRecord(table.name, sourceRecord);
|
|
116
|
-
_e.label =
|
|
117
|
-
case
|
|
128
|
+
_e.label = 14;
|
|
129
|
+
case 14:
|
|
118
130
|
_d++;
|
|
119
131
|
return [3 /*break*/, 5];
|
|
120
|
-
case
|
|
132
|
+
case 15:
|
|
121
133
|
this.logger.info({
|
|
122
134
|
message: "(".concat(table.name, ") Loaded ").concat(sourceRecords.length, " ").concat(sourceRecords.length == 1 ? 'record' : 'records', " from source"),
|
|
123
135
|
obj: {
|
|
124
136
|
inserts: insertCount,
|
|
125
137
|
updates: updateCount,
|
|
138
|
+
unchanged: unchangedCount,
|
|
126
139
|
deletes: deleteCount,
|
|
127
140
|
},
|
|
128
141
|
});
|
|
129
|
-
_e.label =
|
|
130
|
-
case
|
|
142
|
+
_e.label = 16;
|
|
143
|
+
case 16:
|
|
131
144
|
_i++;
|
|
132
145
|
return [3 /*break*/, 2];
|
|
133
|
-
case
|
|
146
|
+
case 17: return [2 /*return*/];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Compare source record fields against the existing DB record to detect actual changes.
|
|
153
|
+
* Only fields present on the source record are compared (ignoring `created`, `updated`).
|
|
154
|
+
* Uses serialization to normalize values (e.g. Reference objects, Moment, JSON) before comparison.
|
|
155
|
+
*
|
|
156
|
+
* The comparison checks that every value in the source record exists with the same value
|
|
157
|
+
* in the existing DB record. Extra keys in the DB record are ignored — table watchers
|
|
158
|
+
* and hooks may enrich records with additional data after insert/update.
|
|
159
|
+
*/
|
|
160
|
+
SourceRecordLoader.prototype.hasChanges = function (table, sourceRecord, existingRecord) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
162
|
+
var serializer, serializedSource, serializedExisting, columnName, sourceValue, existingValue;
|
|
163
|
+
return __generator(this, function (_a) {
|
|
164
|
+
switch (_a.label) {
|
|
165
|
+
case 0:
|
|
166
|
+
serializer = new Record_1.RecordSerializer(table);
|
|
167
|
+
return [4 /*yield*/, serializer.serialize(sourceRecord)];
|
|
168
|
+
case 1:
|
|
169
|
+
serializedSource = _a.sent();
|
|
170
|
+
return [4 /*yield*/, serializer.serialize(existingRecord)];
|
|
171
|
+
case 2:
|
|
172
|
+
serializedExisting = _a.sent();
|
|
173
|
+
for (columnName in serializedSource) {
|
|
174
|
+
if (columnName === 'created' || columnName === 'updated') {
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
sourceValue = serializedSource[columnName];
|
|
178
|
+
existingValue = serializedExisting[columnName];
|
|
179
|
+
if (this.findMismatchPath(sourceValue, existingValue, columnName)) {
|
|
180
|
+
return [2 /*return*/, true];
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return [2 /*return*/, false];
|
|
134
184
|
}
|
|
135
185
|
});
|
|
136
186
|
});
|
|
137
187
|
};
|
|
188
|
+
/**
|
|
189
|
+
* Find the first point of divergence between source and existing values.
|
|
190
|
+
* Returns a description of the mismatch path, or null if they match.
|
|
191
|
+
* For objects, extra keys in `existing` are ignored — they may have been added by
|
|
192
|
+
* table watchers or hooks after the source record was loaded.
|
|
193
|
+
* For arrays, order and length must match exactly.
|
|
194
|
+
*/
|
|
195
|
+
SourceRecordLoader.prototype.findMismatchPath = function (source, existing, path) {
|
|
196
|
+
if (source === existing) {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
if (source == null || existing == null) {
|
|
200
|
+
if (source == existing) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
return "".concat(path, ": source=").concat(JSON.stringify(source), ", existing=").concat(JSON.stringify(existing));
|
|
204
|
+
}
|
|
205
|
+
if (typeof source !== typeof existing) {
|
|
206
|
+
return "".concat(path, ": type mismatch: source=").concat(typeof source, ", existing=").concat(typeof existing);
|
|
207
|
+
}
|
|
208
|
+
if (typeof source !== 'object') {
|
|
209
|
+
var sourceStr = typeof source === 'string' && source.length > 80 ? source.substring(0, 80) + '...' : source;
|
|
210
|
+
var existingStr = typeof existing === 'string' && existing.length > 80 ? existing.substring(0, 80) + '...' : existing;
|
|
211
|
+
return "".concat(path, ": source=").concat(JSON.stringify(sourceStr), ", existing=").concat(JSON.stringify(existingStr));
|
|
212
|
+
}
|
|
213
|
+
if (Array.isArray(source) !== Array.isArray(existing)) {
|
|
214
|
+
return "".concat(path, ": array mismatch: source isArray=").concat(Array.isArray(source), ", existing isArray=").concat(Array.isArray(existing));
|
|
215
|
+
}
|
|
216
|
+
if (Array.isArray(source)) {
|
|
217
|
+
if (source.length !== existing.length) {
|
|
218
|
+
return "".concat(path, ": array length: source=").concat(source.length, ", existing=").concat(existing.length);
|
|
219
|
+
}
|
|
220
|
+
for (var i = 0; i < source.length; i++) {
|
|
221
|
+
var result = this.findMismatchPath(source[i], existing[i], "".concat(path, "[").concat(i, "]"));
|
|
222
|
+
if (result) {
|
|
223
|
+
return result;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
for (var _i = 0, _a = Object.keys(source); _i < _a.length; _i++) {
|
|
229
|
+
var key = _a[_i];
|
|
230
|
+
// Skip undefined values — they don't survive JSON serialization (JSON.stringify
|
|
231
|
+
// drops undefined), so the DB record won't have them.
|
|
232
|
+
if (source[key] === undefined) {
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
if (!(key in existing)) {
|
|
236
|
+
return "".concat(path, ".").concat(key, ": key missing in existing");
|
|
237
|
+
}
|
|
238
|
+
var result = this.findMismatchPath(source[key], existing[key], "".concat(path, ".").concat(key));
|
|
239
|
+
if (result) {
|
|
240
|
+
return result;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return null;
|
|
244
|
+
};
|
|
138
245
|
SourceRecordLoader.prototype.getSourceRecordsMap = function () {
|
|
139
246
|
return __awaiter(this, void 0, void 0, function () {
|
|
140
247
|
var sourceRecordsMap, sourceRecordTables, _i, sourceRecordTables_1, sourceRecordTable, sourceRecordLoaders, _a, sourceRecordLoaders_1, sourceRecordLoader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceRecordLoader.js","sourceRoot":"","sources":["../../../src/source/SourceRecordLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA2C;AAC3C,gDAAmD;AACnD,+CAA6F;AAE7F,4BAAsC;AACtC,uDAAsD;
|
|
1
|
+
{"version":3,"file":"SourceRecordLoader.js","sourceRoot":"","sources":["../../../src/source/SourceRecordLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA2C;AAC3C,gDAAmD;AACnD,+CAA6F;AAE7F,4BAAsC;AACtC,uDAAsD;AACtD,oCAA6C;AAM7C;IAAA;QACU,WAAM,GAAG,IAAI,eAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IA2K/D,CAAC;IAzKO,iCAAI,GAAV;;;;;4BAC2B,qBAAM,IAAI,CAAC,mBAAmB,EAAE,EAAA;;wBAAnD,gBAAgB,GAAG,SAAgC;wBACnD,EAAE,GAAG,IAAA,kBAAa,GAAE,CAAC;6BACH,gBAAgB;;;;;;;;;;;wBAClC,WAAW,GAAG,CAAC,CAAC;wBAChB,WAAW,GAAG,CAAC,CAAC;wBAChB,cAAc,GAAG,CAAC,CAAC;wBACnB,WAAW,GAAG,CAAC,CAAC;wBACd,KAAK,GAAG,gBAAgB,CAAC,SAAS,CAAC,CA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