@proteinjs/db 1.50.2 → 1.52.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 +22 -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/Db.d.ts +35 -0
- package/dist/src/Db.d.ts.map +1 -1
- package/dist/src/Db.js +169 -19
- package/dist/src/Db.js.map +1 -1
- package/dist/src/services/DbService.d.ts +7 -0
- package/dist/src/services/DbService.d.ts.map +1 -1
- package/dist/src/services/DbService.js +13 -1
- package/dist/src/services/DbService.js.map +1 -1
- package/dist/test/DbServiceRetryDeclaration.test.d.ts +2 -0
- package/dist/test/DbServiceRetryDeclaration.test.d.ts.map +1 -0
- package/dist/test/DbServiceRetryDeclaration.test.js +139 -0
- package/dist/test/DbServiceRetryDeclaration.test.js.map +1 -0
- package/dist/test/InsertMany.test.d.ts +2 -0
- package/dist/test/InsertMany.test.d.ts.map +1 -0
- package/dist/test/InsertMany.test.js +475 -0
- package/dist/test/InsertMany.test.js.map +1 -0
- package/dist/test/TableServiceAuth.test.js +12 -0
- package/dist/test/TableServiceAuth.test.js.map +1 -1
- package/dist/test/reusable/CrudTests.d.ts.map +1 -1
- package/dist/test/reusable/CrudTests.js +44 -0
- package/dist/test/reusable/CrudTests.js.map +1 -1
- package/dist/test/reusable/TransactionTests.d.ts.map +1 -1
- package/dist/test/reusable/TransactionTests.js +90 -0
- package/dist/test/reusable/TransactionTests.js.map +1 -1
- package/generated/index.ts +1 -1
- package/generated/test/index.ts +1 -1
- package/package.json +4 -4
- package/src/Db.ts +102 -0
- package/src/services/DbService.ts +13 -1
- package/test/DbServiceRetryDeclaration.test.ts +105 -0
- package/test/InsertMany.test.ts +298 -0
- package/test/TableServiceAuth.test.ts +12 -0
- package/test/reusable/CrudTests.ts +30 -0
- package/test/reusable/TransactionTests.ts +46 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
var reflection_1 = require("@proteinjs/reflection");
|
|
49
|
+
var service_1 = require("@proteinjs/service");
|
|
50
|
+
var DbService_1 = require("../src/services/DbService");
|
|
51
|
+
var READS = ['query', 'get', 'getRowCount', 'tableExists'];
|
|
52
|
+
var WRITES = ['insert', 'update', 'updateArrayMembership', 'updatePreserving', 'delete'];
|
|
53
|
+
beforeAll(function () {
|
|
54
|
+
// Node's Request rejects the relative service paths a browser resolves against the page origin.
|
|
55
|
+
global.Request = /** @class */ (function () {
|
|
56
|
+
function class_1(url, init) {
|
|
57
|
+
this.url = url;
|
|
58
|
+
this.init = init;
|
|
59
|
+
}
|
|
60
|
+
return class_1;
|
|
61
|
+
}());
|
|
62
|
+
var returnType = { name: 'Promise<any>' };
|
|
63
|
+
var methods = __spreadArray(__spreadArray([], READS, true), WRITES, true).map(function (name) { return new reflection_1.Method(name, returnType, true, false, false, false, 'public', []); });
|
|
64
|
+
reflection_1.SourceRepository.get().flattenedSourceGraph.interfaces['@proteinjs/db/DbService'] = new reflection_1.Interface('@proteinjs/db', 'DbService', [], methods);
|
|
65
|
+
});
|
|
66
|
+
/** A transport that never answers: its promise settles only when the request is abandoned (its signal aborts). */
|
|
67
|
+
var neverAnswers = function () {
|
|
68
|
+
return jest.fn(function (request) {
|
|
69
|
+
return new Promise(function (unused, reject) {
|
|
70
|
+
var _a;
|
|
71
|
+
(_a = request.init.signal) === null || _a === void 0 ? void 0 : _a.addEventListener('abort', function () {
|
|
72
|
+
return reject(Object.assign(new Error('The operation was aborted.'), { name: 'AbortError' }));
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
var sentRequests = function () { return global.fetch.mock.calls.map(function (_a) {
|
|
78
|
+
var request = _a[0];
|
|
79
|
+
return request;
|
|
80
|
+
}); };
|
|
81
|
+
/** The call's outcome, readable without awaiting it — a pending call must read as pending. */
|
|
82
|
+
var track = function (promise) {
|
|
83
|
+
var outcome = { state: 'pending' };
|
|
84
|
+
promise.then(function () {
|
|
85
|
+
outcome.state = 'resolved';
|
|
86
|
+
}, function () {
|
|
87
|
+
outcome.state = 'rejected';
|
|
88
|
+
});
|
|
89
|
+
return outcome;
|
|
90
|
+
};
|
|
91
|
+
var aTable = { name: 'a_table' };
|
|
92
|
+
describe('the db service under the client retry policy', function () {
|
|
93
|
+
beforeEach(function () { return jest.useFakeTimers(); });
|
|
94
|
+
afterEach(function () { return jest.useRealTimers(); });
|
|
95
|
+
it.each(READS)('%s is a declared read: bounded at the first contact, redelivered as a fresh request', function (name) { return __awaiter(void 0, void 0, void 0, function () {
|
|
96
|
+
var service, outcome;
|
|
97
|
+
return __generator(this, function (_a) {
|
|
98
|
+
switch (_a.label) {
|
|
99
|
+
case 0:
|
|
100
|
+
global.fetch = neverAnswers();
|
|
101
|
+
service = (0, DbService_1.getDbService)();
|
|
102
|
+
outcome = track(service[name](aTable, {}));
|
|
103
|
+
return [4 /*yield*/, jest.advanceTimersByTimeAsync(service_1.READ_CONTACT_TIMEOUT_MS)];
|
|
104
|
+
case 1:
|
|
105
|
+
_a.sent();
|
|
106
|
+
expect(sentRequests()).toHaveLength(1);
|
|
107
|
+
expect(sentRequests()[0].url).toBe("/service/@proteinjs/db/DbService/".concat(name));
|
|
108
|
+
expect(sentRequests()[0].init.signal.aborted).toBe(true);
|
|
109
|
+
return [4 /*yield*/, jest.advanceTimersByTimeAsync(service_1.REDELIVERY_BASE_MS)];
|
|
110
|
+
case 2:
|
|
111
|
+
_a.sent();
|
|
112
|
+
expect(sentRequests()).toHaveLength(2);
|
|
113
|
+
expect(sentRequests()[1].init.signal.aborted).toBe(false);
|
|
114
|
+
expect(outcome.state).toBe('pending');
|
|
115
|
+
return [2 /*return*/];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}); });
|
|
119
|
+
it.each(WRITES)('%s is undeclared: one delivery, no bound, never redelivered', function (name) { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
+
var service, outcome;
|
|
121
|
+
return __generator(this, function (_a) {
|
|
122
|
+
switch (_a.label) {
|
|
123
|
+
case 0:
|
|
124
|
+
global.fetch = neverAnswers();
|
|
125
|
+
service = (0, DbService_1.getDbService)();
|
|
126
|
+
outcome = track(service[name](aTable, {}));
|
|
127
|
+
return [4 /*yield*/, jest.advanceTimersByTimeAsync(service_1.READ_CONTACT_TIMEOUT_MS * 4)];
|
|
128
|
+
case 1:
|
|
129
|
+
_a.sent();
|
|
130
|
+
expect(sentRequests()).toHaveLength(1);
|
|
131
|
+
expect(sentRequests()[0].url).toBe("/service/@proteinjs/db/DbService/".concat(name));
|
|
132
|
+
expect(sentRequests()[0].init.signal).toBeUndefined();
|
|
133
|
+
expect(outcome.state).toBe('pending');
|
|
134
|
+
return [2 /*return*/];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}); });
|
|
138
|
+
});
|
|
139
|
+
//# sourceMappingURL=DbServiceRetryDeclaration.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DbServiceRetryDeclaration.test.js","sourceRoot":"","sources":["../../test/DbServiceRetryDeclaration.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAkG;AAClG,8CAAiF;AACjF,uDAAyD;AAmBzD,IAAM,KAAK,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;AAC7D,IAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AAE3F,SAAS,CAAC;IACR,gGAAgG;IAChG,MAAM,CAAC,OAAO,GAAG;QACf,iBACS,GAAW,EACX,IAAS;YADT,QAAG,GAAH,GAAG,CAAQ;YACX,SAAI,GAAJ,IAAI,CAAK;QACf,CAAC;QACN,cAAC;IAAD,CAAC,AALgB,GAKT,CAAC;IACT,IAAM,UAAU,GAAG,EAAE,IAAI,EAAE,cAAc,EAAqC,CAAC;IAC/E,IAAM,OAAO,GAAG,gCAAI,KAAK,SAAK,MAAM,QAAE,GAAG,CACvC,UAAC,IAAI,IAAK,OAAA,IAAI,mBAAM,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,EAArE,CAAqE,CAChF,CAAC;IACD,6BAAgB,CAAC,GAAG,EAAqC,CAAC,oBAAoB,CAAC,UAAU,CACxF,yBAAyB,CAC1B,GAAG,IAAI,sBAAS,CAAC,eAAe,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,CAAC,CAA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K,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;oBAEjD,qBAAM,IAAI,CAAC,wBAAwB,CAAC,iCAAuB,GAAG,CAAC,CAAC,EAAA;;oBAAhE,SAAgE,CAAC;oBACjE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBACvC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,2CAAoC,IAAI,CAAE,CAAC,CAAC;oBAC/E,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC;oBACtD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;;;;SACvC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InsertMany.test.d.ts","sourceRoot":"","sources":["../../test/InsertMany.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,475 @@
|
|
|
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 __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
+
function step(op) {
|
|
42
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
44
|
+
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;
|
|
45
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
+
switch (op[0]) {
|
|
47
|
+
case 0: case 1: t = op; break;
|
|
48
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
+
default:
|
|
52
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
+
if (t[2]) _.ops.pop();
|
|
57
|
+
_.trys.pop(); continue;
|
|
58
|
+
}
|
|
59
|
+
op = body.call(thisArg, _);
|
|
60
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
65
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
66
|
+
if (ar || !(i in from)) {
|
|
67
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
68
|
+
ar[i] = from[i];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
72
|
+
};
|
|
73
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74
|
+
var reflection_1 = require("@proteinjs/reflection");
|
|
75
|
+
var Db_1 = require("../src/Db");
|
|
76
|
+
var Table_1 = require("../src/Table");
|
|
77
|
+
var Record_1 = require("../src/Record");
|
|
78
|
+
var Columns_1 = require("../src/Columns");
|
|
79
|
+
var TableWatcherRunner_1 = require("../src/TableWatcherRunner");
|
|
80
|
+
var log = [];
|
|
81
|
+
var DocTable = /** @class */ (function (_super) {
|
|
82
|
+
__extends(DocTable, _super);
|
|
83
|
+
function DocTable() {
|
|
84
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
85
|
+
_this.name = 'insert_many_doc';
|
|
86
|
+
_this.columns = (0, Record_1.withRecordColumns)({
|
|
87
|
+
title: new Columns_1.StringColumn('title', {
|
|
88
|
+
onBeforeInsert: function (_table, record) { return __awaiter(_this, void 0, void 0, function () {
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
log.push(['column.before', record.title, typeof record.id === 'string']);
|
|
91
|
+
record.title = "".concat(record.title, "!");
|
|
92
|
+
return [2 /*return*/];
|
|
93
|
+
});
|
|
94
|
+
}); },
|
|
95
|
+
onAfterInsert: function (_table, record) { return __awaiter(_this, void 0, void 0, function () {
|
|
96
|
+
return __generator(this, function (_a) {
|
|
97
|
+
log.push(['column.after', record.title, typeof record.id === 'string']);
|
|
98
|
+
return [2 /*return*/];
|
|
99
|
+
});
|
|
100
|
+
}); },
|
|
101
|
+
}),
|
|
102
|
+
note: new Columns_1.StringColumn('note'),
|
|
103
|
+
flagged: new Columns_1.BooleanColumn('flagged', { defaultValue: function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
104
|
+
return [2 /*return*/, false];
|
|
105
|
+
}); }); } }),
|
|
106
|
+
});
|
|
107
|
+
return _this;
|
|
108
|
+
}
|
|
109
|
+
return DocTable;
|
|
110
|
+
}(Table_1.Table));
|
|
111
|
+
var docTable = new DocTable();
|
|
112
|
+
var RecordingWatcher = /** @class */ (function () {
|
|
113
|
+
function RecordingWatcher() {
|
|
114
|
+
}
|
|
115
|
+
RecordingWatcher.prototype.name = function () {
|
|
116
|
+
return 'RecordingWatcher';
|
|
117
|
+
};
|
|
118
|
+
RecordingWatcher.prototype.table = function () {
|
|
119
|
+
return docTable;
|
|
120
|
+
};
|
|
121
|
+
RecordingWatcher.prototype.beforeInsert = function (record) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
123
|
+
var doc;
|
|
124
|
+
return __generator(this, function (_a) {
|
|
125
|
+
doc = record;
|
|
126
|
+
log.push(['watcher.before', doc.title, typeof doc.id === 'string']);
|
|
127
|
+
return [2 /*return*/, __assign(__assign({}, record), { note: "seen ".concat(doc.title) })];
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
RecordingWatcher.prototype.afterInsert = function (record) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
133
|
+
return __generator(this, function (_a) {
|
|
134
|
+
log.push(['watcher.after', record.title, typeof record.id === 'string']);
|
|
135
|
+
return [2 /*return*/];
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
return RecordingWatcher;
|
|
140
|
+
}());
|
|
141
|
+
var TestTransactionContextFactory = /** @class */ (function () {
|
|
142
|
+
function TestTransactionContextFactory() {
|
|
143
|
+
this.context = {};
|
|
144
|
+
}
|
|
145
|
+
TestTransactionContextFactory.prototype.getTransactionContext = function () {
|
|
146
|
+
return this.context;
|
|
147
|
+
};
|
|
148
|
+
TestTransactionContextFactory.prototype.runInContext = function (context, fn) {
|
|
149
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
150
|
+
var previous;
|
|
151
|
+
return __generator(this, function (_a) {
|
|
152
|
+
switch (_a.label) {
|
|
153
|
+
case 0:
|
|
154
|
+
previous = this.context;
|
|
155
|
+
this.context = context;
|
|
156
|
+
_a.label = 1;
|
|
157
|
+
case 1:
|
|
158
|
+
_a.trys.push([1, , 3, 4]);
|
|
159
|
+
return [4 /*yield*/, fn()];
|
|
160
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
161
|
+
case 3:
|
|
162
|
+
this.context = previous;
|
|
163
|
+
return [7 /*endfinally*/];
|
|
164
|
+
case 4: return [2 /*return*/];
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
return TestTransactionContextFactory;
|
|
170
|
+
}());
|
|
171
|
+
/** Records every DML statement the Db hands it, as the Spanner driver would generate it. */
|
|
172
|
+
var RecordingDriver = /** @class */ (function () {
|
|
173
|
+
function RecordingDriver() {
|
|
174
|
+
this.dml = [];
|
|
175
|
+
this.transactions = 0;
|
|
176
|
+
}
|
|
177
|
+
RecordingDriver.prototype.getDbName = function () {
|
|
178
|
+
return 'test';
|
|
179
|
+
};
|
|
180
|
+
RecordingDriver.prototype.createDbIfNotExists = function () {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
182
|
+
return [2 /*return*/];
|
|
183
|
+
}); });
|
|
184
|
+
};
|
|
185
|
+
RecordingDriver.prototype.createDb = function () {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
187
|
+
return [2 /*return*/];
|
|
188
|
+
}); });
|
|
189
|
+
};
|
|
190
|
+
RecordingDriver.prototype.dropDb = function () {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
192
|
+
return [2 /*return*/];
|
|
193
|
+
}); });
|
|
194
|
+
};
|
|
195
|
+
RecordingDriver.prototype.getTableManager = function () {
|
|
196
|
+
throw new Error('not used by these tests');
|
|
197
|
+
};
|
|
198
|
+
RecordingDriver.prototype.runQuery = function () {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
200
|
+
return __generator(this, function (_a) {
|
|
201
|
+
return [2 /*return*/, []];
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
RecordingDriver.prototype.runDml = function (generateStatement, transaction) {
|
|
206
|
+
var _a, _b, _c;
|
|
207
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
208
|
+
var statement;
|
|
209
|
+
return __generator(this, function (_d) {
|
|
210
|
+
statement = generateStatement({
|
|
211
|
+
useParams: true,
|
|
212
|
+
useNamedParams: true,
|
|
213
|
+
prefixTablesWithDb: false,
|
|
214
|
+
getDriverColumnType: function () { return 'STRING(MAX)'; },
|
|
215
|
+
});
|
|
216
|
+
this.dml.push({ sql: statement.sql, params: (_b = (_a = statement.namedParams) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {}, transaction: transaction });
|
|
217
|
+
if ((_c = this.refuse) === null || _c === void 0 ? void 0 : _c.call(this, statement.sql)) {
|
|
218
|
+
throw new Error("refused: ".concat(statement.sql));
|
|
219
|
+
}
|
|
220
|
+
return [2 /*return*/, tuplesOf(statement.sql)];
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
RecordingDriver.prototype.runTransaction = function (fn) {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
226
|
+
return __generator(this, function (_a) {
|
|
227
|
+
switch (_a.label) {
|
|
228
|
+
case 0:
|
|
229
|
+
this.transactions += 1;
|
|
230
|
+
return [4 /*yield*/, fn({ id: "transaction-".concat(this.transactions) })];
|
|
231
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
RecordingDriver.prototype.getOperationDeadlineMs = function () {
|
|
237
|
+
return 1000;
|
|
238
|
+
};
|
|
239
|
+
return RecordingDriver;
|
|
240
|
+
}());
|
|
241
|
+
var BoundedDriver = /** @class */ (function (_super) {
|
|
242
|
+
__extends(BoundedDriver, _super);
|
|
243
|
+
function BoundedDriver(limit) {
|
|
244
|
+
var _this = _super.call(this) || this;
|
|
245
|
+
_this.limit = limit;
|
|
246
|
+
return _this;
|
|
247
|
+
}
|
|
248
|
+
BoundedDriver.prototype.getStatementParameterLimit = function () {
|
|
249
|
+
return this.limit;
|
|
250
|
+
};
|
|
251
|
+
return BoundedDriver;
|
|
252
|
+
}(RecordingDriver));
|
|
253
|
+
var tuplesOf = function (sql) { var _a; return ((_a = sql.match(/\(@param\d+/g)) !== null && _a !== void 0 ? _a : []).length; };
|
|
254
|
+
var objectCache = function () { return reflection_1.SourceRepository.get().objectCache; };
|
|
255
|
+
/** A system Db over `driver`, its watcher map rebuilt from the recording watcher alone. */
|
|
256
|
+
var dbOver = function (driver) {
|
|
257
|
+
TableWatcherRunner_1.TableWatcherRunner.tableWatcherMap = undefined;
|
|
258
|
+
return new Db_1.Db(driver, function () { return docTable; }, new TestTransactionContextFactory(), true);
|
|
259
|
+
};
|
|
260
|
+
var rowsOf = function (titles) { return titles.map(function (title) { return ({ title: title }); }); };
|
|
261
|
+
var eventsFor = function (title) { return log.filter(function (_a) {
|
|
262
|
+
var t = _a[1];
|
|
263
|
+
return t === title || t === "".concat(title, "!");
|
|
264
|
+
}); };
|
|
265
|
+
var shapeOf = function (doc) { return ({ title: doc.title, note: doc.note, flagged: doc.flagged }); };
|
|
266
|
+
describe('Db.insertMany', function () {
|
|
267
|
+
var originalWatchers;
|
|
268
|
+
beforeAll(function () {
|
|
269
|
+
originalWatchers = objectCache()['@proteinjs/db/TableWatcher'];
|
|
270
|
+
objectCache()['@proteinjs/db/TableWatcher'] = [new RecordingWatcher()];
|
|
271
|
+
});
|
|
272
|
+
afterAll(function () {
|
|
273
|
+
if (originalWatchers) {
|
|
274
|
+
objectCache()['@proteinjs/db/TableWatcher'] = originalWatchers;
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
delete objectCache()['@proteinjs/db/TableWatcher'];
|
|
278
|
+
}
|
|
279
|
+
TableWatcherRunner_1.TableWatcherRunner.tableWatcherMap = undefined;
|
|
280
|
+
});
|
|
281
|
+
beforeEach(function () {
|
|
282
|
+
log.length = 0;
|
|
283
|
+
});
|
|
284
|
+
test('N rows issue exactly ONE statement, every row in it with its defaults, returned in order', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
285
|
+
var driver, db, inserted, _i, inserted_1, doc, bound, _a, inserted_2, doc;
|
|
286
|
+
return __generator(this, function (_b) {
|
|
287
|
+
switch (_b.label) {
|
|
288
|
+
case 0:
|
|
289
|
+
driver = new RecordingDriver();
|
|
290
|
+
db = dbOver(driver);
|
|
291
|
+
return [4 /*yield*/, db.insertMany(docTable, rowsOf(['a', 'b', 'c']))];
|
|
292
|
+
case 1:
|
|
293
|
+
inserted = _b.sent();
|
|
294
|
+
expect(driver.dml).toHaveLength(1);
|
|
295
|
+
expect(tuplesOf(driver.dml[0].sql)).toBe(3);
|
|
296
|
+
expect(driver.dml[0].sql).toMatch(/^INSERT INTO `insert_many_doc` \(.+\) VALUES \(.+\), \(.+\), \(.+\);$/);
|
|
297
|
+
expect(inserted.map(shapeOf)).toEqual([
|
|
298
|
+
{ title: 'a!', note: 'seen a', flagged: false },
|
|
299
|
+
{ title: 'b!', note: 'seen b', flagged: false },
|
|
300
|
+
{ title: 'c!', note: 'seen c', flagged: false },
|
|
301
|
+
]);
|
|
302
|
+
for (_i = 0, inserted_1 = inserted; _i < inserted_1.length; _i++) {
|
|
303
|
+
doc = inserted_1[_i];
|
|
304
|
+
expect(typeof doc.id).toBe('string');
|
|
305
|
+
expect(doc.created).toBeDefined();
|
|
306
|
+
expect(doc.updated).toBeDefined();
|
|
307
|
+
}
|
|
308
|
+
bound = Object.values(driver.dml[0].params);
|
|
309
|
+
for (_a = 0, inserted_2 = inserted; _a < inserted_2.length; _a++) {
|
|
310
|
+
doc = inserted_2[_a];
|
|
311
|
+
expect(bound).toContain(doc.id);
|
|
312
|
+
expect(bound).toContain(doc.note);
|
|
313
|
+
}
|
|
314
|
+
return [2 /*return*/];
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}); });
|
|
318
|
+
test('every per-row hook fires once per row, in row order, and sees the row as the single insert shows it', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
319
|
+
var serial, _i, _a, row, serialLog, batched, _loop_1, _b, _c, title;
|
|
320
|
+
return __generator(this, function (_d) {
|
|
321
|
+
switch (_d.label) {
|
|
322
|
+
case 0:
|
|
323
|
+
serial = dbOver(new RecordingDriver());
|
|
324
|
+
_i = 0, _a = rowsOf(['a', 'b']);
|
|
325
|
+
_d.label = 1;
|
|
326
|
+
case 1:
|
|
327
|
+
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
328
|
+
row = _a[_i];
|
|
329
|
+
return [4 /*yield*/, serial.insert(docTable, row)];
|
|
330
|
+
case 2:
|
|
331
|
+
_d.sent();
|
|
332
|
+
_d.label = 3;
|
|
333
|
+
case 3:
|
|
334
|
+
_i++;
|
|
335
|
+
return [3 /*break*/, 1];
|
|
336
|
+
case 4:
|
|
337
|
+
serialLog = __spreadArray([], log, true);
|
|
338
|
+
log.length = 0;
|
|
339
|
+
batched = dbOver(new RecordingDriver());
|
|
340
|
+
return [4 /*yield*/, batched.insertMany(docTable, rowsOf(['a', 'b']))];
|
|
341
|
+
case 5:
|
|
342
|
+
_d.sent();
|
|
343
|
+
_loop_1 = function (title) {
|
|
344
|
+
var serialEvents = serialLog.filter(function (_a) {
|
|
345
|
+
var t = _a[1];
|
|
346
|
+
return t === title || t === "".concat(title, "!");
|
|
347
|
+
});
|
|
348
|
+
expect(eventsFor(title)).toEqual(serialEvents);
|
|
349
|
+
expect(eventsFor(title).map(function (_a) {
|
|
350
|
+
var phase = _a[0];
|
|
351
|
+
return phase;
|
|
352
|
+
})).toEqual([
|
|
353
|
+
'watcher.before',
|
|
354
|
+
'column.before',
|
|
355
|
+
'column.after',
|
|
356
|
+
'watcher.after',
|
|
357
|
+
]);
|
|
358
|
+
};
|
|
359
|
+
// Each row's own sequence — what fired, in what order, with the id already set — is the
|
|
360
|
+
// serial road's exactly.
|
|
361
|
+
for (_b = 0, _c = ['a', 'b']; _b < _c.length; _b++) {
|
|
362
|
+
title = _c[_b];
|
|
363
|
+
_loop_1(title);
|
|
364
|
+
}
|
|
365
|
+
// Across rows, each phase runs in row order; the before-phases of every row precede the
|
|
366
|
+
// statement, the after-phases follow it.
|
|
367
|
+
expect(log.map(function (_a) {
|
|
368
|
+
var phase = _a[0], title = _a[1];
|
|
369
|
+
return "".concat(phase, ":").concat(title);
|
|
370
|
+
})).toEqual([
|
|
371
|
+
'watcher.before:a',
|
|
372
|
+
'column.before:a',
|
|
373
|
+
'watcher.before:b',
|
|
374
|
+
'column.before:b',
|
|
375
|
+
'column.after:a!',
|
|
376
|
+
'watcher.after:a!',
|
|
377
|
+
'column.after:b!',
|
|
378
|
+
'watcher.after:b!',
|
|
379
|
+
]);
|
|
380
|
+
return [2 /*return*/];
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
}); });
|
|
384
|
+
test("a batch wider than the driver's parameter bound goes as the fewest statements that fit, in order", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
385
|
+
var driver, db, inserted, _i, _a, statement;
|
|
386
|
+
return __generator(this, function (_b) {
|
|
387
|
+
switch (_b.label) {
|
|
388
|
+
case 0:
|
|
389
|
+
driver = new BoundedDriver(13);
|
|
390
|
+
db = dbOver(driver);
|
|
391
|
+
return [4 /*yield*/, db.insertMany(docTable, rowsOf(['a', 'b', 'c', 'd', 'e']))];
|
|
392
|
+
case 1:
|
|
393
|
+
inserted = _b.sent();
|
|
394
|
+
expect(driver.dml.map(function (statement) { return tuplesOf(statement.sql); })).toEqual([2, 2, 1]);
|
|
395
|
+
for (_i = 0, _a = driver.dml; _i < _a.length; _i++) {
|
|
396
|
+
statement = _a[_i];
|
|
397
|
+
expect(Object.keys(statement.params).length).toBeLessThanOrEqual(13);
|
|
398
|
+
}
|
|
399
|
+
expect(inserted.map(function (doc) { return doc.title; })).toEqual(['a!', 'b!', 'c!', 'd!', 'e!']);
|
|
400
|
+
// One transaction around the whole batch: every statement rides the same one.
|
|
401
|
+
expect(driver.transactions).toBe(1);
|
|
402
|
+
expect(new Set(driver.dml.map(function (statement) { return statement.transaction; })).size).toBe(1);
|
|
403
|
+
return [2 /*return*/];
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}); });
|
|
407
|
+
test('the batch rides the ambient transaction when there is one, and opens its own when there is none', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
408
|
+
var ambient, db, own;
|
|
409
|
+
return __generator(this, function (_a) {
|
|
410
|
+
switch (_a.label) {
|
|
411
|
+
case 0:
|
|
412
|
+
ambient = new RecordingDriver();
|
|
413
|
+
db = dbOver(ambient);
|
|
414
|
+
return [4 /*yield*/, db.runTransaction(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
415
|
+
return __generator(this, function (_a) {
|
|
416
|
+
switch (_a.label) {
|
|
417
|
+
case 0: return [4 /*yield*/, db.insertMany(docTable, rowsOf(['a', 'b']))];
|
|
418
|
+
case 1:
|
|
419
|
+
_a.sent();
|
|
420
|
+
return [2 /*return*/];
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
}); })];
|
|
424
|
+
case 1:
|
|
425
|
+
_a.sent();
|
|
426
|
+
expect(ambient.transactions).toBe(1);
|
|
427
|
+
expect(ambient.dml[0].transaction).toEqual({ id: 'transaction-1' });
|
|
428
|
+
own = new RecordingDriver();
|
|
429
|
+
return [4 /*yield*/, dbOver(own).insertMany(docTable, rowsOf(['a', 'b']))];
|
|
430
|
+
case 2:
|
|
431
|
+
_a.sent();
|
|
432
|
+
expect(own.transactions).toBe(1);
|
|
433
|
+
expect(own.dml[0].transaction).toEqual({ id: 'transaction-1' });
|
|
434
|
+
return [2 /*return*/];
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
}); });
|
|
438
|
+
test('no rows: nothing issued, nothing opened, an empty result', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
439
|
+
var driver, inserted;
|
|
440
|
+
return __generator(this, function (_a) {
|
|
441
|
+
switch (_a.label) {
|
|
442
|
+
case 0:
|
|
443
|
+
driver = new RecordingDriver();
|
|
444
|
+
return [4 /*yield*/, dbOver(driver).insertMany(docTable, [])];
|
|
445
|
+
case 1:
|
|
446
|
+
inserted = _a.sent();
|
|
447
|
+
expect(inserted).toEqual([]);
|
|
448
|
+
expect(driver.dml).toHaveLength(0);
|
|
449
|
+
expect(driver.transactions).toBe(0);
|
|
450
|
+
expect(log).toHaveLength(0);
|
|
451
|
+
return [2 /*return*/];
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
}); });
|
|
455
|
+
test('a refused statement fails the batch: the error surfaces and no after-phase runs for any row', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
456
|
+
var driver;
|
|
457
|
+
return __generator(this, function (_a) {
|
|
458
|
+
switch (_a.label) {
|
|
459
|
+
case 0:
|
|
460
|
+
driver = new RecordingDriver();
|
|
461
|
+
driver.refuse = function () { return true; };
|
|
462
|
+
return [4 /*yield*/, expect(dbOver(driver).insertMany(docTable, rowsOf(['a', 'b']))).rejects.toThrow('refused')];
|
|
463
|
+
case 1:
|
|
464
|
+
_a.sent();
|
|
465
|
+
expect(driver.dml).toHaveLength(1);
|
|
466
|
+
expect(log.map(function (_a) {
|
|
467
|
+
var phase = _a[0];
|
|
468
|
+
return phase;
|
|
469
|
+
}).filter(function (phase) { return phase.endsWith('.after'); })).toEqual([]);
|
|
470
|
+
return [2 /*return*/];
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
}); });
|
|
474
|
+
});
|
|
475
|
+
//# sourceMappingURL=InsertMany.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InsertMany.test.js","sourceRoot":"","sources":["../../test/InsertMany.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAyD;AAEzD,gCAAqE;AACrE,sCAAqC;AACrC,wCAA0D;AAC1D,0CAA6D;AAE7D,gEAA+D;AAqB/D,IAAM,GAAG,GAAgB,EAAE,CAAC;AAE5B;IAAuB,4BAAU;IAAjC;QAAA,qEAeC;QAdQ,UAAI,GAAG,iBAAiB,CAAC;QACzB,aAAO,GAAG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