重定义在缓存中取数据时ignoreAttrMiss的配置
This commit is contained in:
parent
875640f991
commit
02b8f7ca29
|
|
@ -332,7 +332,7 @@ class CascadeStore extends RowStore_1.RowStore {
|
|||
(0, assert_1.default)(subRows.length <= entityIds.length);
|
||||
if (subRows.length < entityIds.length && !toModi) {
|
||||
// 后台不允许数据不一致
|
||||
if (context instanceof AsyncRowStore_1.AsyncContext || !option.ignoreForeignKeyMiss) {
|
||||
if (context instanceof AsyncRowStore_1.AsyncContext || !option.ignoreAttrMiss) {
|
||||
throw new types_1.OakRowUnexistedException([{
|
||||
entity: attr,
|
||||
selection: {
|
||||
|
|
@ -415,7 +415,7 @@ class CascadeStore extends RowStore_1.RowStore {
|
|||
const dealWithSubRows = (subRows) => {
|
||||
(0, assert_1.default)(subRows.length <= ids.length);
|
||||
if (subRows.length < ids.length && !toModi) {
|
||||
if (context instanceof AsyncRowStore_1.AsyncContext || !option.ignoreForeignKeyMiss) {
|
||||
if (context instanceof AsyncRowStore_1.AsyncContext || !option.ignoreAttrMiss) {
|
||||
throw new types_1.OakRowUnexistedException([{
|
||||
entity: relation,
|
||||
selection: {
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ function createRemoveCheckers(schema) {
|
|||
filter,
|
||||
indexFrom: 0,
|
||||
count: 1
|
||||
}, { dontCollect: true });
|
||||
}, { dontCollect: true, ...option });
|
||||
if (result instanceof Promise) {
|
||||
promises.push(result.then(([row]) => {
|
||||
if (row) {
|
||||
|
|
@ -314,7 +314,7 @@ function createRemoveCheckers(schema) {
|
|||
filter,
|
||||
indexFrom: 0,
|
||||
count: 1
|
||||
}, { dontCollect: true });
|
||||
}, { dontCollect: true, ...option });
|
||||
if (result instanceof Promise) {
|
||||
promises.push(result.then(([row]) => {
|
||||
if (row) {
|
||||
|
|
|
|||
|
|
@ -1456,7 +1456,7 @@ function checkDeduceFilters(dfc, context) {
|
|||
const ele2 = ele;
|
||||
return context.count(ele2.entity, {
|
||||
filter: ele2.filter
|
||||
}, { ignoreForeignKeyMiss: true });
|
||||
}, { ignoreAttrMiss: true });
|
||||
}
|
||||
const ele2 = ele;
|
||||
return checkDeduceFilters(ele2, context);
|
||||
|
|
@ -1485,7 +1485,7 @@ function checkDeduceFilters(dfc, context) {
|
|||
const ele2 = ele;
|
||||
return context.count(ele2.entity, {
|
||||
filter: ele2.filter
|
||||
}, {});
|
||||
}, { ignoreAttrMiss: true });
|
||||
}
|
||||
const ele2 = ele;
|
||||
return checkDeduceFilters(ele2, context);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export declare type SelectOption = {
|
|||
obscure?: boolean;
|
||||
forUpdate?: true;
|
||||
includedDeleted?: true;
|
||||
ignoreForeignKeyMiss?: true;
|
||||
ignoreAttrMiss?: true;
|
||||
dummy?: 1;
|
||||
};
|
||||
export declare type OperateOption = {
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ export abstract class CascadeStore<ED extends EntityDict & BaseEntityDict> exten
|
|||
assert(subRows.length <= entityIds.length);
|
||||
if (subRows.length < entityIds.length && !toModi) {
|
||||
// 后台不允许数据不一致
|
||||
if (context instanceof AsyncContext || !option.ignoreForeignKeyMiss) {
|
||||
if (context instanceof AsyncContext || !option.ignoreAttrMiss) {
|
||||
throw new OakRowUnexistedException([{
|
||||
entity: attr,
|
||||
selection: {
|
||||
|
|
@ -554,7 +554,7 @@ export abstract class CascadeStore<ED extends EntityDict & BaseEntityDict> exten
|
|||
const dealWithSubRows = (subRows: Partial<ED[keyof ED]['Schema']>[]) => {
|
||||
assert(subRows.length <= ids.length);
|
||||
if (subRows.length < ids.length && !toModi) {
|
||||
if (context instanceof AsyncContext || !option.ignoreForeignKeyMiss) {
|
||||
if (context instanceof AsyncContext || !option.ignoreAttrMiss) {
|
||||
throw new OakRowUnexistedException([{
|
||||
entity: relation,
|
||||
selection: {
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ export function createRemoveCheckers<ED extends EntityDict & BaseEntityDict, Cxt
|
|||
filter,
|
||||
indexFrom: 0,
|
||||
count: 1
|
||||
}, { dontCollect: true });
|
||||
}, { dontCollect: true, ...option });
|
||||
if (result instanceof Promise) {
|
||||
promises.push(
|
||||
result.then(
|
||||
|
|
@ -348,7 +348,7 @@ export function createRemoveCheckers<ED extends EntityDict & BaseEntityDict, Cxt
|
|||
filter,
|
||||
indexFrom: 0,
|
||||
count: 1
|
||||
}, { dontCollect: true });
|
||||
}, { dontCollect: true, ...option });
|
||||
if (result instanceof Promise) {
|
||||
promises.push(
|
||||
result.then(
|
||||
|
|
|
|||
|
|
@ -1653,7 +1653,7 @@ export function checkDeduceFilters<ED extends EntityDict & BaseEntityDict, Cxt e
|
|||
const ele2 = ele as DeducedFilter<ED, keyof ED>;
|
||||
return context.count(ele2.entity, {
|
||||
filter: ele2.filter
|
||||
}, { ignoreForeignKeyMiss: true });
|
||||
}, { ignoreAttrMiss: true });
|
||||
}
|
||||
const ele2 = ele as DeducedFilterCombination<ED>;
|
||||
return checkDeduceFilters(ele2, context);
|
||||
|
|
@ -1688,7 +1688,7 @@ export function checkDeduceFilters<ED extends EntityDict & BaseEntityDict, Cxt e
|
|||
const ele2 = ele as DeducedFilter<ED, keyof ED>;
|
||||
return context.count(ele2.entity, {
|
||||
filter: ele2.filter
|
||||
}, {});
|
||||
}, { ignoreAttrMiss: true });
|
||||
}
|
||||
const ele2 = ele as DeducedFilterCombination<ED>;
|
||||
return checkDeduceFilters(ele2, context);
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ type FilterPart<A extends string, F extends Object | undefined> = {
|
|||
export type SelectOption = {
|
||||
dontCollect?: boolean;
|
||||
blockTrigger?: true;
|
||||
obscure?: boolean; // 如果为置为true,则在filter过程中因数据不完整而不能判断为真的时候都假设为真(前端缓存专用)
|
||||
obscure?: boolean; // 如果为置为true,则在filter过程中因数据不完整而不能判断为真的时候都假设为真(前端缓存专用)
|
||||
forUpdate?: true;
|
||||
includedDeleted?: true; // 是否包含删除行的信息
|
||||
ignoreForeignKeyMiss?: true; // 作为cache时是否允许外键缺失
|
||||
dummy?: 1; // 无用,为了继承Option通过编译
|
||||
includedDeleted?: true; // 是否包含删除行的信息
|
||||
ignoreAttrMiss?: true; // 作为cache时是否允许属性缺失
|
||||
dummy?: 1; // 无用,为了继承Option通过编译
|
||||
};
|
||||
|
||||
export type OperateOption = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue