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