type change

This commit is contained in:
Julian Krauser 2024-12-13 16:24:20 +01:00
parent 0508e40494
commit 2f60cc51a3

View file

@ -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";