Documentation ¶
Index ¶
- Variables
- func PositionalPlaceholderDollarSign(i int) string
- 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 uint64, 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 ¶
func PositionalPlaceholderDollarSign ¶ added in v0.2.0
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 INT 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 TODO: support max version, event types, and to/from timestamps
Click to show internal directories.
Click to hide internal directories.