Repository navigation
Conversation
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.
Summary
Adds optional support for the Jiff date-time library (0.2) by implementing
ToSqlandFromSqlfor its types, behind a newwith-jiff-0_2feature.This is a port of the existing upstream implementation in rust-postgres/rust-postgres. It is not new design work, and the credit for the original goes to the upstream authors.
Supported types
jiff::TimestampTIMESTAMPTZjiff::civil::DateTimeTIMESTAMPjiff::civil::DateDATEjiff::civil::TimeTIMEThe
Timestamp/Datewrappers forinfinity/-infinityalso work with these types. Without the wrapper, decoding an infinite value returns an error instead of panicking.Usage
Differences from upstream
tokio-postgres, whereError'sDisplaystill appends the cause. Because of that,test_special_params_without_wrapperasserts"error deserializing column 0: value too large to decode"rather than the shorter string used upstream after rust-postgres/rust-postgres@c5d3442.Testing
Tested against PostgreSQL 18 (Homebrew, macOS/aarch64).