Phase 2: Connection, schema migrate, lock/leader helpers - #3
Merged
Conversation
Add pg-boss-backed Connection with migrate/lock/leader/stat APIs, port connection tests for bun:test, fill specHelper cleanup, and bump to 0.1.0. Update living phase plans with lessons learned. Co-authored-by: Evan Tahler <evan@evantahler.com>
evantahler
marked this pull request as ready for review
August 26, 2026 20:21
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 458a374. Configure here.
| WHERE key = $1`, | ||
| [key, ttlSeconds], | ||
| ); | ||
| } |
There was a problem hiding this comment.
Expire lock revives expired lock rows
Medium Severity
expireLock updates any pgrq_locks row by key, including expired ones and rows owned by someone else. That revives a lock getLock treats as absent and can block or extend a setLockNx takeover after TTL expiry.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 458a374. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Implements docs/plans/02-connection-and-schema.md.
What this ships
Connection(connect/end/migrate) over pg-boss withmigrate: false,supervise: false,schedule: falsepgrq_leader,pgrq_workers,pgrq_locks,pgrq_statsplus lock, stat, and leader helpersconnection.test.ts,connectionError.test.ts);specHelper.cleanup()truncates leftover rowsdist/vianode scripts/assert-node-package.mjsNotes
Workers do not migrate.
automigrateremains a scheduler-leader concern for a later phase.