add support for between
This commit is contained in:
parent
386d835cf8
commit
955658c41f
3 changed files with 54 additions and 9 deletions
Language/SQL/SimpleSQL
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue