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

supabase / cli / 30300854976
65%
develop: 65%

Build:
Build:
LAST BUILD BRANCH: gh-readonly-queue/develop/pr-6013-6ecf93dc019ec52b27d81603a20156c81e487cb0
DEFAULT BRANCH: develop
Ran 27 Jul 2026 08:04PM UTC
Jobs 1
Files 230
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 Jul 2026 07:54PM UTC coverage: 65.288%. Remained the same
30300854976

push

github

web-flow
fix(cli): surface db connection-failure detail and fix connect suggestion classifiers (#5948)

## What changed

Every legacy db command's connection failure previously rendered as

```
failed to connect to postgres: effect/sql/SqlError: PgClient: Failed to connect
```

— host, user, database, and the underlying driver cause were all lost,
on every `db push` / `db pull` / `db reset` / `db diff --linked` /
`inspect` / `migration` connection failure. The Go CLI renders pgconn's
full detail:

```
failed to connect to postgres: failed to connect to `host=… user=… database=…`: dial error (dial tcp …: connect: connection refused)
```

This PR ports pgconn's `connectError` rendering (`errors.go:66-72`,
wrapped by `pkg/pgxv5/connect.go:33`) into the legacy connection layer,
and fixes the `legacyConnectSuggestion` classifier branches that could
never fire on real node-postgres error shapes.

### Message rendering (`legacyConnectFailureMessage`)

- `toConnectError` in `legacy-db-connection.sql-pg.layer.ts` now renders
`failed to connect to postgres: failed to connect to \`host=… user=…
database=…\`: <staged cause>` using the config-level identity
(host/user/database — never the password), exactly like pgconn.
- The cause is unwrapped through the real `SqlError → ConnectionError →
driver error` chain (and through `AggregateError.errors[]`, taking the
LAST attempt — pgconn's fallback loop also surfaces the last attempt's
error).
- Stage labels mirror pgconn where the node error identifies the stage
unambiguously: `server error (SEVERITY: message (SQLSTATE code))`
(byte-parity with pgconn's `PgError` rendering), `hostname resolving
error (…)`, `dial error (…)`, `tls error (…)`.

### Classifier fixes (`legacyConnectSuggestion`)

Branch-by-branch verification against real driver shapes (captured
empirically under Bun, the CLI's runtime):

| Go branch | node-postgres shape | Before | After |
|---|---|---|---|
| `connect: connection refused` / allow_list → network-rest... (continued)

11257 of 17242 relevant lines covered (65.29%)

10.51 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
82.41
0.0% internal/storage/rm/rm.go
Jobs
ID Job ID Ran Files Coverage
1 30300854976.1 27 Jul 2026 08:04PM UTC 230
65.29
GitHub Action Run
Source Files on build 30300854976
  • Tree
  • List 230
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30300854976
  • 3d62a687 on github
  • Prev Build on gh-readonly-queue/develop/pr-5946-78c8a7f5d4ad48310462c1607b172f3ec779ca5d (#30300334660)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc