vona-module-a-orm 5.1.41 → 5.1.43
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/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/bean.model/bean.model_cache.d.ts.map +1 -1
- package/dist/lib/dto/dtoCreate.d.ts +1 -1
- package/dist/lib/dto/dtoCreate.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/common/buildWhere.ts +7 -2
- package/src/lib/bean.model/bean.model_cache.ts +9 -2
- package/src/lib/dto/dtoCreate.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
|
-
import { BeanInfo, BeanBase, BeanAopMethodBase, deepExtend, appResource, assertIsolatedTestDatabaseClient, assertTestClaimDatabaseClient, beanFullNameFromOnionName, cast, useApp, $makeLocaleMagic, Virtual, registerTestClaimDatabaseCreation, BeanSimple, combineConfigDefault, BeanScopeBase, createBeanDecorator, PickClassInner, $Class, registerMappedClassMetadataKey, appMetadata, disposeInstance } from 'vona';
|
|
2
|
+
import { BeanInfo, BeanBase, BeanAopMethodBase, deepExtend, appResource, assertIsolatedTestDatabaseClient, assertTestClaimDatabaseClient, beanFullNameFromOnionName, cast, useApp, $makeLocaleMagic, Virtual, registerTestClaimDatabaseCreation, BeanSimple, combineConfigDefault, BeanScopeBase, createBeanDecorator, PickClassInner, $Class, registerMappedClassMetadataKey, appMetadata, disposeInstance, getTestAsyncCompletion } from 'vona';
|
|
3
3
|
import { __decorate, __metadata } from 'tslib';
|
|
4
4
|
import { Schedule } from 'vona-module-a-schedule';
|
|
5
5
|
import { AopMethod } from 'vona-module-a-aspect';
|
|
@@ -1085,10 +1085,10 @@ function _buildWhereColumnOpNormal(having, db, builder, column, value, op) {
|
|
|
1085
1085
|
} else if (op === Op.notEq) {
|
|
1086
1086
|
builder[having ? 'having' : 'where'](column, '<>', value);
|
|
1087
1087
|
} else if (op === Op.eqI) {
|
|
1088
|
-
builder[_getOpILikeReal(having, db)](column, value);
|
|
1088
|
+
builder[_getOpILikeReal(having, db)](column, _literalILikeValue(db, value));
|
|
1089
1089
|
} else if (op === Op.notEqI) {
|
|
1090
1090
|
builder[having ? 'havingNot' : 'whereNot'](builder => {
|
|
1091
|
-
builder[_getOpILikeReal(
|
|
1091
|
+
builder[_getOpILikeReal(false, db)](column, _literalILikeValue(db, value));
|
|
1092
1092
|
});
|
|
1093
1093
|
} else if (op === Op.gt) {
|
|
1094
1094
|
builder[having ? 'having' : 'where'](column, '>', value);
|
|
@@ -1126,6 +1126,10 @@ function _buildWhereColumnOpNormal(having, db, builder, column, value, op) {
|
|
|
1126
1126
|
builder[having ? 'having' : 'where'](column, '=', db.connection.ref(value));
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
+
function _literalILikeValue(db, value) {
|
|
1130
|
+
if (typeof value !== 'string') return value;
|
|
1131
|
+
return db.connection.raw("? escape '!'", [value.replace(/[!%_]/g, '!$&')]);
|
|
1132
|
+
}
|
|
1129
1133
|
function _getOpLikeReal(having, db) {
|
|
1130
1134
|
return db.dialect.capabilities.like ? having ? 'havingLike' : 'whereLike' : having ? 'havingILike' : 'whereILike';
|
|
1131
1135
|
}
|
|
@@ -4721,8 +4725,13 @@ class BeanModelCache extends BeanModelCrud {
|
|
|
4721
4725
|
_shardingCacheDoubleDelete(jobData) {
|
|
4722
4726
|
const doubleDelete = this.scopeOrm.config.sharding.cache.doubleDelete;
|
|
4723
4727
|
if (!doubleDelete) return;
|
|
4728
|
+
const owner = getTestAsyncCompletion(this.app);
|
|
4724
4729
|
this.db.commit(() => {
|
|
4725
|
-
|
|
4730
|
+
if (owner) {
|
|
4731
|
+
void owner.track('ORM double-delete', () => this.scopeOrm.queue.doubleDelete.pushAsync(jobData)).catch(() => {});
|
|
4732
|
+
} else {
|
|
4733
|
+
this.scopeOrm.queue.doubleDelete.push(jobData);
|
|
4734
|
+
}
|
|
4726
4735
|
});
|
|
4727
4736
|
}
|
|
4728
4737
|
async _cacheQueryClearModelsClear() {
|