File tree Expand file tree Collapse file tree 3 files changed +23
-5
lines changed
Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -833,7 +833,7 @@ export type on_clause = or_and_where_expr;
833833
834834
835835
836- export type where_clause = binary_expr ;
836+ export type where_clause = or_and_where_expr ;
837837
838838
839839
@@ -1115,6 +1115,8 @@ export type backticks_quoted_ident = string;
11151115
11161116export type ident_without_kw = ident_name | quoted_ident ;
11171117
1118+ export type column_without_kw = column_name | quoted_ident ;
1119+
11181120
11191121
11201122export type column = string | quoted_ident ;
Original file line number Diff line number Diff line change @@ -3126,7 +3126,7 @@ on_clause
31263126 = KW_ON __ e :or_and_where_expr { /* => or_and_where_expr */ return e; }
31273127
31283128where_clause
3129- = KW_WHERE __ e :or_and_where_expr { /* => binary_expr */ return e; }
3129+ = KW_WHERE __ e :or_and_where_expr { /* => or_and_where_expr */ return e; }
31303130
31313131group_by_clause
31323132 = KW_GROUP __ KW_BY __ e :expr_list { /* => expr_list['value'] */ return e .value ; }
Original file line number Diff line number Diff line change @@ -68,14 +68,30 @@ export interface Column {
6868 as : string ;
6969}
7070
71+ type Param = { type : 'param' ; value : string } ;
72+
73+ export type Expr =
74+ | {
75+ type : 'binary_expr' ;
76+ operator : 'AND' | 'OR' ;
77+ left : Expr ;
78+ right : Expr ;
79+ }
80+ | {
81+ type : 'binary_expr' ;
82+ operator : string ;
83+ left : ColumnRef | Param ;
84+ right : ColumnRef | Param ;
85+ } ;
86+
7187export interface Select {
7288 with : With | null ;
7389 type : "select" ;
7490 options : any [ ] | null ;
7591 distinct : "DISTINCT" | null ;
7692 columns : any [ ] | Column [ ] ;
7793 from : Array < From | Dual | any > | null ;
78- where : any ;
94+ where : Expr ;
7995 groupby : ColumnRef [ ] | null ;
8096 having : any [ ] | null ;
8197 orderby : OrderBy [ ] | null ;
@@ -97,13 +113,13 @@ export interface Update {
97113 db : string | null ;
98114 table : Array < From | Dual > | null ;
99115 set : SetList [ ] ;
100- where : any ;
116+ where : Expr ;
101117}
102118export interface Delete {
103119 type : "delete" ;
104120 table : any ;
105121 from : Array < From | Dual > ;
106- where : any ;
122+ where : Expr ;
107123}
108124
109125export interface Alter {
You can’t perform that action at this time.
0 commit comments