feat: implement To/FromDbValue for chrono::DateTime<Utc>#474
Merged
Conversation
There was a problem hiding this comment.
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, andToDbValueforchrono::DateTime<Utc>and its Option variant - Moves
DateTime<FixedOffset>implementations fromfields.rsto a newchrono_fields.rsmodule - Refactors macro definitions to use fully qualified paths (e.g.,
crate::db::Resultinstead ofResult)
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.
|
| Branch | db-fields-chrono-utc |
| Testbed | github-ubuntu-latest |
Click to view all benchmark results
| Benchmark | Latency | Benchmark 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%) |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
seqre
approved these changes
Feb 5, 2026
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.
No description provided.