change fn name from selectT to select
This commit is contained in:
@@ -64,7 +64,7 @@ app conf reqBody req =
|
|||||||
else do
|
else do
|
||||||
let qt = qualify table
|
let qt = qualify table
|
||||||
from = fromMaybe 0 $ rangeOffset <$> range
|
from = fromMaybe 0 $ rangeOffset <$> range
|
||||||
select = B.Stmt "select " V.empty True <>
|
query = B.Stmt "select " V.empty True <>
|
||||||
parentheticT (
|
parentheticT (
|
||||||
whereT qt qq $ countRows qt
|
whereT qt qq $ countRows qt
|
||||||
) <> commaq <> (
|
) <> commaq <> (
|
||||||
@@ -72,9 +72,9 @@ app conf reqBody req =
|
|||||||
. limitT range
|
. limitT range
|
||||||
. orderT (orderParse qq)
|
. orderT (orderParse qq)
|
||||||
. whereT qt qq
|
. whereT qt qq
|
||||||
$ selectT qt qq
|
$ select qt qq
|
||||||
)
|
)
|
||||||
row <- H.maybeEx select
|
row <- H.maybeEx query
|
||||||
let (tableTotal, queryTotal, body) =
|
let (tableTotal, queryTotal, body) =
|
||||||
fromMaybe (0, 0, Just "" :: Maybe Text) row
|
fromMaybe (0, 0, Just "" :: Maybe Text) row
|
||||||
to = from+queryTotal-1
|
to = from+queryTotal-1
|
||||||
|
|||||||
@@ -129,8 +129,8 @@ asJsonRow s = s { B.stmtTemplate = "row_to_json(t) from (" <> B.stmtTemplate s <
|
|||||||
selectStar :: QualifiedIdentifier -> PStmt
|
selectStar :: QualifiedIdentifier -> PStmt
|
||||||
selectStar t = B.Stmt ("select * from " <> fromQi t) empty True
|
selectStar t = B.Stmt ("select * from " <> fromQi t) empty True
|
||||||
|
|
||||||
selectT :: QualifiedIdentifier -> Net.Query -> PStmt
|
select :: QualifiedIdentifier -> Net.Query -> PStmt
|
||||||
selectT table params =
|
select table params =
|
||||||
if L.null cols
|
if L.null cols
|
||||||
then selectStar table
|
then selectStar table
|
||||||
else B.Stmt "select " empty True <> conjunction <> B.Stmt (" from " <> fromQi table ) empty True
|
else B.Stmt "select " empty True <> conjunction <> B.Stmt (" from " <> fromQi table ) empty True
|
||||||
|
|||||||
Reference in New Issue
Block a user