• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

golang-migrate / migrate / 22585591733 / 2
55%
master: 54%

Build:
Build:
LAST BUILD BRANCH: fix/postgres-drop-all-objects
DEFAULT BRANCH: master
Ran 02 Mar 2026 04:57PM UTC
Files 59
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Feb 2026 08:26PM UTC coverage: 54.645% (+0.2%) from 54.432%
22585591733.2

Pull #1364

github

areazus
Add x-use-transaction mode to postgres driver for pg-proxy compatibility

Session-level advisory locks (pg_advisory_lock) are not supported by
pg-proxies such as Orgstore's pg-proxy, which route each statement to a
potentially different backend connection. This makes it impossible to
guarantee that Lock and Unlock execute on the same connection.

Add a new x-use-transaction URL option (UseTransaction config field) that
switches the driver to transaction-scoped advisory locks
(pg_advisory_xact_lock). In this mode, a single transaction spans the
advisory lock acquisition, migration SQL, and version table update, with
the lock released automatically on commit or rollback. This is compatible
with pg-proxy deployments since all statements are issued within one
transaction on a single connection.

Key changes:
- Add withExistingOrNewTxRollbackOnErr to manage a shared *sql.Tx,
  including proper rollback and cleanup of p.tx on error
- Add executeExecContext, executeQueryContext, executeQueryRowContext
  wrappers that route through the shared transaction when enabled
- Update Lock/Unlock, SetVersion, Run, Drop, and ensureVersionTable to
  use the new wrappers
- Fix transaction leak when SET LOCAL statement_timeout fails on startup
- Ensure p.tx is cleared after rollback so subsequent calls start fresh
- Return nil from Unlock when the transaction is already done (rolled
  back by a failed migration), since the lock is already released
- Update dktesting cleanup client to use API version negotiation
- Document the feature and its limitations (CONCURRENTLY, VACUUM, etc.)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Pull Request #1364: Add x-use-transaction mode to postgres driver for pg-proxy compatibility

4435 of 8116 relevant lines covered (54.65%)

25.78 hits per line

Source Files on job Go-1.25.x - 22585591733.2
  • Tree
  • List 59
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 22585591733
  • 257c1fd7 on github
  • Prev Job for on feat/postgres-use-transaction (#20215682023.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc