domaindriven-core-0.5.0: Batteries included event sourcing and CQRS
Safe HaskellSafe-Inferred
LanguageHaskell2010

DomainDriven.Persistance.Postgres

Synopsis

Documentation

data PostgresEvent model event Source #

Constructors

PostgresEvent 

Fields

Instances

Instances details
Generic (PostgresEvent model event) Source # 
Instance details

Defined in DomainDriven.Persistance.Postgres.Internal

Associated Types

type Rep (PostgresEvent model event) :: Type -> Type #

Methods

from :: PostgresEvent model event -> Rep (PostgresEvent model event) x #

to :: Rep (PostgresEvent model event) x -> PostgresEvent model event #

FromJSON e => ReadModel (PostgresEvent m e) Source # 
Instance details

Defined in DomainDriven.Persistance.Postgres.Internal

Associated Types

type Model (PostgresEvent m e) Source #

type Event (PostgresEvent m e) Source #

(ToJSON e, FromJSON e) => WriteModel (PostgresEvent m e) Source # 
Instance details

Defined in DomainDriven.Persistance.Postgres.Internal

Methods

transactionalUpdate :: MonadUnliftIO m0 => PostgresEvent m e -> (Model (PostgresEvent m e) -> m0 (Model (PostgresEvent m e) -> a, [Event (PostgresEvent m e)])) -> m0 a Source #

type Rep (PostgresEvent model event) Source # 
Instance details

Defined in DomainDriven.Persistance.Postgres.Internal

type Rep (PostgresEvent model event) = D1 ('MetaData "PostgresEvent" "DomainDriven.Persistance.Postgres.Internal" "domaindriven-core-0.5.0-7rYqBJZZqKF59TNQHBa9rT" 'False) (C1 ('MetaCons "PostgresEvent" 'PrefixI 'True) ((S1 ('MetaSel ('Just "connectionPool") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Pool Connection)) :*: (S1 ('MetaSel ('Just "eventTableName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EventTableName) :*: S1 ('MetaSel ('Just "modelIORef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (IORef (NumberedModel model))))) :*: (S1 ('MetaSel ('Just "app") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (model -> Stored event -> model)) :*: (S1 ('MetaSel ('Just "seed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 model) :*: S1 ('MetaSel ('Just "chunkSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkSize)))))
type Event (PostgresEvent m e) Source # 
Instance details

Defined in DomainDriven.Persistance.Postgres.Internal

type Event (PostgresEvent m e) = e
type Model (PostgresEvent m e) Source # 
Instance details

Defined in DomainDriven.Persistance.Postgres.Internal

type Model (PostgresEvent m e) = m

postgresWriteModelNoMigration :: (FromJSON e, WriteModel (PostgresEventTrans m e)) => Pool Connection -> EventTableName -> (m -> Stored e -> m) -> m -> IO (PostgresEvent m e) Source #

Setup the persistance model and verify that the tables exist.

postgresWriteModel :: Pool Connection -> EventTable -> (m -> Stored e -> m) -> m -> IO (PostgresEvent m e) Source #

Setup the persistance model and verify that the tables exist.