feat: add explicit dump subcommand - #22
Merged
Merged
Conversation
dump was the only action without a name, implicit whenever no subcommand was given. Make it a real subcommand and keep the bare form working as a shorthand. Options are split into common/source/selection/dump groups, declared on the root parser as hidden aliases and on each subcommand with SUPPRESS defaults so values parsed before the verb are not clobbered. migrate and validate now accept the source and filtering flags after the verb too.
Readers logged the full connection URL, password included, while writers already redacted theirs. Credentials were also interpolated raw, so a password containing @ / or : produced a broken URL. Centralise URL assembly in infrastructure/url.py: credentials are percent-encoded and every log line goes through redact_url.
Expose the SQLAlchemy URL that readers and writers already build internally. This is the only way to reach driver-specific parameters (sslmode, charset, TrustServerCertificate), to pick another DBAPI for the same dialect, or to describe an Oracle service_name without a config file. A DSN replaces the connection instead of merging with it; the discrete fields it shadows are reported. Its dialect is checked against the selected driver, since SQLAlchemy resolves the dialect from the URL and would otherwise connect before failing inside introspection.
The plugin example READMEs, plugins.rst and the configuration recipes still invoked db2sql without a command. The example READMEs also used a lowercase -c, which has never been a valid flag. Also state that the init wizard does not generate a DSN.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #22 +/- ##
==========================================
+ Coverage 90.66% 92.05% +1.38%
==========================================
Files 77 78 +1
Lines 3076 3159 +83
==========================================
+ Hits 2789 2908 +119
+ Misses 287 251 -36
🚀 New features to boost your workflow:
|
Both properties are pure functions of the config, but were only reachable through the functional suite, which does not run on every pull request. This also puts the --target-dsn path and the target-side password redaction under test without needing a live server.
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.
dump was the only action without a name, implicit whenever no subcommand was given. Make it a real subcommand and keep the bare form working as a shorthand.
Options are split into common/source/selection/dump groups, declared on the root parser as hidden aliases and on each subcommand with SUPPRESS defaults so values parsed before the verb are not clobbered. migrate and validate now accept the source and filtering flags after the verb too.