Tracking issue for a production-ready Postgres/Supabase backend for the memory store. #40 was a good start but was closed pending the following:
Required before merging
1. Tests
The SQLite store has a full test suite. Postgres needs equivalent coverage. A Docker-based Postgres in CI (e.g. services: postgres in GitHub Actions) is sufficient — no live database required.
2. OnLifecycleEvent implementation
The Store interface requires OnLifecycleEvent(MemoryEventHandler). The SQLite implementation emits EventCompressed and EventEvicted from its decay worker. The Postgres implementation currently registers a no-op, meaning:
- Cache boundary hints are never fired for Postgres users
- Decay lifecycle callbacks are silently dropped
Options:
- Implement a polling-based decay worker for Postgres (e.g. periodic
SELECT + UPDATE query)
- Or explicitly document it as unsupported and return an error if a handler is registered
3. Build tag or separate binary
pgx/v5 adds ~5MB to the binary even when Postgres is not used. Consider:
//go:build postgres tag so the default binary stays lean
- Or a separate
distill-postgres binary via GoReleaser
Out of scope
Reference
Original implementation: #40 (closed)
Tracking issue for a production-ready Postgres/Supabase backend for the memory store. #40 was a good start but was closed pending the following:
Required before merging
1. Tests
The SQLite store has a full test suite. Postgres needs equivalent coverage. A Docker-based Postgres in CI (e.g.
services: postgresin GitHub Actions) is sufficient — no live database required.2.
OnLifecycleEventimplementationThe
Storeinterface requiresOnLifecycleEvent(MemoryEventHandler). The SQLite implementation emitsEventCompressedandEventEvictedfrom its decay worker. The Postgres implementation currently registers a no-op, meaning:Options:
SELECT+UPDATEquery)3. Build tag or separate binary
pgx/v5adds ~5MB to the binary even when Postgres is not used. Consider://go:build postgrestag so the default binary stays leandistill-postgresbinary via GoReleaserOut of scope
Reference
Original implementation: #40 (closed)