fix(sqlitestore): move idempotency from separate table to events column #193
Labels
No labels
bug
documentation
enhancement
investigation
nice-to-have
performance
production-ready
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ash/eskit#193
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Postgres stores idempotency keys as a column on the events table — atomic, clean, single lookup. SQLite uses a separate
idempotency_keystable with comma-separated event IDs — fragile, non-atomic, inconsistent with pgstore.The
idempotency_keystable is always empty unless someone explicitly usesAppendWithOptions. Store parity rule says both backends must behave the same way.What to do
idempotency_key TEXTcolumn to SQLite events table (migration)CREATE INDEX idx_events_idempotency_key ON events(stream_type, stream_id, idempotency_key) WHERE idempotency_key IS NOT NULLAppendWithOptionsto write idempotency_key to the events rowidempotency_keystable in migration (or leave it for backward compat)Store parity
Ref: #139