-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | PostgreSQL backend for the cqrs package. -- -- PostgreSQL backend for the cqrs package. @package cqrs-postgresql @version 0.10.0 module Data.CQRS.PostgreSQL.Internal.Utils -- | Known field types. data SqlValue SqlByteArray :: (Maybe ByteString) -> SqlValue SqlBlankPaddedString :: (Maybe ByteString) -> SqlValue SqlBool :: (Maybe Bool) -> SqlValue SqlInt16 :: (Maybe Int16) -> SqlValue SqlInt32 :: (Maybe Int32) -> SqlValue SqlInt64 :: (Maybe Int64) -> SqlValue SqlFloating :: (Maybe Double) -> SqlValue SqlVarChar :: (Maybe Text) -> SqlValue SqlText :: (Maybe Text) -> SqlValue SqlUUID :: (Maybe UUID) -> SqlValue Unmatched :: (Oid, Maybe ByteString) -> SqlValue -- | Error happened during query. data QueryError QueryError :: Maybe ByteString -> ByteString -> Maybe ByteString -> QueryError [qeSqlState] :: QueryError -> Maybe ByteString [qeStatusMessage] :: QueryError -> ByteString [qeErrorMessage] :: QueryError -> Maybe ByteString -- | Format a message indicating a bad query result due to the "shape". badQueryResultMsg :: [String] -> [SqlValue] -> String -- | Execute a query with no result. execSql :: Connection -> ByteString -> [SqlValue] -> IO () -- | Execute a query an return the number of updated rows (if available). execSql' :: Connection -> ByteString -> [SqlValue] -> IO (Maybe Int) -- | Run a query and fold over the results. The action receives an -- InputStream over all the rows in the result. ioQuery :: Connection -> ByteString -> [SqlValue] -> (InputStream [SqlValue] -> IO a) -> IO a -- | 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. ioQuery' :: Connection -> ByteString -> [SqlValue] -> (Maybe Int -> InputStream [SqlValue] -> IO a) -> IO a -- | Is the given query exception a duplicate key exception? isDuplicateKey :: QueryError -> Maybe () runQuery :: Pool Connection -> ByteString -> [SqlValue] -> IO [[SqlValue]] -- | Execute an IO action with an active transaction. withTransaction :: Connection -> IO a -> IO a instance GHC.Generics.Selector Data.CQRS.PostgreSQL.Internal.Utils.S1_0_2QueryError instance GHC.Generics.Selector Data.CQRS.PostgreSQL.Internal.Utils.S1_0_1QueryError instance GHC.Generics.Selector Data.CQRS.PostgreSQL.Internal.Utils.S1_0_0QueryError instance GHC.Generics.Constructor Data.CQRS.PostgreSQL.Internal.Utils.C1_0QueryError instance GHC.Generics.Datatype Data.CQRS.PostgreSQL.Internal.Utils.D1QueryError instance GHC.Generics.Generic Data.CQRS.PostgreSQL.Internal.Utils.QueryError instance GHC.Show.Show Data.CQRS.PostgreSQL.Internal.Utils.QueryError instance GHC.Show.Show Data.CQRS.PostgreSQL.Internal.Utils.SqlValue instance GHC.Classes.Eq Data.CQRS.PostgreSQL.Internal.Utils.SqlValue instance GHC.Exception.Exception Data.CQRS.PostgreSQL.Internal.Utils.QueryError instance Control.DeepSeq.NFData Data.CQRS.PostgreSQL.Internal.Utils.QueryError module Data.CQRS.PostgreSQL.Internal.Migration -- | Apply all necessary migrations to event store database. We use a -- special table to track which migrations have been applied. applyMigrations :: Connection -> [(UUID, ByteString)] -> IO () -- | Convert valid UUID string to a value. uuid :: ByteString -> UUID module Data.CQRS.PostgreSQL.Migrations -- | Apply all the necessary migrations to use any subset of the CQRS -- functionality. migrate :: Connection -> IO () module Data.CQRS.PostgreSQL.Internal.SnapshotStore -- | Create an snapshot store backed by a PostgreSQL connection pool. newSnapshotStore :: Pool Connection -> IO (SnapshotStore ByteString) module Data.CQRS.PostgreSQL.Internal.EventStore -- | Create an event store backed by a PostgreSQL connection pool. The -- database which the connections go to must have an appropriate schema -- as defined by applyMigrations. newEventStore :: Pool Connection -> IO (EventStore ByteString) module Data.CQRS.PostgreSQL.Internal.ArchiveStore -- | Create an archive store backed by a PostgreSQL connection pool. newArchiveStore :: IO UUID -> Pool Connection -> IO (ArchiveStore ByteString) module Data.CQRS.PostgreSQL -- | Create an archive store backed by a PostgreSQL connection pool. newArchiveStore :: IO UUID -> Pool Connection -> IO (ArchiveStore ByteString) -- | Create an event store backed by a PostgreSQL connection pool. The -- database which the connections go to must have an appropriate schema -- as defined by applyMigrations. newEventStore :: Pool Connection -> IO (EventStore ByteString) -- | Create an snapshot store backed by a PostgreSQL connection pool. newSnapshotStore :: Pool Connection -> IO (SnapshotStore ByteString)