Skip to content

feat: implement To/FromDbValue for chrono::DateTime<Utc>#474

Merged
m4tx merged 5 commits intomasterfrom
db-fields-chrono-utc
Feb 5, 2026
Merged

feat: implement To/FromDbValue for chrono::DateTime<Utc>#474
m4tx merged 5 commits intomasterfrom
db-fields-chrono-utc

Conversation

@m4tx
Copy link
Member

@m4tx m4tx commented Feb 4, 2026

No description provided.

@github-actions github-actions bot added the C-lib Crate: cot (main library crate) label Feb 4, 2026
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 implements To/FromDbValue traits for chrono::DateTime<Utc> and refactors chrono-related database field implementations by moving them to a dedicated module. The changes improve code organization while maintaining consistency with existing patterns.

Changes:

  • Implements DatabaseField, FromDbValue, and ToDbValue for chrono::DateTime<Utc> and its Option variant
  • Moves DateTime<FixedOffset> implementations from fields.rs to a new chrono_fields.rs module
  • Refactors macro definitions to use fully qualified paths (e.g., crate::db::Result instead of Result)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cot/src/db/fields/chrono_fields.rs New module containing implementations for DateTime<FixedOffset> (moved) and DateTime<Utc> (new), following the same patterns for database field traits
cot/src/db/fields.rs Refactored macros with fully qualified paths, added module declaration for chrono_fields, removed DateTime<FixedOffset> implementations (moved to new module), added use statements to export macros for use in submodules

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

🐰 Bencher Report

Branchdb-fields-chrono-utc
Testbedgithub-ubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
empty_router/empty_router📈 view plot
🚷 view threshold
5,728.00 µs
(-3.23%)Baseline: 5,918.90 µs
7,094.47 µs
(80.74%)
json_api/json_api📈 view plot
🚷 view threshold
1,047.70 µs
(+3.15%)Baseline: 1,015.70 µs
1,162.70 µs
(90.11%)
nested_routers/nested_routers📈 view plot
🚷 view threshold
956.19 µs
(+2.18%)Baseline: 935.79 µs
1,064.83 µs
(89.80%)
single_root_route/single_root_route📈 view plot
🚷 view threshold
911.97 µs
(+1.69%)Baseline: 896.78 µs
1,022.90 µs
(89.16%)
single_root_route_burst/single_root_route_burst📈 view plot
🚷 view threshold
18,161.00 µs
(+3.33%)Baseline: 17,575.45 µs
20,848.85 µs
(87.11%)
🐰 View full continuous benchmarking report in Bencher

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 76.19048% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cot/src/db/fields/chrono_fields.rs 66.10% 19 Missing and 1 partial ⚠️
Flag Coverage Δ
rust 89.65% <76.19%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cot/src/db/fields.rs 86.09% <100.00%> (+4.46%) ⬆️
cot/src/db/fields/chrono_fields.rs 66.10% <66.10%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@m4tx m4tx merged commit 97d4b3e into master Feb 5, 2026
39 of 40 checks passed
@m4tx m4tx deleted the db-fields-chrono-utc branch February 5, 2026 08:50
@cotbot cotbot bot mentioned this pull request Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-lib Crate: cot (main library crate)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants