Repository navigation
fix(postgres): honour a URL's options, and each server's own sslmode - #258
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.



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 withset_config()as soon as the connection is made, with the values bound, and again when a connection is rebuilt for another schema.PostgresSessionOptions::parsefollows libpq's quoting rules (backslash escapes, dashes for underscores). When DBDiff runs pg_dump, it passes the same settings throughPGOPTIONS.sslmode applied to both servers. The source URL's
sslmodewas applied to both connections, and the target URL's own was ignored. Each server now keeps its own.--supabaseand--sslmodeonly fill in where a URL doesn't name one.Tests
tests/Unit/PostgresSessionOptionsTest: parsing, and per-serversslmode/optionsfromtoServerAndDb.UrlSessionOptionsPostgresTest: on a live server, the source session reports the URL'sdefault_transaction_read_only=onandstatement_timeout, the target keeps its own, and the settings surviveuseSchema().🤖 Generated with Claude Code