Documentation
¶
Overview ¶
Package eventuallypostgres contains implementations of go-eventually interfaces specific to PostgreSQL, such as Aggregate Repository, Event Store, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunMigrations ¶
RunMigrations runs the latest migrations for the postgres integration.
Make sure to run these in the entrypoint of your application, ideally before building a postgres interface implementation.
Types ¶
type AggregateRepository ¶
type AggregateRepository[ID aggregate.ID, T aggregate.Root[ID]] struct { Conn *pgxpool.Pool AggregateType aggregate.Type[ID, T] AggregateSerde serde.Bytes[T] MessageSerde serde.Bytes[message.Message] }
AggregateRepository implements the aggregate.Repository interface for PostgreSQL databases.
This implementation uses the "aggregates" table in the database as its main operational table. At the same time, it also writes to both "events" and "event_streams" to append the Domain events recorded by Aggregate Roots. These updates are performed within the same transaction.
type EventStore ¶
EventStore is an event.Store implementation targeted to PostgreSQL databases.
The implementation uses "event_streams" and "events" as their operational tables. Updates to these tables are transactional.