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;
|
||||
where?: Array<ConditionStructure>;
|
||||
join?: Array<DynamicQueryStructure & { foreignColumn: string }>;
|
||||
orderBy?: { [key: string]: "ASC" | "DESC" };
|
||||
orderBy?: Array<OrderByStructure>;
|
||||
}
|
||||
|
||||
export type ConditionStructure = (
|
||||
| {
|
||||
structureType: "condition";
|
||||
column: string;
|
||||
operation: WhereOperation;
|
||||
value: ConditionValue;
|
||||
}
|
||||
| {
|
||||
structureType: "nested";
|
||||
invert?: boolean;
|
||||
condition: Array<ConditionStructure>;
|
||||
}
|
||||
|
@ -42,3 +44,10 @@ export type WhereOperation =
|
|||
| "between" // Is between
|
||||
| "startsWith" // Starts with
|
||||
| "endsWith"; // Ends with
|
||||
|
||||
export type OrderByStructure = {
|
||||
column: string;
|
||||
order: OrderByType;
|
||||
};
|
||||
|
||||
export type OrderByType = "ASC" | "DESC";
|
||||
|
|
Loading…
Reference in a new issue