fix: unnecessary count() on RPC returning single

This commit is contained in:
steve-chavez
2023-10-19 15:54:22 -05:00
committed by Steve Chavez
parent 00f3cb3746
commit 54786a6c04
4 changed files with 16 additions and 4 deletions
+6
View File
@@ -14,6 +14,7 @@ module PostgREST.SchemaCache.Routine
, funcReturnsVoid
, funcTableName
, funcReturnsCompositeAlias
, funcReturnsSingle
, ResultAggregate(..)
) where
@@ -99,6 +100,11 @@ data ResultAggregate
| NoAgg
deriving (Eq, Show)
funcReturnsSingle :: Routine -> Bool
funcReturnsSingle proc = case proc of
Function{pdReturnType = Single _} -> True
_ -> False
funcReturnsScalar :: Routine -> Bool
funcReturnsScalar proc = case proc of
Function{pdReturnType = Single (Scalar{})} -> True