add with expressions, all tpch appear to parse correct, some of the later ones pretty print badly though
This commit is contained in:
parent
15c83555ff
commit
931272d1db
5 changed files with 60 additions and 28 deletions
Language/SQL/SimpleSQL
|
@ -143,6 +143,12 @@ back into SQL source text. It attempts to format the output nicely.
|
|||
> Corresponding -> text "corresponding"
|
||||
> Respectively -> empty
|
||||
> ,queryExpr q2]
|
||||
> queryExpr (With withs qe) =
|
||||
> text "with"
|
||||
> <+> vcat [nest 4
|
||||
> (vcat $ punctuate comma $ flip map withs $ \(n,q) ->
|
||||
> text n <+> text "as" <+> parens (queryExpr q))
|
||||
> ,queryExpr qe]
|
||||
|
||||
> selectList :: [(Maybe String, ScalarExpr)] -> Doc
|
||||
> selectList is = commaSep $ map si is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue