change fn name from selectT to select

This commit is contained in:
Ruslan Talpa
2015-09-04 19:04:39 +03:00
parent 40d4fb0d75
commit 6c16395dfb
2 changed files with 5 additions and 5 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
$ selectT qt qq
$ 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
+2 -2
View File
@@ -129,8 +129,8 @@ asJsonRow s = s { B.stmtTemplate = "row_to_json(t) from (" <> B.stmtTemplate s <
selectStar :: QualifiedIdentifier -> PStmt
selectStar t = B.Stmt ("select * from " <> fromQi t) empty True
selectT :: QualifiedIdentifier -> Net.Query -> PStmt
selectT table params =
select :: QualifiedIdentifier -> Net.Query -> PStmt
select table params =
if L.null cols
then selectStar table
else B.Stmt "select " empty True <> conjunction <> B.Stmt (" from " <> fromQi table ) empty True