Enhance SQL Server saga storage configuration for nvarchar identity columns#2348
Merged
jeremydmiller merged 3 commits intoJasperFx:mainfrom Mar 27, 2026
Merged
Conversation
…or nvarchar identity columns and updating related documentation and tests
Member
|
@kakins I think we could take this in when you're ready. I interpret "Ready for Review" as not really ready, so you tell me |
Contributor
Author
|
@jeremydmiller Yeah I think this is ready if you don't have many issues with it. The only thing pending was the Weasel package update. Once that new version is out there I can update the version here and retest. |
Contributor
Author
|
@jeremydmiller I didn't notice the Weasel packages were already published. Updated now. Investigating test failures. |
Contributor
Author
|
@jeremydmiller Test passing. Thanks for re-running. |
This was referenced Mar 30, 2026
This was referenced Apr 6, 2026
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 an opt-in feature to address SQL Server performance issues for string-identified sagas in Wolverine's lightweight saga storage. By default, saga tables use a
varchar(100)primary key for string IDs, but this can cause significant performance issues due to implicit conversions with ADO.NET's defaultnvarcharparameter binding, resulting in full table scans for saga table oprerations.The new option allows users to explicitly use
nvarchar(100)for string IDs, avoiding these issues. The update includes changes to configuration APIs, schema generation logic, documentation, and adds tests to verify the new behavior.TODO: Pending Weasel version update from JasperFx/weasel#223
SQL Server string saga ID schema improvements:
useNVarCharForStringIdparameter toAddSagaTypemethods inSagaConfigurationExtensions, allowing users to opt in tonvarchar(100)for string saga IDs instead of the defaultvarchar(100)in SQL Server. [1] [2]SagaTableDefinitionto store theUseNVarCharForStringIdflag and pass it through to schema generation.DatabaseSagaSchemato generate the primary key column asnvarchar(100)when the option is enabled and the ID type isstring.Testing and validation:
string_identity_schema_configuration.csto verify default and opt-in behaviors, schema migration, and delta detection for bothvarcharandnvarcharconfigurations.Documentation updates: