-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for (Pg)Interval with chrono::Duration #237
base: master
Are you sure you want to change the base?
Conversation
@Rudi3 hello, are there any plans to finish?) |
@ikrivosheev hello, i have to admit that I forgot about it. |
@Rudi3 which uncertainty with |
@ikrivosheev src/driver/postgres.rs I decided to throw unimplemented if |
Ah... I understood! We can create issue in postgres-types and wait for implantation or implement it yourself. I will create issue. |
Found: sfackler/rust-postgres#60 |
Hey @Rudi3, welcome back! After second thought, I think we can support |
Hey, @billy1624! |
@Rudi3 any update on this? |
Hey @Rudi3, I'm sorry for the delay.
I think We could get this PR merge before moving on to SeaQL/sea-orm#456 |
Hello, I revised this PR and noticed that For now, I opted for the ISO8601 duration format that's provided by So maybe I should rewrite the formatter to do exactly this. Furthermore, the maximum allowed precision is 6. So should any other digits be rounded/cut off/etc? Also, maybe it's possible to optimize the format to just provide total seconds with up to 6 decimal places - if ISO8601 and postgres allow for this. This would also dodge the multiple field issue related to the sign. Requesting some feedback on this and maybe confirmation of my assumption about the Edit: sea-query-binder/src/sqlx_postgres.rs seems to be doing all the work when writing but I'm not sure if it's sufficient - as the duration is just passed over as far as I can see. Currently, it appears to be working with |
Is there any advancement on this? Is there anything I can help with? |
Hi guys, is there any update about this PR? |
Preparation for
SeaQL/sea-orm#426
Support for
std::time::Duration
chrono::Duration
I'm not sure if it makes sense to use
std::time::Duration
withoutchrono
postgres-types
doesn't seem to supportToSql
forchrono::Duration
- at least it wasn't listed in the docs. So I'm not sure if this is a big deal inpostgres.rs
sqlx
will panic if a conversion fails; if:PgInterval
can storePgInterval