Repository navigation
#244 passwords containing url reserved characters cause invalid port number error - #249
Merged
nettrash merged 1 commit intoSep 6, 2026
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change addresses the documented root cause by removing URL parsing from the credential path and adds targeted unit, live, and CI coverage to prevent regressions.
Pull request overview
Fixes issue #244 where passwords containing RFC 3986 URL-reserved characters (e.g., #, /, ?, %, @) caused pgc --command dump to fail during URL parsing (often surfaced as the misleading invalid port number) by eliminating URL-based connection construction and switching to sqlx::PgConnectOptions.
Changes:
- Replace
postgres://...string construction withDumpConfig::get_connect_options()returningPgConnectOptionsand useconnect_with(...)for database connections. - Update and expand unit/integration tests to assert credentials are not rewritten (including
%41not being percent-decoded). - Add a CI workflow step that exercises the reserved-character password scenario against a live PostgreSQL instance.
File summaries
| File | Description |
|---|---|
| CHANGELOG | Documents the issue #244 fix and its impact/behavior change. |
| app/tests/live_database.rs | Adds an ignored live-db test ensuring reserved-character passwords authenticate as typed. |
| app/src/dump/core.rs | Switches connection setup to connect_with(PgConnectOptions) and improves config-error reporting. |
| app/src/config/tests/dump_config.rs | Reworks tests to validate PgConnectOptions behavior and pins the legacy URL lossy behavior. |
| app/src/config/dump_config.rs | Introduces get_connect_options() using PgConnectOptions::new_without_pgpass() with explicit port parsing. |
| .github/workflows/rust.yml | Adds CI coverage for the reserved-character password case by creating a role and dumping as it. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
nettrash
deleted the
244-passwords-containing-url-reserved-characters-cause-invalid-port-number-error
branch
September 6, 2026 08:23
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.
closes #244