Documentation
¶
Overview ¶
Package sqlstore holds the dialect-independent SQL store implementation.
Index ¶
- Constants
- func Placeholders(n int) string
- func Scan(rows *sql.Rows) ([]xoutbox.Event, error)
- type Base
- func (b *Base) Cleanup(ctx context.Context, retention time.Duration) (int64, error)
- func (b *Base) Filter() string
- func (b *Base) Insert(ctx context.Context, ex xoutbox.Execer, events ...xoutbox.Event) error
- func (b *Base) MarkFailed(ctx context.Context, owner string, f xoutbox.Failure) error
- func (b *Base) MarkPublished(ctx context.Context, ids []string) error
- func (b *Base) Migrate(ctx context.Context) error
- func (b *Base) Q(s string) string
- func (b *Base) Requeue(ctx context.Context, ids ...string) (int64, error)
- func (b *Base) SchemaSQL() string
- func (b *Base) Stats(ctx context.Context) (xoutbox.Stats, error)
- type Dialect
- type Option
Constants ¶
View Source
const Cols = "seq, id, topic, partition_key, event_type, payload, headers, attempts, max_attempts, {created}"
Cols is the column list returned by claims, matching Scan.
Variables ¶
This section is empty.
Functions ¶
func Placeholders ¶
Placeholders returns "?, ?, ..." with n entries.
Types ¶
type Base ¶
Base implements everything except Claim.
func (*Base) MarkFailed ¶
func (*Base) Requeue ¶
Requeue moves dead events back to pending with a fresh attempt budget. With no ids, every dead event is requeued.
type Dialect ¶
type Dialect struct {
Rebind func(string) string
Now string // current timestamp expression
Dur string // duration expression with exactly one placeholder
DurArg func(time.Duration) any // value bound to Dur
Created string // created_at as unix microseconds
Age string // seconds since MIN(created_at)
Delete string // deletes up to 1000 published rows older than {dur}
Schema string
}
Dialect captures the SQL differences between databases.
Click to show internal directories.
Click to hide internal directories.