Conversation
Enhanced MigrationCommand.Execute to support YAML/JSON data files, requiring '>' prefix for raw SQL. Updated docs, help text, and changelog. Improved error handling and logging. Schema inspection now shows JSON columns; unified JSON detection logic across DBs. Added SQL Server JSON support. Refactored and expanded migration tests, including YAML data seeding. Version bumped to 3.2.0.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bumps DbEx to v3.2.0 and updates the migration tooling to (1) allow Execute to run YAML/JSON data files in addition to SQL, and (2) extend Inspect output to include a JSON column indicator derived from DbColumnSchema.IsJsonContent.
Changes:
- Enhanced
MigrationCommand.Executeto accept file paths (SQL/YAML/JSON) and require raw SQL to be prefixed with>. - Extended
Inspectmarkdown output to include aJSONcolumn per database provider. - Updated tests/docs/changelog/versioning to reflect the new behaviors.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/DbEx.Test/SqlServerMigrationTest.cs | Updates execute tests for the new > raw SQL prefix and adds a YAML execution test. |
| tests/DbEx.Test/Resources/SqlServerInspect.md | Updates expected Inspect output to include the JSON column. |
| tests/DbEx.Test/Resources/PostgresInspect.md | Updates expected Inspect output to include the JSON column. |
| tests/DbEx.Test/Resources/MySqlInspect.md | Updates expected Inspect output to include the JSON column. |
| tests/DbEx.Test/DbEx.Test.csproj | Ensures Data.yaml is copied to test output for execution tests. |
| tests/DbEx.Test/Data.yaml | Adds YAML seed data used by the new Execute YAML test. |
| src/DbEx/Migration/DatabaseMigrationBase.cs | Implements Execute support for YAML/JSON files, updates execute messaging, adds JSON column to Inspect output, and improves command error handling. |
| src/DbEx/Console/MigrationConsoleBase.cs | Updates CLI help text for Execute’s additional args. |
| src/DbEx.SqlServer/SqlServerSchemaConfig.cs | Improves JSON content detection and maps JSON type to string. |
| src/DbEx.Postgres/PostgresSchemaConfig.cs | Fixes JSON content detection logic to use DotNetType. |
| src/DbEx.MySql/MySqlSchemaConfig.cs | Fixes JSON content detection logic to use DotNetType. |
| README.md | Updates Execute command documentation to explain > raw SQL prefix and YAML/JSON support. |
| Common.targets | Bumps version to 3.2.0. |
| CHANGELOG.md | Adds v3.2.0 entries describing the new Execute/Inspect enhancements. |
Suppressed comments (1)
CHANGELOG.md:7
- The changelog references
DbColumnSchema.IsJson, but the actual property isDbColumnSchema.IsJsonContent. This makes the entry misleading for users trying to find/consume the feature.
- *Enhancement:* The `MigrationCommand.Inspect` has been enhanced to also report whether each column has been identified as a JSON column (i.e. `DbColumnSchema.IsJson`).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…fix strip, test prefix, help text, and BOM
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.
v3.2.0
MigrationCommand.Executehas been enhanced to support the execution of YAML/JSON data files. Raw SQL must now be prefixed by>to explicity differentiate from a file path.MigrationCommand.Inspecthas been enhanced to also report whether each column has been identified as a JSON column (i.e.DbColumnSchema.IsJson).