Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

fix(postgres): honour a URL's options, and each server's own sslmode - #258

Merged
jasdeepkhalsa merged 2 commits into
masterfrom
fix/url-options-and-sslmode
Oct 10, 2026
Merged

jasdeepkhalsa merged 2 commits into
masterfrom
fix/url-options-and-sslmode

Conversation

@jasdeepkhalsa

Copy link
Copy Markdown
Member

URL options were dropped. ?options=-c default_transaction_read_only=on -c statement_timeout=… is how a connection string asks for session settings. psql, pg_dump and libpq clients honour it, but Laravel's connector builds its own DSN with no place for it, so DBDiff dropped it. A source made read-only through its URL, the usual guard on a production connection, was an ordinary session for DBDiff.

Now each -c name=value (or --name=value) is applied with set_config() as soon as the connection is made, with the values bound, and again when a connection is rebuilt for another schema. PostgresSessionOptions::parse follows libpq's quoting rules (backslash escapes, dashes for underscores). When DBDiff runs pg_dump, it passes the same settings through PGOPTIONS.

sslmode applied to both servers. The source URL's sslmode was applied to both connections, and the target URL's own was ignored. Each server now keeps its own. --supabase and --sslmode only fill in where a URL doesn't name one.

Tests

  • tests/Unit/PostgresSessionOptionsTest: parsing, and per-server sslmode/options from toServerAndDb.
  • UrlSessionOptionsPostgresTest: on a live server, the source session reports the URL's default_transaction_read_only=on and statement_timeout, the target keeps its own, and the settings survive useSchema().
  • Both fail on master. Related suites (DsnParser, connection config, CLI getter, diff command) pass: 83 tests.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added bug php Pull requests that update php code postgres Related to Postgres labels Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@jasdeepkhalsa
jasdeepkhalsa merged commit 4a4ba6d into master Oct 10, 2026
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug php Pull requests that update php code postgres Related to Postgres

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant