mem: split pgstore/store.go and sqlitestore/store.go into logical files #232

Open
opened 2026-03-10 10:14:05 +00:00 by ash · 0 comments
Owner

Problem

  • pgstore/store.go — 987 lines
  • sqlitestore/store.go — 975 lines

Both files handle reads, writes, snapshots, raw events, upcasting, and schema setup in one monolith. This makes:

  • Navigation harder (where is the append logic?)
  • Code review harder (1000-line diffs)
  • Parallel work harder (merge conflicts)

Solution

Split each store.go into:

  • store.go — constructor, options, core types
  • read.go — ReadStream, ReadFrom, load helpers
  • write.go — Append, AppendWithOptions
  • snapshot.go — Save/LoadSnapshot
  • raw.go — LoadRawEvents
  • scan.go — shared scanning helpers (see #227)

No API changes. Pure file reorganization.

Pillar: Memory Efficiency (cognitive), Developer Experience

## Problem - `pgstore/store.go` — 987 lines - `sqlitestore/store.go` — 975 lines Both files handle reads, writes, snapshots, raw events, upcasting, and schema setup in one monolith. This makes: - Navigation harder (where is the append logic?) - Code review harder (1000-line diffs) - Parallel work harder (merge conflicts) ## Solution Split each store.go into: - `store.go` — constructor, options, core types - `read.go` — ReadStream, ReadFrom, load helpers - `write.go` — Append, AppendWithOptions - `snapshot.go` — Save/LoadSnapshot - `raw.go` — LoadRawEvents - `scan.go` — shared scanning helpers (see #227) No API changes. Pure file reorganization. ## Pillar: Memory Efficiency (cognitive), Developer Experience
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#232
No description provided.