Feedback to upgrade jiff to 0.1.16 #174
tisonkun
started this conversation in
Experience Reports
Replies: 2 comments 13 replies
-
For anyone who would like to upgrade to 0.1.16 and have an option to switch back the previous format, check out https://docs.rs/jiff/latest/jiff/fmt/temporal/struct.SpanPrinter.html. |
Beta Was this translation helpful? Give feedback.
5 replies
-
For (3), I consider that part of ecosystem integration. My focus hasn't really shifted to that yet. For (2), is there any actionable feedback there? I'm not clear on what you're saying exactly. :) For (1), do you have any alternative suggestions? The conversion from SignedDuration to Duration is fallible. So there has to be an error path in there somewhere. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @BurntSushi! Thanks for your continuous work and the recent f6fc1b0 and 1e39b60 released in 0.1.16.
I have upgraded jiff to 0.1.16 for our database software. Here is the patch to demonstrate that the changeset (from 0.1.13) is relatively small: https://gist.github.com/tisonkun/183e761fdf8d26a4799f91f6ba3cbe80
Briefly, we use SignedDuration as the internal representation of the database's
Interval
type, and now try to use it in the HTTP request to reduce the dependency to humantime/humantime-serde.Here are three remaining issues I'm considering now.
Although I think this is by design (std's Duration is unsigned), the
.try_into.map_err
/.try_into.except
is a bit noisy.Ecosystems like
tokio
don't integrate withjiff
's type (yet?), so we have to manage such boilerplate code in the application.Span
as the representation of a new interval type.We use
SignedDuration
as the internal representation because it has a natural mapping from/to nanoseconds. While withSpan
, we may need to store the whole string or a few of accurate parts. In the upside,Span
allows user to specify intervals with days, months, years, etc., which can be more intuitive in some case.Software like Apache Arrow has multiple types for duration and interval and that may be the way to go.
sqlx_jiff
internal wrapper.This is unrelated to 0.1.16 but we're now internally maintain a mod to do the same thing exactly for what #141 does. If it can get some reviews, it would be great :P
Thanks again for this wonderful crate. I find it quite ergonomic and has the minimum friction to use.
Beta Was this translation helpful? Give feedback.
All reactions