packages feed

potoki-hasql 1.3 → 1.4

raw patch · 5 files changed

+19/−10 lines, 5 filesnew-uploader

Files

library/Potoki/Hasql/Consume.hs view
@@ -13,24 +13,24 @@ import           Potoki.Hasql.Error.Types    -executeBatchQueryConcurrently :: E.Query (Vector params) () -> Int -> Int -> B.Settings -> Consume params (Either Error ())+executeBatchQueryConcurrently :: Show params => E.Query (Vector params) () -> Int -> Int -> B.Settings -> Consume params (Either Error ()) executeBatchQueryConcurrently query batchSize amountOfConnections settings =   transform batchTransform (right' O.concat)   where     batchTransform =       F.concurrently amountOfConnections (F.consume (executeBatchQuery query batchSize settings)) -executeBatchQuery :: E.Query (Vector params) () -> Int -> B.Settings -> Consume params (Either Error ())+executeBatchQuery :: Show params => E.Query (Vector params) () -> Int -> B.Settings -> Consume params (Either Error ()) executeBatchQuery query batchSize settings =   transform     (F.consume (transform (F.take batchSize) O.vector))     (executeQuery query settings) -executeQuery :: E.Query params () -> B.Settings -> Consume params (Either Error ())+executeQuery :: Show params => E.Query params () -> B.Settings -> Consume params (Either Error ()) executeQuery query =   executeSession (\ params -> D.query params query) -executeSession :: (params -> D.Session ()) -> B.Settings -> Consume params (Either Error ())+executeSession :: Show params => (params -> D.Session ()) -> B.Settings -> Consume params (Either Error ()) executeSession session connectionSettings =   Consume $ \ (C.Fetch fetchIO) -> do     acquisitionResult <- B.acquire connectionSettings@@ -47,5 +47,5 @@                   result <- D.run (session params) connection                   case result of                     Right () -> loop-                    Left error -> return (Left (G.sessionError error)))+                    Left error -> return (Left (G.sessionErrorWithParams params error)))           in loop <* B.release connection
library/Potoki/Hasql/Error/Hasql.hs view
@@ -19,3 +19,11 @@       ConnectionError (maybe "" lenientUtf8ByteStringText details)     A.ResultError details ->       InteractionError ((stringText . show) details)++sessionErrorWithParams :: Show params => params -> A.Error -> Error+sessionErrorWithParams params =+  \ case+    A.ClientError details ->+      ConnectionError (maybe "" lenientUtf8ByteStringText details)+    A.ResultError details ->+      InteractionError ((fromString . shows details . showString ": " . shows params) "")
library/Potoki/Hasql/Error/Types.hs view
@@ -4,8 +4,8 @@ import Potoki.Hasql.Prelude  -{-| Error, which can be produced during interaction with the Requests database.-    Comes packed with the detailed description of the problems. -}+{-| Error, which can be produced during interaction with the database.+    Comes packed with a detailed description of the problems. -} data Error =   {-| Connection error. Can be interpreted as a signal for reconnecting. -}   ConnectionError Text |
library/Potoki/Hasql/Prelude.hs view
@@ -8,6 +8,9 @@  import           Prelude                  as Exports import           Control.Monad            as Exports (join)+import           Data.Monoid              as Exports hiding (Last(..), First(..), (<>))+import           Data.Semigroup           as Exports+import           Data.String              as Exports import           Data.Profunctor          as Exports (right') import           Data.IORef               as Exports import           Data.Vector              as Exports (Vector(..))
potoki-hasql.cabal view
@@ -1,7 +1,7 @@ name:   potoki-hasql version:-  1.3+  1.4 synopsis:   Integration of "potoki" and "hasql". description:@@ -58,5 +58,3 @@     bytestring >= 0.10.8.2 && < 0.11,     vector >= 0.12.0.1 && < 0.13,     profunctors >= 5.2.2 && < 5.3-  ghc-options:-    -Wall