Documentation ¶
Index ¶
- Variables
- type SQLStore
- func (ss SQLStore) Load(ctx context.Context, aggID string, options sourcing.LoadEventsOptions) (evt []gosignal.Event, err error)
- func (ss SQLStore) Replace(ctx context.Context, id string, version uint, event gosignal.Event) error
- func (ss SQLStore) Store(ctx context.Context, events []gosignal.Event) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTableNameNotSet = errors.New("table name not set")
ErrTableNameNotSet is the error returned when the table name is not set
Functions ¶
This section is empty.
Types ¶
type SQLStore ¶
SQLStore is an opinionated store that uses a SQL database to store events it mirrors the gosignal.Event struct for fields when storing the events. Only ony table must be used per aggregate type as there is no expectation of columns for the aggregate type.
it should use a schema that matches the following: ```sql CREATE TABLE events (
id SERIAL PRIMARY KEY, type VARCHAR(255) NOT NULL, data BYTEA NOT NULL, version INT NOT NULL, timestamp TIMESTAMP WITH TIME ZONE NOT NULL, aggregate_id VARCHAR(255) NOT NULL
); ```
func (SQLStore) Load ¶
func (ss SQLStore) Load(ctx context.Context, aggID string, options sourcing.LoadEventsOptions) (evt []gosignal.Event, err error)
Load loads all events for a given aggregate id
Click to show internal directories.
Click to hide internal directories.