Skip to content

Trait FromSql not implemented for time::Timespec #103

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

Closed
debuuu opened this issue Mar 24, 2015 · 2 comments
Closed

Trait FromSql not implemented for time::Timespec #103

debuuu opened this issue Mar 24, 2015 · 2 comments

Comments

@debuuu
Copy link

debuuu commented Mar 24, 2015

I've run into this compile error a few times whilst I've been using rust-postgres, but having updated to the latest Rust compiler (1.0.0-nightly 2015-03-22) yesterday night, which brought the problem back out, I've been unable to solve it.

Basically I'm just trying to use time::Timespec with rust-postgres, and I get a compile error whenever I try to do something that would require ToSql or FromSql to be implemented for it. I see that both do have implementations in source, and have tried including postgres::types::*, but nothing seems to work.

I also tried setting my dependencies to time 0.1.14; postgres 0.7, but on-compile it still always downloads the latest versions.

Any idea what I might be doing wrong?

@sfackler
Copy link
Owner

Timespec support is optional, and can be enabled by turning on the time feature: https://github.com/sfackler/rust-postgres#timestamptimestamptz-types

[dependencies.postgres]
version = "0.7"
features = ["time"]

@debuuu
Copy link
Author

debuuu commented Mar 24, 2015

Ah..! I was wondering on the front page when it mentions the time support being "optionally provided", if that meant there was some special Cargo flag. Thanks a lot, compiles again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants