eventstore v0.2.0 EventStore.Storage

Storage of events to a PostgreSQL database

Uses a pool of connections to the database. This is for increased concurrency and performance, but with an upper limit on concurrent access.

Summary

Functions

Acknowledge receipt of an event by id, for a single subscription

Append the given list of events to the stream, expected version is used for optimistic concurrency

Initialise the PostgreSQL database by creating the tables and indexes

Get the id of the last event persisted to storage

Read events for all streams forward from the starting event id, use zero for all events for all streams

Read events for the given stream forward from the starting version, use zero for all events for the stream

Reset the PostgreSQL database by deleting all rows

Create, or locate an existing, persistent subscription to a stream using a unique name

Get all known subscriptions, to any stream

Unsubscribe from an existing named subscription to a stream

Functions

ack_last_seen_event(stream_uuid, subscription_name, last_seen_event_id)

Acknowledge receipt of an event by id, for a single subscription

append_to_stream(stream_uuid, expected_version, events)

Append the given list of events to the stream, expected version is used for optimistic concurrency

initialize_store!()

Initialise the PostgreSQL database by creating the tables and indexes

latest_event_id()

Get the id of the last event persisted to storage

read_all_streams_forward(start_event_id \\ 0, count \\ nil)

Read events for all streams forward from the starting event id, use zero for all events for all streams

read_stream_forward(stream_uuid, start_version, count \\ nil)

Read events for the given stream forward from the starting version, use zero for all events for the stream

reset!()

Reset the PostgreSQL database by deleting all rows

subscribe_to_stream(stream_uuid, subscription_name)

Create, or locate an existing, persistent subscription to a stream using a unique name

subscriptions()

Get all known subscriptions, to any stream

unsubscribe_from_stream(stream_uuid, subscription_name)

Unsubscribe from an existing named subscription to a stream