ocaml_sql_parser/lib/ast.ml

40 lines
801 B
Standard ML

type query = Query of select_stmt
and select_stmt =
| Select of column list * table list
and column =
| Asterisk
| Column of string
and table =
| Table of string
| Join of table * join_type * table * condition option
and join_type =
| Inner
| Left
| Right
| Full
| Cross
| Union
| Natural
and condition =
| Condition of string * predicate
| And of condition * condition
| Or of condition * condition
| Not of condition
and predicate =
| Comparison of operator * string
| Between of string * string
| NotBetween of string * string
| In of string list
| NotIn of string list
and operator =
| Equals
| NotEquals
| LessThan
| GreaterThan
| LessEquals
| GreaterEquals
and filter =
| Filter of string
and search_condition =
| Search of string