Skip to content

Conversation

@krisbiradar
Copy link

@krisbiradar krisbiradar commented Oct 10, 2025

Fixes #36749

@krisbiradar krisbiradar requested a review from a team as a code owner October 10, 2025 09:41
@cincuranet cincuranet changed the title fix:Align JSON and M.D.Sqlite representations - Fixes #36749 Align JSON and M.D.Sqlite representations Oct 10, 2025
@krisbiradar
Copy link
Author

krisbiradar commented Oct 10, 2025

@dotnet-policy-service agree

@krisbiradar
Copy link
Author

Hi @roji , can we get this merged anytime soon ?

@roji roji force-pushed the main branch 2 times, most recently from 249ae47 to 6b86657 Compare January 13, 2026 17:46
@krisbiradar
Copy link
Author

Hi @roji would like to see my changes going live any luck with that...?

@roji
Copy link
Member

roji commented Jan 23, 2026

@krisbiradar we're unfortunately very backed up with processing community PRs... I promise to do my very best to get this in for EF 11, but it may still take some time.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #36749 by aligning the JSON and Microsoft.Data.Sqlite textual representations for TimeOnly and byte[] types in SQLite. Previously, there were discrepancies where EF Core's JSON representation would preserve trailing zeros for TimeOnly values (e.g., 12:30:45.0000000), while Microsoft.Data.Sqlite would not (e.g., 12:30:45), causing comparison failures.

Changes:

  • Created SqliteJsonTimeOnlyReaderWriter to format TimeOnly values consistently with M.D.Sqlite (omitting trailing zeros when seconds are whole)
  • Modified SqliteByteArrayTypeMapping to detect JSON columns and configure parameters to use text binding for hex-encoded strings
  • Enhanced SqliteValueBinder to convert byte[] to hex strings when binding to text columns (JSON columns)

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/EFCore.Sqlite.Core/Storage/Json/Internal/SqliteJsonTimeOnlyReaderWriter.cs New SQLite-specific JSON reader/writer for TimeOnly that matches M.D.Sqlite's formatting
src/EFCore.Sqlite.Core/Storage/Internal/SqliteByteArrayTypeMapping.cs Added JSON column detection and parameter configuration to use text binding
src/EFCore.Sqlite.Core/Storage/Internal/SqliteTypeMappingSource.cs Override FindMapping to return JSON-column-aware byte array mappings
src/EFCore.Sqlite.Core/Storage/Internal/SqliteTimeOnlyTypeMapping.cs Updated to use SqliteJsonTimeOnlyReaderWriter instead of generic JsonTimeOnlyReaderWriter
src/Microsoft.Data.Sqlite.Core/SqliteValueBinder.cs Added logic to convert byte[] to hex strings when binding to text columns (for JSON)
test/EFCore.Sqlite.FunctionalTests/Update/JsonUpdateSqliteTest.cs Updated baselines to reflect new TimeOnly formatting without trailing zeros
test/EFCore.Sqlite.FunctionalTests/Types/SqliteTemporalTypeTest.cs Re-enabled Query_property_within_json test for TimeOnly
test/EFCore.Sqlite.FunctionalTests/Types/SqliteMiscellaneousTypeTest.cs Re-enabled Query_property_within_json test for byte[]
test/EFCore.Sqlite.FunctionalTests/JsonTypesSqliteTest.cs Added test overrides to verify correct TimeOnly JSON formatting
test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel*/ManyTypesEntityType.cs Updated scaffolding baselines to use SqliteJsonTimeOnlyReaderWriter

Comment on lines +59 to 60


Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

Extra blank lines should be removed. There should only be one blank line between the XML documentation comment and the next member declaration.

Copilot uses AI. Check for mistakes.
krisbiradar and others added 5 commits January 25, 2026 13:13
…peTest.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…yReaderWriter.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…e.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@krisbiradar
Copy link
Author

@krisbiradar we're unfortunately very backed up with processing community PRs... I promise to do my very best to get this in for EF 11, but it may still take some time.

Thanks for the update @roji!
looking forward to the release...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQLite: align JSON and M.D.Sqlite representations

3 participants