add support for in list, and fix code for in query expr
This commit is contained in:
parent
00269617b3
commit
386d835cf8
4 changed files with 57 additions and 26 deletions
Language/SQL/SimpleSQL
|
@ -59,12 +59,20 @@ back into SQL source text. It attempts to format the output nicely.
|
|||
> (case ty of
|
||||
> SqSq -> empty
|
||||
> SqExists -> text "exists"
|
||||
> SqIn -> text "in"
|
||||
> SqAll -> text "all"
|
||||
> SqSome -> text "some"
|
||||
> SqAny -> text "any"
|
||||
> ) <+> parens (queryExpr qe)
|
||||
|
||||
> scalarExpr (In b se x) =
|
||||
> sep [scalarExpr se
|
||||
> ,if b then empty else text "not"
|
||||
> ,text "in"
|
||||
> ,parens (nest 4 $
|
||||
> case x of
|
||||
> InList es -> commaSep $ map scalarExpr es
|
||||
> InQueryExpr qe -> queryExpr qe)]
|
||||
|
||||
= query expressions
|
||||
|
||||
> queryExpr :: QueryExpr -> Doc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue