{"action":"created","issue":{"url":"https://api.github.com/repos/sgrif/diesel/issues/50","labels_url":"https://api.github.com/repos/sgrif/diesel/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/sgrif/diesel/issues/50/comments","events_url":"https://api.github.com/repos/sgrif/diesel/issues/50/events","html_url":"https://github.com/sgrif/diesel/issues/50","id":120495349,"number":50,"title":"#[changeset_for] codegen issue","user":{"login":"mcasper","id":6878025,"avatar_url":"https://avatars.githubusercontent.com/u/6878025?v=3","gravatar_id":"","url":"https://api.github.com/users/mcasper","html_url":"https://github.com/mcasper","followers_url":"https://api.github.com/users/mcasper/followers","following_url":"https://api.github.com/users/mcasper/following{/other_user}","gists_url":"https://api.github.com/users/mcasper/gists{/gist_id}","starred_url":"https://api.github.com/users/mcasper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcasper/subscriptions","organizations_url":"https://api.github.com/users/mcasper/orgs","repos_url":"https://api.github.com/users/mcasper/repos","events_url":"https://api.github.com/users/mcasper/events{/privacy}","received_events_url":"https://api.github.com/users/mcasper/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-04T22:01:56Z","updated_at":"2015-12-04T23:15:22Z","closed_at":"2015-12-04T23:13:40Z","body":"Trying to use `#[changeset_for]` for the struct:\r\n```Rust\r\n#[changeset_for(users)]\r\npub struct UserChanges {\r\n    id: i32,\r\n    first_name: Option<String>,\r\n    last_name: Option<String>,\r\n    email: Option<String>,\r\n}\r\n```\r\n\r\nProduces the error: \r\n```\r\nsrc/main.rs:33:24: 33:24 error: the trait `diesel::query_source::Queriable<(diesel::types::Integer, diesel::types::VarChar, diesel::types::VarChar, diesel::types::VarChar)>` is not implemented for the type `UserChanges` [E0277]\r\nsrc/main.rs:33 #[changeset_for(users)]\r\n                                      ^\r\nsrc/main.rs:33:1: 33:24 note: in this expansion of try! (defined in <std macros>)\r\nsrc/main.rs:33:24: 33:24 help: run `rustc --explain E0277` to see a detailed explanation\r\nerror: aborting due to previous error\r\n```\r\n\r\nHowever, adding `#[derive(Queriable)]` to the struct annotation raises the error:\r\n```\r\nsrc/main.rs:34:24: 34:24 error: the trait `diesel::types::FromSqlRow<(diesel::types::Integer, diesel::types::VarChar, diesel::types::VarChar, diesel::types::VarChar)>` is not implemented for the type `(i32, core::option::Option<collections::string::String>, core::option::Option<collections::string::String>, core::option::Option<collections::string::String>)` [E0277]\r\nsrc/main.rs:34 #[changeset_for(users)]\r\n                                      ^\r\nsrc/main.rs:34:1: 34:24 note: in this expansion of try! (defined in <std macros>)\r\nsrc/main.rs:34:24: 34:24 help: run `rustc --explain E0277` to see a detailed explanation\r\nerror: aborting due to previous error\r\n```\r\n\r\nHalp"},"comment":{"url":"https://api.github.com/repos/sgrif/diesel/issues/comments/162107524","html_url":"https://github.com/sgrif/diesel/issues/50#issuecomment-162107524","issue_url":"https://api.github.com/repos/sgrif/diesel/issues/50","id":162107524,"user":{"login":"mcasper","id":6878025,"avatar_url":"https://avatars.githubusercontent.com/u/6878025?v=3","gravatar_id":"","url":"https://api.github.com/users/mcasper","html_url":"https://github.com/mcasper","followers_url":"https://api.github.com/users/mcasper/followers","following_url":"https://api.github.com/users/mcasper/following{/other_user}","gists_url":"https://api.github.com/users/mcasper/gists{/gist_id}","starred_url":"https://api.github.com/users/mcasper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcasper/subscriptions","organizations_url":"https://api.github.com/users/mcasper/orgs","repos_url":"https://api.github.com/users/mcasper/repos","events_url":"https://api.github.com/users/mcasper/events{/privacy}","received_events_url":"https://api.github.com/users/mcasper/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T23:15:22Z","updated_at":"2015-12-04T23:15:22Z","body":"Definitely, that's awesome! "}}