type change
This commit is contained in:
parent
0508e40494
commit
2f60cc51a3
1 changed files with 10 additions and 1 deletions
|
@ -3,16 +3,18 @@ export interface DynamicQueryStructure {
|
||||||
table: string;
|
table: string;
|
||||||
where?: Array<ConditionStructure>;
|
where?: Array<ConditionStructure>;
|
||||||
join?: Array<DynamicQueryStructure & { foreignColumn: string }>;
|
join?: Array<DynamicQueryStructure & { foreignColumn: string }>;
|
||||||
orderBy?: { [key: string]: "ASC" | "DESC" };
|
orderBy?: Array<OrderByStructure>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ConditionStructure = (
|
export type ConditionStructure = (
|
||||||
| {
|
| {
|
||||||
|
structureType: "condition";
|
||||||
column: string;
|
column: string;
|
||||||
operation: WhereOperation;
|
operation: WhereOperation;
|
||||||
value: ConditionValue;
|
value: ConditionValue;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
|
structureType: "nested";
|
||||||
invert?: boolean;
|
invert?: boolean;
|
||||||
condition: Array<ConditionStructure>;
|
condition: Array<ConditionStructure>;
|
||||||
}
|
}
|
||||||
|
@ -42,3 +44,10 @@ export type WhereOperation =
|
||||||
| "between" // Is between
|
| "between" // Is between
|
||||||
| "startsWith" // Starts with
|
| "startsWith" // Starts with
|
||||||
| "endsWith"; // Ends with
|
| "endsWith"; // Ends with
|
||||||
|
|
||||||
|
export type OrderByStructure = {
|
||||||
|
column: string;
|
||||||
|
order: OrderByType;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type OrderByType = "ASC" | "DESC";
|
||||||
|
|
Loading…
Reference in a new issue