oak-db 3.3.6 → 3.3.7

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.
@@ -927,14 +927,19 @@ class SqlTranslator {
927
927
  // const sorterText = sorter && sorter.length > 0 ? this.translateSorter(entity, sorter, aliasDict) : undefined;
928
928
  const { attributes } = this.schema[entity];
929
929
  let updateText = '';
930
- for (const attr in data) {
931
- if (updateText) {
932
- updateText += ',';
930
+ if (option?.deletePhysically) {
931
+ (0, assert_1.default)((0, lodash_1.difference)(Object.keys(data), [types_1.UpdateAtAttribute, types_1.DeleteAtAttribute]).length === 0);
932
+ }
933
+ else {
934
+ for (const attr in data) {
935
+ if (updateText) {
936
+ updateText += ',';
937
+ }
938
+ // delete只支持对volatile trigger的metadata域赋值
939
+ (0, assert_1.default)([types_1.TriggerDataAttribute, types_1.TriggerUuidAttribute, types_1.DeleteAtAttribute, types_1.UpdateAtAttribute].includes(attr));
940
+ const value = this.translateAttrValue(attributes[attr].type, data[attr]);
941
+ updateText += `\`${alias}\`.\`${attr}\` = ${value}`;
933
942
  }
934
- // delete只支持对volatile trigger的metadata域赋值
935
- (0, assert_1.default)([types_1.TriggerDataAttribute, types_1.TriggerUuidAttribute, types_1.DeleteAtAttribute, types_1.UpdateAtAttribute].includes(attr));
936
- const value = this.translateAttrValue(attributes[attr].type, data[attr]);
937
- updateText += `\`${alias}\`.\`${attr}\` = ${value}`;
938
943
  }
939
944
  return this.populateRemoveStmt(updateText, fromText, aliasDict, filterText, /* sorterText */ undefined, indexFrom, count, option);
940
945
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oak-db",
3
- "version": "3.3.6",
3
+ "version": "3.3.7",
4
4
  "description": "oak-db",
5
5
  "main": "lib/index",
6
6
  "author": {
@@ -18,7 +18,7 @@
18
18
  "lodash": "^4.17.21",
19
19
  "mysql": "^2.18.1",
20
20
  "mysql2": "^2.3.3",
21
- "oak-domain": "^5.1.20",
21
+ "oak-domain": "^5.1.24",
22
22
  "uuid": "^8.3.2"
23
23
  },
24
24
  "license": "ISC",