Skip to content

Update SQLite provider docs for decimal translations and function mappings - #5496

Open
Laurianti wants to merge 1 commit into
dotnet:mainfrom
Laurianti:fix-sqlite-decimal-limitations
Open

Laurianti wants to merge 1 commit into
dotnet:mainfrom
Laurianti:fix-sqlite-decimal-limitations

Conversation

@Laurianti

Copy link
Copy Markdown

The SQLite provider pages no longer matched what EF Core generates. Checked with Microsoft.EntityFrameworkCore.Sqlite 10.0.13.

Limitations

The query limitations listed decimal among the types whose comparison and ordering have to be evaluated on the client. EF Core translates them, as the Function Mappings page and the EF Core 9 and 10 what's new pages already say:

-- Where(p => p.Price > 5m)
WHERE ef_compare("p"."Price", '5.0') > 0

-- OrderBy(p => p.Price)
ORDER BY "p"."Price" COLLATE EF_DECIMAL

decimal is now described with its translations. DateTimeOffset, TimeSpan and ulong stay in the list: ordering by them throws NotSupportedException and comparing them isn't translated.

Function mappings

  • group.Max and group.Min over a decimal property translate to ef_max and ef_min (EF Core 10.0, SQLite: implement MAX/MIN/ORDER BY for decimal efcore#35606); the rows were missing.
  • boolValue.ToString() translates to CASE WHEN @boolValue THEN 'True' ELSE 'False' END, not CAST(@boolValue AS TEXT), which would return 0 or 1.
  • dateTime.AddHours(value) used @d instead of @value, and double.RadiansToDegrees(radians) used @dradians instead of @radians.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 22:38

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 focused documentation corrections align with the provider behavior, with no unresolved blocking issues.

No open issues 🎉

What changed in this PR

Updates the SQLite provider documentation to reflect current EF Core decimal support and SQL translations.

Changes:

  • Separates supported decimal operations from the remaining query limitations.
  • Adds EF Core 10.0 decimal Max and Min aggregate mappings.
  • Corrects Boolean string conversion and parameter names in date and angle conversions.
File Description
entity-framework/​core/​providers/​sqlite/​limitations.md Clarifies decimal translation support and retains limitations for other unsupported types.
entity-framework/​core/​providers/​sqlite/​functions.md Adds decimal aggregate mappings and corrects SQL translation examples.

Review effort: Balanced

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.

2 participants