Add GlobalReader to EventStore interface or as standard companion interface #33

Closed
opened 2026-02-20 00:21:20 +00:00 by ash · 0 comments
Owner

Problem

EventStore interface only has per-stream operations (Load, LoadFrom). No way to read ALL events across all streams.

PGGlobalReader exists but is Postgres-specific and separate from the store interface. SQLite and NATS stores have no global reader.

Needed

type GlobalReader[E any] interface {
    ReadFrom(ctx context.Context, fromSequence uint64, limit int) ([]GlobalEvent[E], error)
    LatestSequence(ctx context.Context) (uint64, error)
}

Implementation per store

  • Memory: Already has MemoryGlobalReader
  • Postgres: Already has PGGlobalReader
  • SQLite: Need to add (SELECT by rowid)
  • NATS: Native — ordered consumer on entire stream

Integration

  • EventSubscription depends on GlobalReader
  • Projection rebuild depends on GlobalReader
  • Every store MUST implement it
  • Add to conformance suite

Priority: HIGH

Projections don't work without global reads.

## Problem EventStore interface only has per-stream operations (Load, LoadFrom). No way to read ALL events across all streams. PGGlobalReader exists but is Postgres-specific and separate from the store interface. SQLite and NATS stores have no global reader. ## Needed ```go type GlobalReader[E any] interface { ReadFrom(ctx context.Context, fromSequence uint64, limit int) ([]GlobalEvent[E], error) LatestSequence(ctx context.Context) (uint64, error) } ``` ## Implementation per store - **Memory**: Already has MemoryGlobalReader - **Postgres**: Already has PGGlobalReader - **SQLite**: Need to add (SELECT by rowid) - **NATS**: Native — ordered consumer on entire stream ## Integration - EventSubscription depends on GlobalReader - Projection rebuild depends on GlobalReader - Every store MUST implement it - Add to conformance suite ## Priority: HIGH Projections don't work without global reads.
ash closed this issue 2026-02-20 00:50:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ash/eskit#33
No description provided.