去掉了对opRecords的收集
This commit is contained in:
parent
a202b26c50
commit
49952e6b59
|
|
@ -238,26 +238,12 @@ class MysqlStore extends CascadeStore_1.CascadeStore {
|
|||
const { data } = operation;
|
||||
const sql = translator.translateInsert(entity, data instanceof Array ? data : [data]);
|
||||
await connector.exec(sql, txn);
|
||||
if (!option?.dontCollect) {
|
||||
context.opRecords.push({
|
||||
a: 'c',
|
||||
d: data,
|
||||
e: entity,
|
||||
});
|
||||
}
|
||||
return data instanceof Array ? data.length : 1;
|
||||
}
|
||||
case 'remove': {
|
||||
const sql = translator.translateRemove(entity, operation, option);
|
||||
await connector.exec(sql, txn);
|
||||
// todo 这里对sorter和indexfrom/count的支持不完整
|
||||
if (!option?.dontCollect) {
|
||||
context.opRecords.push({
|
||||
a: 'r',
|
||||
e: entity,
|
||||
f: operation.filter,
|
||||
});
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
default: {
|
||||
|
|
@ -265,14 +251,6 @@ class MysqlStore extends CascadeStore_1.CascadeStore {
|
|||
const sql = translator.translateUpdate(entity, operation, option);
|
||||
await connector.exec(sql, txn);
|
||||
// todo 这里对sorter和indexfrom/count的支持不完整
|
||||
if (!option?.dontCollect) {
|
||||
context.opRecords.push({
|
||||
a: 'u',
|
||||
e: entity,
|
||||
d: operation.data,
|
||||
f: operation.filter,
|
||||
});
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,43 +266,19 @@ export class MysqlStore<ED extends EntityDict & BaseEntityDict, Cxt extends Asyn
|
|||
const { data } = operation as ED[T]['Create'];
|
||||
const sql = translator.translateInsert(entity, data instanceof Array ? data : [data]);
|
||||
await connector.exec(sql, txn);
|
||||
if (!option?.dontCollect) {
|
||||
context.opRecords.push({
|
||||
a: 'c',
|
||||
d: data as any,
|
||||
e: entity,
|
||||
});
|
||||
}
|
||||
return data instanceof Array ? data.length : 1;
|
||||
}
|
||||
case 'remove': {
|
||||
const sql = translator.translateRemove(entity, operation as ED[T]['Remove'], option);
|
||||
await connector.exec(sql, txn);
|
||||
|
||||
// todo 这里对sorter和indexfrom/count的支持不完整
|
||||
if (!option?.dontCollect) {
|
||||
context.opRecords.push({
|
||||
a: 'r',
|
||||
e: entity,
|
||||
f: (operation as ED[T]['Remove']).filter,
|
||||
});
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
default: {
|
||||
assert(!['select', 'download', 'stat'].includes(action));
|
||||
const sql = translator.translateUpdate(entity, operation as ED[T]['Update'], option);
|
||||
await connector.exec(sql, txn);
|
||||
|
||||
// todo 这里对sorter和indexfrom/count的支持不完整
|
||||
if (!option?.dontCollect) {
|
||||
context.opRecords.push({
|
||||
a: 'u',
|
||||
e: entity,
|
||||
d: (operation as ED[T]['Update']).data,
|
||||
f: (operation as ED[T]['Update']).filter,
|
||||
});
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue