1
Fork 0

add support for ansi standard offset and fetch syntax

This commit is contained in:
Jake Wheat 2013-12-17 16:00:17 +02:00
parent 8093498f2d
commit b2728ec9bf
5 changed files with 47 additions and 39 deletions
Language/SQL/SimpleSQL

View file

@ -149,7 +149,7 @@
= query expressions
> queryExpr :: QueryExpr -> Doc
> queryExpr (Select d sl fr wh gb hv od lm off) =
> queryExpr (Select d sl fr wh gb hv od off fe) =
> sep [text "select"
> ,case d of
> All -> empty
@ -160,8 +160,9 @@
> ,grpBy gb
> ,maybeScalarExpr "having" hv
> ,orderBy od
> ,maybeScalarExpr "limit" lm
> ,maybeScalarExpr "offset" off
> ,maybe empty (\e -> text "offset" <+> scalarExpr e <+> text "rows") off
> ,maybe empty (\e -> text "fetch next" <+> scalarExpr e
> <+> text "rows only") fe
> ]
> queryExpr (CombineQueryExpr q1 ct d c q2) =
> sep [queryExpr q1