fix extra 'as' when printing ctes
This commit is contained in:
parent
ce0eeb392a
commit
9f4a457a4d
|
@ -1482,8 +1482,11 @@ allows offset and fetch in either order
|
|||
> With <$> option False (True <$ keyword_ "recursive")
|
||||
> <*> commaSep1 withQuery <*> queryExpr
|
||||
> where
|
||||
> withQuery = (,) <$> (fromAlias <* keyword_ "as")
|
||||
> withQuery = (,) <$> (withAlias <* keyword_ "as")
|
||||
> <*> parens queryExpr
|
||||
> withAlias = Alias <$> name <*> columnAliases
|
||||
> columnAliases = optionMaybe $ parens $ commaSep1 name
|
||||
|
||||
|
||||
== query expression
|
||||
|
||||
|
|
|
@ -360,8 +360,13 @@ which have been changed to try to improve the layout of the output.
|
|||
> text "with" <+> (if rc then text "recursive" else empty)
|
||||
> <+> vcat [nest 5
|
||||
> (vcat $ punctuate comma $ flip map withs $ \(n,q) ->
|
||||
> alias n <+> text "as" <+> parens (queryExpr d q))
|
||||
> withAlias n <+> text "as" <+> parens (queryExpr d q))
|
||||
> ,queryExpr d qe]
|
||||
> where
|
||||
> withAlias (Alias nm cols) = name nm
|
||||
> <+> me (parens . commaSep . map name) cols
|
||||
|
||||
|
||||
> queryExpr d (Values vs) =
|
||||
> text "values"
|
||||
> <+> nest 7 (commaSep (map (parens . commaSep . map (scalarExpr d)) vs))
|
||||
|
|
Loading…
Reference in a new issue