enabling in_predicate
This commit is contained in:
parent
7e8c637941
commit
0206e0be00
10
lib/ast.ml
10
lib/ast.ml
@ -28,8 +28,8 @@ and predicate =
|
|||||||
| Comparison of operator * predicand
|
| Comparison of operator * predicand
|
||||||
| Between of predicand * predicand
|
| Between of predicand * predicand
|
||||||
| NotBetween of predicand * predicand
|
| NotBetween of predicand * predicand
|
||||||
| In of string list
|
| In of predicand list
|
||||||
| NotIn of string list
|
| NotIn of predicand list
|
||||||
| Like of string
|
| Like of string
|
||||||
| NotLike of string
|
| NotLike of string
|
||||||
and operator =
|
and operator =
|
||||||
@ -66,7 +66,7 @@ let rec pp_query fmt ast =
|
|||||||
|
|
||||||
and pp_select s =
|
and pp_select s =
|
||||||
match s with
|
match s with
|
||||||
| Select(cols, _, _) -> pp_columns cols
|
| Select(cols, _, _) -> String.cat "SELECT " (pp_columns cols)
|
||||||
|
|
||||||
and pp_columns cols =
|
and pp_columns cols =
|
||||||
match cols with
|
match cols with
|
||||||
@ -77,8 +77,10 @@ and pp_columns cols =
|
|||||||
and pp_column col =
|
and pp_column col =
|
||||||
match col with
|
match col with
|
||||||
| Column(Ref(name),_) -> name
|
| Column(Ref(name),_) -> name
|
||||||
|
| Column(StringLiteral(name),_) -> "'"^name^"'"
|
||||||
|
| Column(DateLiteral(name),_) -> "'"^name^"'"
|
||||||
| Asterisk -> "*"
|
| Asterisk -> "*"
|
||||||
| _ -> failwith "not supported"
|
| _ -> failwith "Pretty parsing of Column not supported"
|
||||||
|
|
||||||
and pp_tables tables =
|
and pp_tables tables =
|
||||||
match tables with
|
match tables with
|
||||||
|
@ -509,8 +509,8 @@ as_clause :
|
|||||||
|
|
||||||
predicate :
|
predicate :
|
||||||
| comparison_predicate { $1 }
|
| comparison_predicate { $1 }
|
||||||
|
| in_predicate { $1 }
|
||||||
(* | between_predicate { $1 } *)
|
(* | between_predicate { $1 } *)
|
||||||
(* | in_predicate { $1 } *)
|
|
||||||
(* | like_predicate { $1 }*)
|
(* | like_predicate { $1 }*)
|
||||||
|
|
||||||
(*****************)
|
(*****************)
|
||||||
|
Loading…
Reference in New Issue
Block a user