Add ADO.NET Persistence support for SQLite#9846
Merged
Merged
Conversation
Contributor
Author
|
@dotnet-policy-service agree |
Contributor
Author
|
@ReubenBond, @benjaminpetit could you please review this PR? Or maybe I need to create an issue first ? |
Resolve SQLite persistence query semantics, enable SQLite test dependencies, and add SQLite persistence fixture/regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
25ed001 to
58967c8
Compare
Rename SQLLite scripts to Sqlite, update references/docs, and fix ClearStorage OCC signaling for stale ETags. Add a regression test to verify stale clear requests throw InconsistentStateException. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rkargMsft
pushed a commit
to rkargMsft/orleans
that referenced
this pull request
Feb 27, 2026
* Add SQL Lite in invariantNameToConsts and SQL Script * Fix SQLite ADO.NET persistence behavior and tests Resolve SQLite persistence query semantics, enable SQLite test dependencies, and add SQLite persistence fixture/regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix Sqlite persistence gaps and naming Rename SQLLite scripts to Sqlite, update references/docs, and fix ClearStorage OCC signaling for stale ETags. Add a regression test to verify stale clear requests throw InconsistentStateException. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: KSIGZKIEWIEZ Jérôme <jerome.ksigzkiewiez@francebillet.com> Co-authored-by: Reuben Bond <reuben.bond@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Add ADO.NET Persistence support for SQLite
Description
This PR fixed the missing support for SQLite provider in
Orleans.Persistence.AdoNet.Context & Discovery
While reading the
Microsoft.Orleans.Persistence.AdoNetdocumentation on Nugget.org , it is implied that various ADO.NET providers can be used. However, I discovered that attempting to useMicrosoft.Data.Sqliteresulted in aKeyNotFoundException. Although the provider is theoretically supported by ADO.NET, the key was missing from the Orleans internal mapping, leading to a provider initialization failure. This PR addresses this gap.Changes
1. Core Logic Updates
DbConstantsStore.cs: Added entry ininvariantNameToConstsdictionary for SQL Lite with the good enum value :AdoNetInvariants.InvariantNameSqlLiteDbConstantsfor SQLite:") as escape indicators.supportsStreamNativelyandisSynchronousAdoNetImplementationtofalseto align withMicrosoft.Data.Sqlitebehavior.unionAllSelectTemplatefor compatibility with state operations.2. SQL Scripts
Added official scripts for the SQLite dialect following the project's standard structure of the other db provider :
SQLite-Main.sql: Table definitions forOrleansQuery.SQLLite-Persistence.sql: Operational commands forWrite,Read, andClearoperations.Versioncolumn.changes() = 0andINSERT ... SELECT WHERE NOT EXISTSlogic to ensure compatibility across different SQLite versions.NewGrainStateVersion,Version) required by theAdoNetGrainStorageinternal mapping.Note 1 : I have detect some error in the
Orleans.Persistence.AdoNet/README.MDbut i'm not sure if you like I change in this PR or an otherNote 2 : The dictionary
invariantNameToConstscan be rewrite in more .NET 10 look, but same as Note 1 not sure if you prefere separate PRNote 3 : I used an AI tool to help rephrase this description as my English is not perfect.
Microsoft Reviewers: Open in CodeFlow