oak-db 3.0.1 → 3.0.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/MySQL/connector.js +68 -75
- package/lib/MySQL/store.d.ts +1 -0
- package/lib/MySQL/store.js +131 -269
- package/lib/MySQL/translator.d.ts +1 -1
- package/lib/MySQL/translator.js +344 -359
- package/lib/MySQL/types/Configuration.d.ts +2 -2
- package/lib/index.js +1 -1
- package/lib/sqlTranslator.d.ts +1 -1
- package/lib/sqlTranslator.js +359 -365
- package/package.json +7 -7
package/lib/MySQL/store.js
CHANGED
|
@@ -1,71 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MysqlStore = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const CascadeStore_1 = require("oak-domain/lib/store/CascadeStore");
|
|
6
|
+
const connector_1 = require("./connector");
|
|
7
|
+
const translator_1 = require("./translator");
|
|
8
|
+
const lodash_1 = require("lodash");
|
|
9
|
+
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
10
|
+
const relation_1 = require("oak-domain/lib/store/relation");
|
|
11
11
|
function convertGeoTextToObject(geoText) {
|
|
12
12
|
if (geoText.startsWith('POINT')) {
|
|
13
|
-
|
|
13
|
+
const coord = geoText.match((/(\d|\.)+(?=\)|\s)/g));
|
|
14
14
|
return {
|
|
15
15
|
type: 'Point',
|
|
16
|
-
coordinate: coord.map(
|
|
16
|
+
coordinate: coord.map(ele => parseFloat(ele)),
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
20
|
throw new Error('only support Point now');
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function MysqlStore(storageSchema, configuration) {
|
|
26
|
-
var _this = _super.call(this, storageSchema) || this;
|
|
27
|
-
_this.connector = new connector_1.MySqlConnector(configuration);
|
|
28
|
-
_this.translator = new translator_1.MySqlTranslator(storageSchema);
|
|
29
|
-
return _this;
|
|
30
|
-
}
|
|
31
|
-
MysqlStore.prototype.aggregateSync = function (entity, aggregation, context, option) {
|
|
23
|
+
class MysqlStore extends CascadeStore_1.CascadeStore {
|
|
24
|
+
aggregateSync(entity, aggregation, context, option) {
|
|
32
25
|
throw new Error('MySQL store不支持同步取数据,不应该跑到这儿');
|
|
33
|
-
}
|
|
34
|
-
|
|
26
|
+
}
|
|
27
|
+
selectAbjointRow(entity, selection, context, option) {
|
|
35
28
|
throw new Error('MySQL store不支持同步取数据,不应该跑到这儿');
|
|
36
|
-
}
|
|
37
|
-
|
|
29
|
+
}
|
|
30
|
+
updateAbjointRow(entity, operation, context, option) {
|
|
38
31
|
throw new Error('MySQL store不支持同步更新数据,不应该跑到这儿');
|
|
39
|
-
}
|
|
40
|
-
|
|
32
|
+
}
|
|
33
|
+
exec(script, txnId) {
|
|
41
34
|
return this.connector.exec(script, txnId);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
MysqlStore.prototype.aggregate = function (entity, aggregation, context, option) {
|
|
35
|
+
}
|
|
36
|
+
connector;
|
|
37
|
+
translator;
|
|
38
|
+
constructor(storageSchema, configuration) {
|
|
39
|
+
super(storageSchema);
|
|
40
|
+
this.connector = new connector_1.MySqlConnector(configuration);
|
|
41
|
+
this.translator = new translator_1.MySqlTranslator(storageSchema);
|
|
42
|
+
}
|
|
43
|
+
async aggregateAsync(entity, aggregation, context, option) {
|
|
44
|
+
const sql = this.translator.translateAggregate(entity, aggregation, option);
|
|
45
|
+
const result = await this.connector.exec(sql, context.getCurrentTxnId());
|
|
46
|
+
return this.formResult(entity, result);
|
|
47
|
+
}
|
|
48
|
+
aggregate(entity, aggregation, context, option) {
|
|
59
49
|
return this.aggregateAsync(entity, aggregation, context, option);
|
|
60
|
-
}
|
|
61
|
-
|
|
50
|
+
}
|
|
51
|
+
supportManyToOneJoin() {
|
|
62
52
|
return true;
|
|
63
|
-
}
|
|
64
|
-
|
|
53
|
+
}
|
|
54
|
+
supportMultipleCreate() {
|
|
65
55
|
return true;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
}
|
|
57
|
+
formResult(entity, result) {
|
|
58
|
+
const schema = this.getSchema();
|
|
69
59
|
/* function resolveObject(r: Record<string, any>, path: string, value: any) {
|
|
70
60
|
const i = path.indexOf(".");
|
|
71
61
|
const bs = path.indexOf('[');
|
|
@@ -86,14 +76,13 @@ var MysqlStore = /** @class */ (function (_super) {
|
|
|
86
76
|
}
|
|
87
77
|
} */
|
|
88
78
|
function resolveAttribute(entity2, r, attr, value) {
|
|
89
|
-
|
|
90
|
-
var _b = schema[entity2], attributes = _b.attributes, view = _b.view;
|
|
79
|
+
const { attributes, view } = schema[entity2];
|
|
91
80
|
if (!view) {
|
|
92
|
-
|
|
81
|
+
const i = attr.indexOf(".");
|
|
93
82
|
if (i !== -1) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
83
|
+
const attrHead = attr.slice(0, i);
|
|
84
|
+
const attrTail = attr.slice(i + 1);
|
|
85
|
+
const rel = (0, relation_1.judgeRelation)(schema, entity2, attrHead);
|
|
97
86
|
if (rel === 1) {
|
|
98
87
|
(0, lodash_1.set)(r, attr, value);
|
|
99
88
|
}
|
|
@@ -114,7 +103,7 @@ var MysqlStore = /** @class */ (function (_super) {
|
|
|
114
103
|
}
|
|
115
104
|
}
|
|
116
105
|
else if (attributes[attr]) {
|
|
117
|
-
|
|
106
|
+
const { type } = attributes[attr];
|
|
118
107
|
switch (type) {
|
|
119
108
|
case 'date':
|
|
120
109
|
case 'time': {
|
|
@@ -148,7 +137,7 @@ var MysqlStore = /** @class */ (function (_super) {
|
|
|
148
137
|
case 'function': {
|
|
149
138
|
if (typeof value === 'string') {
|
|
150
139
|
// 函数的执行环境需要的参数只有创建函数者知悉,只能由上层再创建Function
|
|
151
|
-
r[attr] =
|
|
140
|
+
r[attr] = `return ${Buffer.from(value, 'base64').toString()}`;
|
|
152
141
|
}
|
|
153
142
|
else {
|
|
154
143
|
r[attr] = value;
|
|
@@ -189,31 +178,31 @@ var MysqlStore = /** @class */ (function (_super) {
|
|
|
189
178
|
}
|
|
190
179
|
}
|
|
191
180
|
else {
|
|
192
|
-
(0, lodash_1.assign)(r,
|
|
193
|
-
|
|
194
|
-
|
|
181
|
+
(0, lodash_1.assign)(r, {
|
|
182
|
+
[attr]: value,
|
|
183
|
+
});
|
|
195
184
|
}
|
|
196
185
|
}
|
|
197
186
|
function removeNullObjects(r, e) {
|
|
198
187
|
// assert(r.id && typeof r.id === 'string', `对象${<string>e}取数据时发现id为非法值${r.id},rowId是${r.id}`)
|
|
199
|
-
for (
|
|
200
|
-
|
|
188
|
+
for (let attr in r) {
|
|
189
|
+
const rel = (0, relation_1.judgeRelation)(schema, e, attr);
|
|
201
190
|
if (rel === 2) {
|
|
202
191
|
// 边界,如果是toModi的对象,这里的外键确实有可能为空
|
|
203
|
-
(0, assert_1.default)(schema[e].toModi || r.entity !== attr || r.entityId === r[attr].id,
|
|
192
|
+
(0, assert_1.default)(schema[e].toModi || r.entity !== attr || r.entityId === r[attr].id, `对象${e}取数据时,发现entityId与连接的对象的主键不一致,rowId是${r.id},其entityId值为${r.entityId},连接的对象的主键为${r[attr].id}`);
|
|
204
193
|
if (r[attr].id === null) {
|
|
205
194
|
(0, assert_1.default)(schema[e].toModi || r.entity !== attr);
|
|
206
195
|
delete r[attr];
|
|
207
196
|
continue;
|
|
208
197
|
}
|
|
209
|
-
(0, assert_1.default)(r.entity === attr,
|
|
198
|
+
(0, assert_1.default)(r.entity === attr, `对象${e}取数据时,发现entity值与连接的外键对象不一致,rowId是${r.id},其entity值为${r.entity},连接的对象为${attr}`);
|
|
210
199
|
removeNullObjects(r[attr], attr);
|
|
211
200
|
}
|
|
212
201
|
else if (typeof rel === 'string') {
|
|
213
202
|
// 边界,如果是toModi的对象,这里的外键确实有可能为空
|
|
214
|
-
(0, assert_1.default)(schema[e].toModi || r[
|
|
203
|
+
(0, assert_1.default)(schema[e].toModi || r[`${attr}Id`] === r[attr].id, `对象${e}取数据时,发现其外键与连接的对象的主键不一致,rowId是${r.id},其${attr}Id值为${r[`${attr}Id`]},连接的对象的主键为${r[attr].id}`);
|
|
215
204
|
if (r[attr].id === null) {
|
|
216
|
-
(0, assert_1.default)(schema[e].toModi || r[
|
|
205
|
+
(0, assert_1.default)(schema[e].toModi || r[`${attr}Id`] === null);
|
|
217
206
|
delete r[attr];
|
|
218
207
|
continue;
|
|
219
208
|
}
|
|
@@ -222,218 +211,91 @@ var MysqlStore = /** @class */ (function (_super) {
|
|
|
222
211
|
}
|
|
223
212
|
}
|
|
224
213
|
function formSingleRow(r) {
|
|
225
|
-
|
|
226
|
-
for (
|
|
227
|
-
|
|
214
|
+
let result2 = {};
|
|
215
|
+
for (let attr in r) {
|
|
216
|
+
const value = r[attr];
|
|
228
217
|
resolveAttribute(entity, result2, attr, value);
|
|
229
218
|
}
|
|
230
219
|
removeNullObjects(result2, entity);
|
|
231
220
|
return result2;
|
|
232
221
|
}
|
|
233
222
|
if (result instanceof Array) {
|
|
234
|
-
return result.map(
|
|
223
|
+
return result.map(r => formSingleRow(r));
|
|
235
224
|
}
|
|
236
225
|
return formSingleRow(result);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
(0, assert_1.default)(!['select', 'download', 'stat'].includes(action));
|
|
298
|
-
sql = translator.translateUpdate(entity, operation, option);
|
|
299
|
-
return [4 /*yield*/, connector.exec(sql, txn)];
|
|
300
|
-
case 6:
|
|
301
|
-
_c.sent();
|
|
302
|
-
// todo 这里对sorter和indexfrom/count的支持不完整
|
|
303
|
-
if (!(option === null || option === void 0 ? void 0 : option.dontCollect)) {
|
|
304
|
-
context.opRecords.push({
|
|
305
|
-
a: 'u',
|
|
306
|
-
e: entity,
|
|
307
|
-
d: operation.data,
|
|
308
|
-
f: operation.filter,
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
return [2 /*return*/, 1];
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
});
|
|
315
|
-
};
|
|
316
|
-
MysqlStore.prototype.operate = function (entity, operation, context, option) {
|
|
317
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
318
|
-
var action;
|
|
319
|
-
return tslib_1.__generator(this, function (_a) {
|
|
320
|
-
switch (_a.label) {
|
|
321
|
-
case 0:
|
|
322
|
-
action = operation.action;
|
|
323
|
-
(0, assert_1.default)(!['select', 'download', 'stat'].includes(action), '现在不支持使用select operation');
|
|
324
|
-
return [4 /*yield*/, _super.prototype.operateAsync.call(this, entity, operation, context, option)];
|
|
325
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
};
|
|
330
|
-
MysqlStore.prototype.select = function (entity, selection, context, option) {
|
|
331
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
332
|
-
var result;
|
|
333
|
-
return tslib_1.__generator(this, function (_a) {
|
|
334
|
-
switch (_a.label) {
|
|
335
|
-
case 0: return [4 /*yield*/, _super.prototype.selectAsync.call(this, entity, selection, context, option)];
|
|
336
|
-
case 1:
|
|
337
|
-
result = _a.sent();
|
|
338
|
-
return [2 /*return*/, result];
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
});
|
|
342
|
-
};
|
|
343
|
-
MysqlStore.prototype.count = function (entity, selection, context, option) {
|
|
344
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
345
|
-
var sql, result;
|
|
346
|
-
return tslib_1.__generator(this, function (_a) {
|
|
347
|
-
switch (_a.label) {
|
|
348
|
-
case 0:
|
|
349
|
-
sql = this.translator.translateCount(entity, selection, option);
|
|
350
|
-
return [4 /*yield*/, this.connector.exec(sql, context.getCurrentTxnId())];
|
|
351
|
-
case 1:
|
|
352
|
-
result = _a.sent();
|
|
353
|
-
return [2 /*return*/, result[0].cnt];
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
});
|
|
357
|
-
};
|
|
358
|
-
MysqlStore.prototype.begin = function (option) {
|
|
359
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
360
|
-
var txn;
|
|
361
|
-
return tslib_1.__generator(this, function (_a) {
|
|
362
|
-
switch (_a.label) {
|
|
363
|
-
case 0: return [4 /*yield*/, this.connector.startTransaction(option)];
|
|
364
|
-
case 1:
|
|
365
|
-
txn = _a.sent();
|
|
366
|
-
return [2 /*return*/, txn];
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
});
|
|
370
|
-
};
|
|
371
|
-
MysqlStore.prototype.commit = function (txnId) {
|
|
372
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
373
|
-
return tslib_1.__generator(this, function (_a) {
|
|
374
|
-
switch (_a.label) {
|
|
375
|
-
case 0: return [4 /*yield*/, this.connector.commitTransaction(txnId)];
|
|
376
|
-
case 1:
|
|
377
|
-
_a.sent();
|
|
378
|
-
return [2 /*return*/];
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
});
|
|
382
|
-
};
|
|
383
|
-
MysqlStore.prototype.rollback = function (txnId) {
|
|
384
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
385
|
-
return tslib_1.__generator(this, function (_a) {
|
|
386
|
-
switch (_a.label) {
|
|
387
|
-
case 0: return [4 /*yield*/, this.connector.rollbackTransaction(txnId)];
|
|
388
|
-
case 1:
|
|
389
|
-
_a.sent();
|
|
390
|
-
return [2 /*return*/];
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
});
|
|
394
|
-
};
|
|
395
|
-
MysqlStore.prototype.connect = function () {
|
|
226
|
+
}
|
|
227
|
+
async selectAbjointRowAsync(entity, selection, context, option) {
|
|
228
|
+
const sql = this.translator.translateSelect(entity, selection, option);
|
|
229
|
+
const result = await this.connector.exec(sql, context.getCurrentTxnId());
|
|
230
|
+
return this.formResult(entity, result);
|
|
231
|
+
}
|
|
232
|
+
async updateAbjointRowAsync(entity, operation, context, option) {
|
|
233
|
+
const { translator, connector } = this;
|
|
234
|
+
const { action } = operation;
|
|
235
|
+
const txn = context.getCurrentTxnId();
|
|
236
|
+
switch (action) {
|
|
237
|
+
case 'create': {
|
|
238
|
+
const { data } = operation;
|
|
239
|
+
const sql = translator.translateInsert(entity, data instanceof Array ? data : [data]);
|
|
240
|
+
await connector.exec(sql, txn);
|
|
241
|
+
return data instanceof Array ? data.length : 1;
|
|
242
|
+
}
|
|
243
|
+
case 'remove': {
|
|
244
|
+
const sql = translator.translateRemove(entity, operation, option);
|
|
245
|
+
await connector.exec(sql, txn);
|
|
246
|
+
// todo 这里对sorter和indexfrom/count的支持不完整
|
|
247
|
+
return 1;
|
|
248
|
+
}
|
|
249
|
+
default: {
|
|
250
|
+
(0, assert_1.default)(!['select', 'download', 'stat'].includes(action));
|
|
251
|
+
const sql = translator.translateUpdate(entity, operation, option);
|
|
252
|
+
await connector.exec(sql, txn);
|
|
253
|
+
// todo 这里对sorter和indexfrom/count的支持不完整
|
|
254
|
+
return 1;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async operate(entity, operation, context, option) {
|
|
259
|
+
const { action } = operation;
|
|
260
|
+
(0, assert_1.default)(!['select', 'download', 'stat'].includes(action), '现在不支持使用select operation');
|
|
261
|
+
return await super.operateAsync(entity, operation, context, option);
|
|
262
|
+
}
|
|
263
|
+
async select(entity, selection, context, option) {
|
|
264
|
+
const result = await super.selectAsync(entity, selection, context, option);
|
|
265
|
+
return result;
|
|
266
|
+
}
|
|
267
|
+
async countAsync(entity, selection, context, option) {
|
|
268
|
+
const sql = this.translator.translateCount(entity, selection, option);
|
|
269
|
+
const result = await this.connector.exec(sql, context.getCurrentTxnId());
|
|
270
|
+
return result[0].cnt;
|
|
271
|
+
}
|
|
272
|
+
async count(entity, selection, context, option) {
|
|
273
|
+
return this.countAsync(entity, selection, context, option);
|
|
274
|
+
}
|
|
275
|
+
async begin(option) {
|
|
276
|
+
const txn = await this.connector.startTransaction(option);
|
|
277
|
+
return txn;
|
|
278
|
+
}
|
|
279
|
+
async commit(txnId) {
|
|
280
|
+
await this.connector.commitTransaction(txnId);
|
|
281
|
+
}
|
|
282
|
+
async rollback(txnId) {
|
|
283
|
+
await this.connector.rollbackTransaction(txnId);
|
|
284
|
+
}
|
|
285
|
+
connect() {
|
|
396
286
|
this.connector.connect();
|
|
397
|
-
}
|
|
398
|
-
|
|
287
|
+
}
|
|
288
|
+
disconnect() {
|
|
399
289
|
this.connector.disconnect();
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
_i = 0;
|
|
412
|
-
_d.label = 1;
|
|
413
|
-
case 1:
|
|
414
|
-
if (!(_i < _a.length)) return [3 /*break*/, 6];
|
|
415
|
-
entity = _a[_i];
|
|
416
|
-
sqls = this.translator.translateCreateEntity(entity, { replace: dropIfExists });
|
|
417
|
-
_c = 0, sqls_1 = sqls;
|
|
418
|
-
_d.label = 2;
|
|
419
|
-
case 2:
|
|
420
|
-
if (!(_c < sqls_1.length)) return [3 /*break*/, 5];
|
|
421
|
-
sql = sqls_1[_c];
|
|
422
|
-
return [4 /*yield*/, this.connector.exec(sql)];
|
|
423
|
-
case 3:
|
|
424
|
-
_d.sent();
|
|
425
|
-
_d.label = 4;
|
|
426
|
-
case 4:
|
|
427
|
-
_c++;
|
|
428
|
-
return [3 /*break*/, 2];
|
|
429
|
-
case 5:
|
|
430
|
-
_i++;
|
|
431
|
-
return [3 /*break*/, 1];
|
|
432
|
-
case 6: return [2 /*return*/];
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
});
|
|
436
|
-
};
|
|
437
|
-
return MysqlStore;
|
|
438
|
-
}(CascadeStore_1.CascadeStore));
|
|
290
|
+
}
|
|
291
|
+
async initialize(dropIfExists) {
|
|
292
|
+
const schema = this.getSchema();
|
|
293
|
+
for (const entity in schema) {
|
|
294
|
+
const sqls = this.translator.translateCreateEntity(entity, { replace: dropIfExists });
|
|
295
|
+
for (const sql of sqls) {
|
|
296
|
+
await this.connector.exec(sql);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
439
301
|
exports.MysqlStore = MysqlStore;
|
|
@@ -104,5 +104,5 @@ export declare class MySqlTranslator<ED extends EntityDict & BaseEntityDict> ext
|
|
|
104
104
|
protected translateExpression<T extends keyof ED>(entity: T, alias: string, expression: RefOrExpression<keyof ED[T]["OpSchema"]>, refDict: Record<string, [string, keyof ED]>): string;
|
|
105
105
|
protected populateSelectStmt<T extends keyof ED>(projectionText: string, fromText: string, aliasDict: Record<string, string>, filterText: string, sorterText?: string, groupByText?: string, indexFrom?: number, count?: number, option?: MySqlSelectOption): string;
|
|
106
106
|
protected populateUpdateStmt(updateText: string, fromText: string, aliasDict: Record<string, string>, filterText: string, sorterText?: string, indexFrom?: number, count?: number, option?: MysqlOperateOption): string;
|
|
107
|
-
protected populateRemoveStmt(
|
|
107
|
+
protected populateRemoveStmt(updateText: string, fromText: string, aliasDict: Record<string, string>, filterText: string, sorterText?: string, indexFrom?: number, count?: number, option?: MysqlOperateOption): string;
|
|
108
108
|
}
|