Repository navigation
Read TimeOnly values stored as REAL in Microsoft.Data.Sqlite - #39227
Merged
AndriySvyryd merged 1 commit intoOct 14, 2026
Merged
Conversation
SqliteValueBinder writes TimeOnly as a fraction of a day when the parameter is SqliteType.Real, but SqliteDataReader.GetFieldValue<TimeOnly> only parsed text, so reading such a value back threw a FormatException. GetDateOnly and GetTimeSpan already handle FLOAT/INTEGER; do the same for TimeOnly.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved issues were identified, and all approval assessments indicate readiness.
0 open findings
What changed in this PR
Adds support for reading TimeOnly values stored as SQLite numeric day fractions.
Changes:
- Converts REAL/INTEGER values to
TimeOnly. - Adds numeric and round-trip test coverage.
| File | Description |
|---|---|
src/Microsoft.Data.Sqlite.Core/SqliteValueReader.cs |
Adds numeric TimeOnly conversion. |
test/Microsoft.Data.Sqlite.Tests/SqliteDataReaderTest.cs |
Adds numeric and round-trip tests. |
🧠 Review effort: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
AndriySvyryd
approved these changes
Oct 14, 2026
AndriySvyryd
left a comment
Member
There was a problem hiding this comment.
Thanks for your contribution!
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.
SqliteValueBinder writes TimeOnly as a fraction of a day when the parameter is SqliteType.Real, but SqliteDataReader.GetFieldValue only parsed text, so reading such a value back threw a FormatException. GetDateOnly and GetTimeSpan already handle FLOAT/INTEGER; do the same for TimeOnly.