ReviewOS

stacks/bun-query-builder

Snapshot-consistent paginate() via optional transaction

#1051
Closed glennmichael123 opened this 22 days ago · 0 comments
22 days ago

Summary

paginate() runs COUNT and the page query as two separate statements; an inline comment documents the known race (total/data inconsistency under concurrent writes) and explicitly defers a tx parameter "to a future major version." Accept an optional { tx } (the transaction machinery already exists) so callers can opt into snapshot isolation.

Effort: S–M. Location: src/client.ts:~4533. Fixes a self-documented correctness gap. Found via internal code audit.

Sign in to comment on this issue.