Skip to content

Add static to the lambdas for functions/aggregates/collations (and explicit names). - #38892

Merged
AndriySvyryd merged 3 commits into
dotnet:mainfrom
cincuranet:sqlite-func-static
Sep 3, 2026
Merged

AndriySvyryd merged 3 commits into
dotnet:mainfrom
cincuranet:sqlite-func-static

Conversation

@cincuranet

@cincuranet cincuranet commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review only last commit. This is on top of #38891 (and stacked PRs are not supported when creating PR from fork).

Copilot AI lite review requested due to automatic review settings September 1, 2026 09:37
@cincuranet
cincuranet requested a review from a team as a code owner September 1, 2026 09:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Pull request overview

This PR improves EF Core’s SQLite provider behavior around decimal ordering by making the EF_DECIMAL collation resilient to non-standard/invalid stored values (including scientific notation), and modernizes the registration of SQLite functions/aggregates/collations by using static lambdas and explicit name: arguments.

Changes:

  • Update SQLite connection initialization to register functions/aggregates/collations with static lambdas and explicit name: usage.
  • Change EF_DECIMAL collation to use decimal.TryParse(... AllowExponent ...) and fall back to ordinal comparison for values that can’t be parsed as decimals.
  • Add a functional test covering ORDER BY on decimals when the database contains invalid/non-decimal values.
File summaries
File Description
test/EFCore.Sqlite.FunctionalTests/BuiltInDataTypesSqliteTest.cs Adds a regression test validating decimal ordering with invalid/scientific-notation stored values.
src/EFCore.Sqlite.Core/Storage/Internal/SqliteRelationalConnection.cs Updates built-in SQLite function/aggregate/collation registration and makes EF_DECIMAL collation robust to invalid values.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 1, 2026 09:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 3, 2026 18:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are a mechanical refactor (verified named-argument parameter names match the underlying APIs) and should not alter behavior while improving clarity and avoiding captures.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@AndriySvyryd
AndriySvyryd merged commit 6828689 into dotnet:main Sep 3, 2026
15 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 4, 2026
@cincuranet
cincuranet deleted the sqlite-func-static branch September 4, 2026 07:15
AndriySvyryd pushed a commit that referenced this pull request Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants