File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module Database.PostgreSQL.TransactionalStore
14
14
, executeMany
15
15
, returning
16
16
, queryHead
17
+ , formatQuery
17
18
) where
18
19
19
20
#if __GLASGOW_HASKELL__ < 710
@@ -23,6 +24,7 @@ import Control.Monad.Reader
23
24
import Data.Int
24
25
import qualified Database.PostgreSQL.Simple as Postgres
25
26
import qualified Database.PostgreSQL.Simple.Transaction as Postgres.Transaction
27
+ import qualified Database.PostgreSQL.Simple.Types as PGTypes
26
28
import Database.PostgreSQL.Simple.FromRow
27
29
import Database.PostgreSQL.Simple.ToRow
28
30
@@ -85,3 +87,8 @@ executeOne :: (ToRow input) => input -> Postgres.Query -> PGTransaction Bool
85
87
executeOne params q = do
86
88
results <- execute q params
87
89
return (results == 1 )
90
+
91
+ formatQuery :: ToRow q => Postgres. Query -> q -> PGTransaction Postgres. Query
92
+ formatQuery q params = do
93
+ conn <- ask
94
+ liftIO (PGTypes. Query <$> Postgres. formatQuery conn q params)
You can’t perform that action at this time.
0 commit comments