mirror of
https://github.com/nikita-volkov/hasql.git
synced 2024-11-22 01:52:45 +03:00
Fix
This commit is contained in:
parent
cc2c4db3c5
commit
1544e3d783
@ -15,12 +15,14 @@ run :: forall a. Pipeline a -> Pq.Connection -> PreparedStatementRegistry.Prepar
|
||||
run (Pipeline sendQueriesInIO) connection registry integerDatetimes = do
|
||||
runExceptT do
|
||||
enterPipelineMode
|
||||
flip finallyE exitPipelineMode do
|
||||
recvQueries <- sendQueries
|
||||
pipelineSync
|
||||
queriesResult <- recvQueries
|
||||
recvPipelineSync
|
||||
pure queriesResult
|
||||
finallyE
|
||||
do
|
||||
recvQueries <- sendQueries
|
||||
pipelineSync
|
||||
recvQueries
|
||||
do
|
||||
recvPipelineSync
|
||||
exitPipelineMode
|
||||
where
|
||||
enterPipelineMode :: ExceptT SessionError IO ()
|
||||
enterPipelineMode =
|
||||
@ -40,9 +42,14 @@ run (Pipeline sendQueriesInIO) connection registry integerDatetimes = do
|
||||
|
||||
recvPipelineSync :: ExceptT SessionError IO ()
|
||||
recvPipelineSync =
|
||||
runResultsDecoder
|
||||
$ Decoders.Results.single Decoders.Result.pipelineSync
|
||||
|
||||
runResultsDecoder :: forall a. Decoders.Results.Results a -> ExceptT SessionError IO a
|
||||
runResultsDecoder decoder =
|
||||
ExceptT
|
||||
$ fmap (mapLeft PipelineSessionError)
|
||||
$ Decoders.Results.run (Decoders.Results.single Decoders.Result.pipelineSync) connection integerDatetimes
|
||||
$ Decoders.Results.run decoder connection integerDatetimes
|
||||
|
||||
runCommand :: IO Bool -> ExceptT SessionError IO ()
|
||||
runCommand action =
|
||||
|
Loading…
Reference in New Issue
Block a user