From 2f60cc51a304a5cfa15189c6ccb8628f1d4ba9ec Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Fri, 13 Dec 2024 16:24:20 +0100 Subject: [PATCH] type change --- src/types/dynamicQueries.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/types/dynamicQueries.ts b/src/types/dynamicQueries.ts index 841d8aa..7a72342 100644 --- a/src/types/dynamicQueries.ts +++ b/src/types/dynamicQueries.ts @@ -3,16 +3,18 @@ export interface DynamicQueryStructure { table: string; where?: Array; join?: Array; - orderBy?: { [key: string]: "ASC" | "DESC" }; + orderBy?: Array; } export type ConditionStructure = ( | { + structureType: "condition"; column: string; operation: WhereOperation; value: ConditionValue; } | { + structureType: "nested"; invert?: boolean; condition: Array; } @@ -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";