eventsourcing_postgres

Types

pub opaque type PostgresStore(entity, command, event, error)

Functions

pub fn create_event_table(
  postgres_store: PostgresStore(a, b, c, d),
) -> Result(Returned(Dynamic), QueryError)
pub fn load_aggregate_entity(
  postgres_store: PostgresStore(a, b, c, d),
  aggregate_id: String,
) -> Result(a, Nil)
pub fn load_events(
  postgres_store: PostgresStore(a, b, c, d),
  aggregate_id: String,
) -> Result(List(EventEnvelop(c)), QueryError)
pub fn new(
  pgo_config pgo_config: Config,
  empty_entity empty_entity: a,
  handle_command_function handle: fn(a, b) -> Result(List(c), d),
  apply_function apply: fn(a, c) -> a,
  event_encoder event_encoder: fn(c) -> String,
  event_decoder event_decoder: fn(String) ->
    Result(c, List(DecodeError)),
  event_type event_type: String,
  event_version event_version: String,
  aggregate_type aggregate_type: String,
) -> EventStore(PostgresStore(a, b, c, d), a, b, c, d)
Search Document