Summary
Add a --dry-run (-dr) CLI option that lists all recursively referenced views and exits without performing any inlining. Useful for understanding the view dependency tree before committing to an inline operation.
Expected behavior
sqlinliner -cs "Server=.;Database=Test;Integrated Security=true" -vn "dbo.VHeavy" --dry-run
Should output the fully qualified names of all referenced views (recursively), then exit.
Implementation notes
From the previous attempt (PR #74, branch codex/add-dry-run-option-for-referenced-views):
- Add a static
DatabaseView.GetReferencedViews(DatabaseConnection, string viewSql) method that recursively resolves all nested views into a Dictionary<string, DatabaseView>
- Add
--dry-run / -dr option to Program.cs (using the new System.CommandLine 2.0.3 API)
- When
--dry-run is set, call GetReferencedViews, print each view name, and return early
The previous branch is stale and won't merge due to the System.CommandLine 2.0.3 migration and test suite changes on main.
Supersedes PR #74.
Summary
Add a
--dry-run(-dr) CLI option that lists all recursively referenced views and exits without performing any inlining. Useful for understanding the view dependency tree before committing to an inline operation.Expected behavior
Should output the fully qualified names of all referenced views (recursively), then exit.
Implementation notes
From the previous attempt (PR #74, branch
codex/add-dry-run-option-for-referenced-views):DatabaseView.GetReferencedViews(DatabaseConnection, string viewSql)method that recursively resolves all nested views into aDictionary<string, DatabaseView>--dry-run/-droption toProgram.cs(using the new System.CommandLine 2.0.3 API)--dry-runis set, callGetReferencedViews, print each view name, and return earlyThe previous branch is stale and won't merge due to the System.CommandLine 2.0.3 migration and test suite changes on
main.Supersedes PR #74.