Merge pull request #276 from ruslantalpa/master

Support for &select=col1,col2,col3 as suggested in issue #227
This commit is contained in:
Joe Nelson
2015-09-06 15:24:47 -07:00
6 changed files with 114 additions and 11 deletions
+3 -3
View File
@@ -64,7 +64,7 @@ app conf reqBody req =
else do
let qt = qualify table
from = fromMaybe 0 $ rangeOffset <$> range
select = B.Stmt "select " V.empty True <>
query = B.Stmt "select " V.empty True <>
parentheticT (
whereT qt qq $ countRows qt
) <> commaq <> (
@@ -72,9 +72,9 @@ app conf reqBody req =
. limitT range
. orderT (orderParse qq)
. whereT qt qq
$ selectStar qt
$ select qt qq
)
row <- H.maybeEx select
row <- H.maybeEx query
let (tableTotal, queryTotal, body) =
fromMaybe (0, 0, Just "" :: Maybe Text) row
to = from+queryTotal-1