@proteinjs/db 1.52.0 → 1.53.0
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/src/Db.d.ts +13 -0
- package/dist/src/Db.d.ts.map +1 -1
- package/dist/src/Db.js +40 -15
- package/dist/src/Db.js.map +1 -1
- package/dist/src/DuplicateKeyError.d.ts +20 -0
- package/dist/src/DuplicateKeyError.d.ts.map +1 -0
- package/dist/src/DuplicateKeyError.js +47 -0
- package/dist/src/DuplicateKeyError.js.map +1 -0
- package/dist/test/DuplicateKeyError.test.d.ts +2 -0
- package/dist/test/DuplicateKeyError.test.d.ts.map +1 -0
- package/dist/test/DuplicateKeyError.test.js +287 -0
- package/dist/test/DuplicateKeyError.test.js.map +1 -0
- package/generated/index.ts +1 -1
- package/generated/test/index.ts +1 -1
- package/index.ts +1 -0
- package/package.json +2 -2
- package/src/Db.ts +27 -2
- package/src/DuplicateKeyError.ts +26 -0
- package/test/DuplicateKeyError.test.ts +179 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
var reflection_1 = require("@proteinjs/reflection");
|
|
55
|
+
var Db_1 = require("../src/Db");
|
|
56
|
+
var DuplicateKeyError_1 = require("../src/DuplicateKeyError");
|
|
57
|
+
var Table_1 = require("../src/Table");
|
|
58
|
+
var Record_1 = require("../src/Record");
|
|
59
|
+
var Columns_1 = require("../src/Columns");
|
|
60
|
+
var TableWatcherRunner_1 = require("../src/TableWatcherRunner");
|
|
61
|
+
var DocTable = /** @class */ (function (_super) {
|
|
62
|
+
__extends(DocTable, _super);
|
|
63
|
+
function DocTable() {
|
|
64
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
65
|
+
_this.name = 'duplicate_key_doc';
|
|
66
|
+
_this.columns = (0, Record_1.withRecordColumns)({
|
|
67
|
+
title: new Columns_1.StringColumn('title'),
|
|
68
|
+
});
|
|
69
|
+
return _this;
|
|
70
|
+
}
|
|
71
|
+
return DocTable;
|
|
72
|
+
}(Table_1.Table));
|
|
73
|
+
var docTable = new DocTable();
|
|
74
|
+
var TestTransactionContextFactory = /** @class */ (function () {
|
|
75
|
+
function TestTransactionContextFactory() {
|
|
76
|
+
this.context = {};
|
|
77
|
+
}
|
|
78
|
+
TestTransactionContextFactory.prototype.getTransactionContext = function () {
|
|
79
|
+
return this.context;
|
|
80
|
+
};
|
|
81
|
+
TestTransactionContextFactory.prototype.runInContext = function (context, fn) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var previous;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
previous = this.context;
|
|
88
|
+
this.context = context;
|
|
89
|
+
_a.label = 1;
|
|
90
|
+
case 1:
|
|
91
|
+
_a.trys.push([1, , 3, 4]);
|
|
92
|
+
return [4 /*yield*/, fn()];
|
|
93
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
94
|
+
case 3:
|
|
95
|
+
this.context = previous;
|
|
96
|
+
return [7 /*endfinally*/];
|
|
97
|
+
case 4: return [2 /*return*/];
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
return TestTransactionContextFactory;
|
|
103
|
+
}());
|
|
104
|
+
/** A driver whose every DML fails with the error it is handed, classifying `code === 6` as a duplicate key. */
|
|
105
|
+
var RefusingDriver = /** @class */ (function () {
|
|
106
|
+
function RefusingDriver(refusal) {
|
|
107
|
+
this.refusal = refusal;
|
|
108
|
+
}
|
|
109
|
+
RefusingDriver.prototype.getDbName = function () {
|
|
110
|
+
return 'test';
|
|
111
|
+
};
|
|
112
|
+
RefusingDriver.prototype.createDbIfNotExists = function () {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
114
|
+
return [2 /*return*/];
|
|
115
|
+
}); });
|
|
116
|
+
};
|
|
117
|
+
RefusingDriver.prototype.createDb = function () {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
119
|
+
return [2 /*return*/];
|
|
120
|
+
}); });
|
|
121
|
+
};
|
|
122
|
+
RefusingDriver.prototype.dropDb = function () {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
124
|
+
return [2 /*return*/];
|
|
125
|
+
}); });
|
|
126
|
+
};
|
|
127
|
+
RefusingDriver.prototype.getTableManager = function () {
|
|
128
|
+
throw new Error('not used by these tests');
|
|
129
|
+
};
|
|
130
|
+
RefusingDriver.prototype.runQuery = function () {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
132
|
+
return __generator(this, function (_a) {
|
|
133
|
+
return [2 /*return*/, []];
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
RefusingDriver.prototype.runDml = function (generateStatement) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
+
return __generator(this, function (_a) {
|
|
140
|
+
generateStatement({
|
|
141
|
+
useParams: true,
|
|
142
|
+
useNamedParams: true,
|
|
143
|
+
prefixTablesWithDb: false,
|
|
144
|
+
getDriverColumnType: function () { return 'STRING(MAX)'; },
|
|
145
|
+
});
|
|
146
|
+
throw this.refusal;
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
RefusingDriver.prototype.runTransaction = function (fn) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
+
return __generator(this, function (_a) {
|
|
153
|
+
switch (_a.label) {
|
|
154
|
+
case 0: return [4 /*yield*/, fn({ id: 'transaction' })];
|
|
155
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
RefusingDriver.prototype.getOperationDeadlineMs = function () {
|
|
161
|
+
return 1000;
|
|
162
|
+
};
|
|
163
|
+
RefusingDriver.prototype.isDuplicateKeyError = function (error) {
|
|
164
|
+
return (error === null || error === void 0 ? void 0 : error.code) === 6;
|
|
165
|
+
};
|
|
166
|
+
return RefusingDriver;
|
|
167
|
+
}());
|
|
168
|
+
/** The same driver with no classifier declared. */
|
|
169
|
+
var UnclassifyingDriver = /** @class */ (function (_super) {
|
|
170
|
+
__extends(UnclassifyingDriver, _super);
|
|
171
|
+
function UnclassifyingDriver() {
|
|
172
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
173
|
+
_this.isDuplicateKeyError = undefined;
|
|
174
|
+
return _this;
|
|
175
|
+
}
|
|
176
|
+
return UnclassifyingDriver;
|
|
177
|
+
}(RefusingDriver));
|
|
178
|
+
var dbOn = function (driver) { return new Db_1.Db(driver, function () { return docTable; }, new TestTransactionContextFactory(), true); };
|
|
179
|
+
var failureOf = function (act) { return __awaiter(void 0, void 0, void 0, function () {
|
|
180
|
+
var error_1;
|
|
181
|
+
return __generator(this, function (_a) {
|
|
182
|
+
switch (_a.label) {
|
|
183
|
+
case 0:
|
|
184
|
+
_a.trys.push([0, 2, , 3]);
|
|
185
|
+
return [4 /*yield*/, act()];
|
|
186
|
+
case 1:
|
|
187
|
+
_a.sent();
|
|
188
|
+
return [3 /*break*/, 3];
|
|
189
|
+
case 2:
|
|
190
|
+
error_1 = _a.sent();
|
|
191
|
+
return [2 /*return*/, error_1];
|
|
192
|
+
case 3: throw new Error('the insert was expected to fail');
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}); };
|
|
196
|
+
var objectCache = function () { return reflection_1.SourceRepository.get().objectCache; };
|
|
197
|
+
describe('an insert the database refuses because the row is already there', function () {
|
|
198
|
+
var backendRefusal = Object.assign(new Error('Row {pk#id:"7f3"} in table duplicate_key_doc already exists'), {
|
|
199
|
+
code: 6,
|
|
200
|
+
});
|
|
201
|
+
var originalWatchers;
|
|
202
|
+
// No reflection graph in a unit test: the watcher registry is empty by declaration.
|
|
203
|
+
beforeAll(function () {
|
|
204
|
+
originalWatchers = objectCache()['@proteinjs/db/TableWatcher'];
|
|
205
|
+
objectCache()['@proteinjs/db/TableWatcher'] = [];
|
|
206
|
+
TableWatcherRunner_1.TableWatcherRunner.tableWatcherMap = undefined;
|
|
207
|
+
});
|
|
208
|
+
afterAll(function () {
|
|
209
|
+
if (originalWatchers) {
|
|
210
|
+
objectCache()['@proteinjs/db/TableWatcher'] = originalWatchers;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
delete objectCache()['@proteinjs/db/TableWatcher'];
|
|
214
|
+
}
|
|
215
|
+
TableWatcherRunner_1.TableWatcherRunner.tableWatcherMap = undefined;
|
|
216
|
+
});
|
|
217
|
+
test('reaches the caller as the typed DuplicateKeyError, naming the table, carrying the cause unprinted', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
218
|
+
var failure, typed;
|
|
219
|
+
return __generator(this, function (_a) {
|
|
220
|
+
switch (_a.label) {
|
|
221
|
+
case 0: return [4 /*yield*/, failureOf(function () { return dbOn(new RefusingDriver(backendRefusal)).insert(docTable, { title: 'a' }); })];
|
|
222
|
+
case 1:
|
|
223
|
+
failure = _a.sent();
|
|
224
|
+
expect((0, DuplicateKeyError_1.isDuplicateKeyError)(failure)).toBe(true);
|
|
225
|
+
typed = failure;
|
|
226
|
+
expect(typed.name).toBe('DuplicateKeyError');
|
|
227
|
+
expect(typed.message).toBe('(duplicate_key_doc) Insert refused: a row with the same key already exists');
|
|
228
|
+
expect(typed.cause).toBe(backendRefusal);
|
|
229
|
+
// The backend's words quote the colliding key: they ride for callers in process only.
|
|
230
|
+
expect(Object.keys(typed)).not.toContain('cause');
|
|
231
|
+
expect(JSON.stringify(typed)).not.toContain('pk#id');
|
|
232
|
+
return [2 /*return*/];
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}); });
|
|
236
|
+
test('the same on insertMany', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
237
|
+
var failure;
|
|
238
|
+
return __generator(this, function (_a) {
|
|
239
|
+
switch (_a.label) {
|
|
240
|
+
case 0: return [4 /*yield*/, failureOf(function () {
|
|
241
|
+
return dbOn(new RefusingDriver(backendRefusal)).insertMany(docTable, [{ title: 'a' }, { title: 'b' }]);
|
|
242
|
+
})];
|
|
243
|
+
case 1:
|
|
244
|
+
failure = _a.sent();
|
|
245
|
+
expect((0, DuplicateKeyError_1.isDuplicateKeyError)(failure)).toBe(true);
|
|
246
|
+
expect(failure.cause).toBe(backendRefusal);
|
|
247
|
+
return [2 /*return*/];
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}); });
|
|
251
|
+
test('any other refusal reaches the caller as the driver threw it', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
252
|
+
var aborted, failure;
|
|
253
|
+
return __generator(this, function (_a) {
|
|
254
|
+
switch (_a.label) {
|
|
255
|
+
case 0:
|
|
256
|
+
aborted = Object.assign(new Error('Transaction was aborted'), { code: 10 });
|
|
257
|
+
return [4 /*yield*/, failureOf(function () { return dbOn(new RefusingDriver(aborted)).insert(docTable, { title: 'a' }); })];
|
|
258
|
+
case 1:
|
|
259
|
+
failure = _a.sent();
|
|
260
|
+
expect(failure).toBe(aborted);
|
|
261
|
+
expect((0, DuplicateKeyError_1.isDuplicateKeyError)(failure)).toBe(false);
|
|
262
|
+
return [2 /*return*/];
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}); });
|
|
266
|
+
test('a driver that declares no classifier lets the refusal through as it came', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
267
|
+
var failure;
|
|
268
|
+
return __generator(this, function (_a) {
|
|
269
|
+
switch (_a.label) {
|
|
270
|
+
case 0: return [4 /*yield*/, failureOf(function () {
|
|
271
|
+
return dbOn(new UnclassifyingDriver(backendRefusal)).insert(docTable, { title: 'a' });
|
|
272
|
+
})];
|
|
273
|
+
case 1:
|
|
274
|
+
failure = _a.sent();
|
|
275
|
+
expect(failure).toBe(backendRefusal);
|
|
276
|
+
return [2 /*return*/];
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}); });
|
|
280
|
+
test('the guard reads the name, not the prototype chain', function () {
|
|
281
|
+
expect((0, DuplicateKeyError_1.isDuplicateKeyError)(Object.assign(new Error('x'), { name: 'DuplicateKeyError' }))).toBe(true);
|
|
282
|
+
expect((0, DuplicateKeyError_1.isDuplicateKeyError)(new Error('DuplicateKeyError'))).toBe(false);
|
|
283
|
+
expect((0, DuplicateKeyError_1.isDuplicateKeyError)(undefined)).toBe(false);
|
|
284
|
+
expect((0, DuplicateKeyError_1.isDuplicateKeyError)('DuplicateKeyError')).toBe(false);
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
//# sourceMappingURL=DuplicateKeyError.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DuplicateKeyError.test.js","sourceRoot":"","sources":["../../test/DuplicateKeyError.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAyD;AAEzD,gCAAqE;AACrE,8DAAkF;AAClF,sCAAqC;AACrC,wCAA0D;AAC1D,0CAA8C;AAC9C,gEAA+D;AAiB/D;IAAuB,4BAAU;IAAjC;QAAA,qEAKC;QAJQ,UAAI,GAAG,mBAAmB,CAAC;QAC3B,aAAO,GAAG,IAAA,0BAAiB,EAAM;YACtC,KAAK,EAAE,IAAI,sBAAY,CAAC,OAAO,CAAC;SACjC,CAAC,CAAC;;IACL,CAAC;IAAD,eAAC;AAAD,CAAC,AALD,CAAuB,aAAK,GAK3B;AAED,IAAM,QAAQ,GAAG,IAAI,QAAQ,EAAgB,CAAC;AAE9C;IAAA;QACU,YAAO,GAA2B,EAAE,CAAC;IAe/C,CAAC;IAbC,6DAAqB,GAArB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEK,oDAAY,GAAlB,UAAsB,OAA+B,EAAE,EAAoB;;;;;;wBACnE,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;wBAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC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