Enhance diff command with normalized output and compatibility handling#56
Open
Enhance diff command with normalized output and compatibility handling#56
Conversation
…le formatting during comparison
…tting during comparison
- Introduced a new command line option `--normalized-diff` in `DiffCommandSettings` to control the normalization of diff output. - Updated `RunDiff` method in `ISyncCommandService` and its implementation to accept a new parameter for normalized diff. - Modified the `SyncCommandService` to handle normalized diff logic in the diff generation process. - Enhanced the `BuildUnifiedDiff` method to support normalized diff rendering. - Updated tests to verify the behavior of the new normalized diff feature.
…e permissions - Implement tests to recognize and filter excluded stored procedures related to database diagrams in SqlServerIntrospectorTests. - Enhance SqlServerScripterTests with functionality to script roles and users, including permissions for user-defined types. - Introduce unified diff tests in SyncCommandServiceTests to handle permission order differences and suppress irrelevant changes for user-defined types and tables. - Ensure consistent handling of user and role permissions in unified diffs, including suppression of terminal GO statements.
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.
This pull request introduces several enhancements and compatibility improvements to the SQL schema comparison and scripting tool. The most significant changes include new normalization and compatibility rules for diffing scripts, improved diff output readability, expanded scripting of object permissions and options, and more precise discovery and exclusion of certain system objects. Additionally, new CLI options and behaviors have been documented to aid debugging and provide more control over output.
Diff and Comparison Normalization Improvements:
TableDatascripts as compatible when single-rowINSERTcolumn lists and value tuples are reordered consistently, and improved handling of contiguousINSERTstatement ordering. [1] [2] [3]Table,UserDefinedType, and constraint formatting, including handling of inline constraints and permission statement ordering. [1] [2] [3]GObatches as compatible. [1] [2] [3]Diff Output and CLI Enhancements:
--normalized-diffoption tosqlct difffor rendering comparison-normalized diff text for debugging, while preserving readable diff output by default. [1] [2] [3] [4]Scripting and Discovery Updates:
RoleandUserprincipals, including support for loginless users (CREATE USER ... WITHOUT LOGIN). [1] [2]TYPE::permissions for scalar and table-valuedUserDefinedTypeobjects.Table and Index Option Scripting:
WITHoptions is now strictly specified. [1] [2] [3]Documentation and Spec Updates:
These changes collectively improve compatibility detection, script readability, and user control over diff output, while ensuring more accurate and deterministic schema scripting.