Skip to content

the trait postgres::types::ToSql is not implemented for the type rustc-serialize::json::Json #102

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
s-panferov opened this issue Feb 25, 2015 · 1 comment

Comments

@s-panferov
Copy link
Contributor

Hello @sfackler. I noticed that support of Json suddenly stopped working. The small example to reproduce https://github.com/s-panferov/postgres-test.

➜  postgres-test git:(master) ✗ cargo test
   Compiling postgres-test v0.0.1 (file:///Users/panferov/Workspace/my/postgres-test)
src/main.rs:17:18: 17:23 error: the trait `postgres::types::ToSql` is not implemented for the type `rustc-serialize::json::Json` [E0277]
src/main.rs:17     stmt.query(&[&json]).unwrap()
                                ^~~~~

What can be wrong?

@sfackler
Copy link
Owner

The cargo.toml has a * dependency on rustc-serialize, while rust-postgres has a dependency on 0.2. It looks like cargo is pulling in both an 0.2 version and an 0.3 version at the same time. If you change the dependency from * to 0.2 it works. Seems like a bug to file on Cargo.

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