cqrs-postgresql-0.10.0: PostgreSQL backend for the cqrs package.

Safe HaskellNone
LanguageHaskell2010

Data.CQRS.PostgreSQL.Internal.Utils

Synopsis

Documentation

badQueryResultMsg :: [String] -> [SqlValue] -> String Source

Format a message indicating a bad query result due to the "shape".

execSql :: Connection -> ByteString -> [SqlValue] -> IO () Source

Execute a query with no result.

execSql' :: Connection -> ByteString -> [SqlValue] -> IO (Maybe Int) Source

Execute a query an return the number of updated rows (if available).

ioQuery :: Connection -> ByteString -> [SqlValue] -> (InputStream [SqlValue] -> IO a) -> IO a Source

Run a query and fold over the results. The action receives an InputStream over all the rows in the result.

ioQuery' :: Connection -> ByteString -> [SqlValue] -> (Maybe Int -> InputStream [SqlValue] -> IO a) -> IO a Source

Run a query and fold over the results. The action receives the number of rows affected and an InputStream over all the rows in the result.

isDuplicateKey :: QueryError -> Maybe () Source

Is the given query exception a duplicate key exception?

withTransaction :: Connection -> IO a -> IO a Source

Execute an IO action with an active transaction.