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

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

Build:
Build:
LAST BUILD BRANCH: fix/err-msg-type
DEFAULT BRANCH: master
Ran 02 Mar 2026 04:56PM UTC
Jobs 2
Files 59
Run time 1min
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

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

65 of 82 new or added lines in 2 files covered. (79.27%)

4435 of 8116 relevant lines covered (54.65%)

51.57 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
0.0
0.0% dktesting/dktesting.go
16
71.76
1.44% database/postgres/postgres.go
Jobs
ID Job ID Ran Files Coverage
1 Go-1.24.x - 22585591733.1 02 Mar 2026 04:56PM UTC 59
54.65
GitHub Action Run
2 Go-1.25.x - 22585591733.2 02 Mar 2026 04:56PM UTC 59
54.65
GitHub Action Run
Source Files on build 22585591733
  • Tree
  • List 59
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #1364
  • PR Base - master (#20215682023)
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