1
Fork 0

add support for between

This commit is contained in:
Jake Wheat 2013-12-13 21:13:36 +02:00
parent 386d835cf8
commit 955658c41f
3 changed files with 54 additions and 9 deletions
Language/SQL/SimpleSQL

View file

@ -29,6 +29,15 @@ back into SQL source text. It attempts to format the output nicely.
> scalarExpr (Star2 q) = text q <> text "." <> text "*"
> scalarExpr (App f es) = text f <> parens (commaSep (map scalarExpr es))
special cases
> scalarExpr (Op nm [a,b,c]) | nm `elem` ["between", "not between"] =
> sep [scalarExpr a
> ,text nm <+> scalarExpr b
> ,text "and" <+> scalarExpr c]
> scalarExpr (Op f [e]) = text f <+> scalarExpr e
> scalarExpr (Op f [e0,e1]) =
> sep [scalarExpr e0, text f, scalarExpr e1]