Summary
The validation summary and sanitization results are only printed to the console. There is no way to persist the output for auditing, CI artifact storage, or integration with external tools.
Current Limitation
CommandHelpers.cs renders results as a Spectre.Console table to stdout only. No file output is supported.
Proposed Approach
Add a --report-file option to all commands:
dotnet DbMigrator run --config config.yaml --report-file report.json
dotnet DbMigrator validate --config config.yaml --report-file report.json --report-format json
Supported formats:
json — structured report with per-table results, counts, warnings, errors
csv — flat table per rule with status
Example JSON output:
{
"timestamp": "2025-04-06T10:00:00Z",
"command": "run",
"status": "success",
"tables": [
{ "table": "users", "rows_updated": 1500, "columns": 3, "warnings": [] },
{ "table": "payments", "rows_updated": 800, "columns": 1, "warnings": [] }
]
}
Acceptance Criteria
Summary
The validation summary and sanitization results are only printed to the console. There is no way to persist the output for auditing, CI artifact storage, or integration with external tools.
Current Limitation
CommandHelpers.csrenders results as a Spectre.Console table to stdout only. No file output is supported.Proposed Approach
Add a
--report-fileoption to all commands:Supported formats:
json— structured report with per-table results, counts, warnings, errorscsv— flat table per rule with statusExample JSON output:
{ "timestamp": "2025-04-06T10:00:00Z", "command": "run", "status": "success", "tables": [ { "table": "users", "rows_updated": 1500, "columns": 3, "warnings": [] }, { "table": "payments", "rows_updated": 800, "columns": 1, "warnings": [] } ] }Acceptance Criteria
--report-file <path>saves the report to the specified file--report-format json|csvcontrols the output format (default: json)validate,sanitize, andruncommands