Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upFeature Request: Converting between `Interval` and `chrono::Duration` #922
Comments
This comment has been minimized.
|
The question is how do you translate |
This comment has been minimized.
|
Thank you for pointing the problem out. I found I confused duration with interval, it's intervals on the calendar, not time intervals. Then I close this as invalid request. I'm sorry for troubling you. |
KeenS
closed this
May 29, 2017
This comment has been minimized.
vityafx
commented
Feb 6, 2018
|
I have implemented storing of chrono::Duration in the BigInt field of SQLite 3. I decided to use BigInt since it converts to i64 type which is the minimal unit the chrono::Duration. I am gonna implement it for the pgsql too tomorrow. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
KeenS commentedMay 26, 2017
I want to use
intervaltype in PostgreSQL with diesel. The counter part sql type in diesel isdiesel::types::Interval.diesel::types::Intervalcan be converted only from and toPgInterval(CF http://docs.diesel.rs/diesel/types/struct.Interval.html) but it's not so convenient using around in the program because it cannot interact with chrono types and it seems to depends on Postgresql.Thus to interact with chrono types and to be independent from postgresql (and diesel itself), I want to select
intervaltype from the DB asDurationtype.