Skip to content
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

Negative chrono::Duration panics #736

Closed
Yarn opened this issue Oct 14, 2020 · 1 comment · Fixed by #1475
Closed

Negative chrono::Duration panics #736

Yarn opened this issue Oct 14, 2020 · 1 comment · Fixed by #1475
Labels
bug db:postgres Related to PostgreSQL E-medium

Comments

@Yarn
Copy link

Yarn commented Oct 14, 2020

When encoding a chrono duration sqlx converts it into an std duration which doesn't support negative durations. Durations from the time crate aren't handled this way.

The conversion

value.to_std()?.try_into()

The expect that panics

let pg_interval = PgInterval::try_from(*self).expect("Failed to encode chrono::Duration");

@yuyawk
Copy link
Contributor

yuyawk commented Oct 30, 2021

I resolved this issue at #1475 , but am waiting for reviewers to approve my PR.

quoted:

1 workflow awaiting approval
First-time contributors need a maintainer to approve running workflows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug db:postgres Related to PostgreSQL E-medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants