adding filter to SELEC
This commit is contained in:
parent
2e00eb4e86
commit
dc1ea6642f
10
lib/ast.ml
10
lib/ast.ml
@ -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"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user