adding filter to SELEC

This commit is contained in:
Simon Petit 2024-12-09 20:57:43 +01:00
parent 2e00eb4e86
commit dc1ea6642f

View File

@ -1,6 +1,6 @@
type query = Query of select_stmt
and select_stmt =
| Select of column list * table list
| Select of column list * table list * filter option
and column =
| Asterisk
| Column of string
@ -27,6 +27,7 @@ and predicate =
| In of string list
| NotIn of string list
| Like of string
| NotLike of string
and operator =
| Equals
| NotEquals
@ -35,19 +36,17 @@ and operator =
| LessEquals
| GreaterEquals
and filter =
| Filter of string
| Filter of condition
and search_condition =
| Search of string
let rec pp_query fmt ast =
match ast with
| Query(s) -> Format.fprintf fmt "%s" (pp_select s)
and pp_select s =
match s with
| Select(cols, _) -> pp_columns cols
| Select(cols, _, _) -> pp_columns cols
and pp_columns cols =
match cols with
@ -81,4 +80,3 @@ and pp_join_type j =
| Union -> "union"
| Natural -> "natural"