From 603649efa4b523febfa95a3a2ab1c7df91fbac2d Mon Sep 17 00:00:00 2001 From: darzIdo Date: Thu, 14 Mar 2024 13:52:35 +0200 Subject: [PATCH 1/4] chore: new function name types --- types.d.ts | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/types.d.ts b/types.d.ts index ef3bb88e..8040b32e 100644 --- a/types.d.ts +++ b/types.d.ts @@ -39,10 +39,16 @@ export interface OrderBy { type: "ASC" | "DESC"; expr: any; } + +export interface ValueExpr { + type: "backticks_quote_string" | "string" | "regex_string" | "hex_string" | "full_hex_string" | "natural_string" | "bit_string" | "double_quote_string" | "single_quote_string" | "boolean" | "bool" | "null" | "star" | "param" | "origin" | "date" | "datetime" | "time" | "timestamp" | "var_string"; + value: T; +} + export interface ColumnRef { type: "column_ref"; table: string | null; - column: string; + column: string | { expr: ValueExpr }; } export interface SetList { column: string; @@ -65,7 +71,7 @@ export interface AggrFunc { } export interface Function { type: "function"; - name: string; + name: { name: ValueExpr[] }; args: ExprList; suffix?: any; } @@ -81,17 +87,17 @@ type Value = { type: string; value: any }; export type Expr = | { - type: "binary_expr"; - operator: "AND" | "OR"; - left: Expr; - right: Expr; - } + type: "binary_expr"; + operator: "AND" | "OR"; + left: Expr; + right: Expr; + } | { - type: "binary_expr"; - operator: string; - left: ColumnRef | Param | Value; - right: ColumnRef | Param | Value; - }; + type: "binary_expr"; + operator: string; + left: ColumnRef | Param | Value; + right: ColumnRef | Param | Value; + }; export type ExprList = { type: "expr_list"; From 017b552cfd19f43bd42e100f72a326864be7207c Mon Sep 17 00:00:00 2001 From: darzIdo Date: Fri, 15 Mar 2024 05:52:07 +0200 Subject: [PATCH 2/4] fix: add optional schema to function name --- types.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types.d.ts b/types.d.ts index 8040b32e..7cd84bf0 100644 --- a/types.d.ts +++ b/types.d.ts @@ -69,9 +69,11 @@ export interface AggrFunc { name: string; args: ColumnRef | AggrFunc | Star | null; } + +export type FunctionName = ValueExpr & { schema?: string } export interface Function { type: "function"; - name: { name: ValueExpr[] }; + name: { name: FunctionName[] }; args: ExprList; suffix?: any; } From acfe2a7b04af923ed1c060a677977d7413707021 Mon Sep 17 00:00:00 2001 From: darzIdo Date: Fri, 15 Mar 2024 05:54:54 +0200 Subject: [PATCH 3/4] fix: optional schema fix --- types.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types.d.ts b/types.d.ts index 7cd84bf0..ed6a2355 100644 --- a/types.d.ts +++ b/types.d.ts @@ -70,7 +70,7 @@ export interface AggrFunc { args: ColumnRef | AggrFunc | Star | null; } -export type FunctionName = ValueExpr & { schema?: string } +export type FunctionName = { schema?: string, name: ValueExpr[] } export interface Function { type: "function"; name: { name: FunctionName[] }; From 2d3e8a08707ef035473390ea5b8f94dbc946c0ad Mon Sep 17 00:00:00 2001 From: darzIdo Date: Fri, 15 Mar 2024 05:57:01 +0200 Subject: [PATCH 4/4] fix: function name fix --- types.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types.d.ts b/types.d.ts index ed6a2355..34fc844a 100644 --- a/types.d.ts +++ b/types.d.ts @@ -73,7 +73,7 @@ export interface AggrFunc { export type FunctionName = { schema?: string, name: ValueExpr[] } export interface Function { type: "function"; - name: { name: FunctionName[] }; + name: FunctionName; args: ExprList; suffix?: any; }