{"action":"opened","number":1231,"pull_request":{"url":"https://api.github.com/repos/diesel-rs/diesel/pulls/1231","id":144070338,"html_url":"https://github.com/diesel-rs/diesel/pull/1231","diff_url":"https://github.com/diesel-rs/diesel/pull/1231.diff","patch_url":"https://github.com/diesel-rs/diesel/pull/1231.patch","issue_url":"https://api.github.com/repos/diesel-rs/diesel/issues/1231","number":1231,"state":"open","locked":false,"title":"[WIP] Restructure codegen crates","user":{"login":"weiznich","id":1674512,"avatar_url":"https://avatars1.githubusercontent.com/u/1674512?v=4","gravatar_id":"","url":"https://api.github.com/users/weiznich","html_url":"https://github.com/weiznich","followers_url":"https://api.github.com/users/weiznich/followers","following_url":"https://api.github.com/users/weiznich/following{/other_user}","gists_url":"https://api.github.com/users/weiznich/gists{/gist_id}","starred_url":"https://api.github.com/users/weiznich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weiznich/subscriptions","organizations_url":"https://api.github.com/users/weiznich/orgs","repos_url":"https://api.github.com/users/weiznich/repos","events_url":"https://api.github.com/users/weiznich/events{/privacy}","received_events_url":"https://api.github.com/users/weiznich/received_events","type":"User","site_admin":false},"body":"This pull request splits diesel_codegen into 2 crates.\r\n\r\nOne crate containing all model custom derives (`Queryable`,\r\n`Identifiable`, `Insertable`, `AsChangeset`, `Associations`). This\r\ncrate (`diesel_codegen`) only consist of code not depending on diesel\r\nitself. This allows us to reexport all model derives through diesel\r\nitself. (A user only needs to write `#[macro_use] extern crate\r\ndiesel;` instead of `#[macro_use] extern crate diesel; #[macro_use]\r\nextern crate diesel_codegen;`)\r\n\r\nAll codegen code that depends on diesel is moved to a new crate called\r\n`diesel_proc_macro_internal`. This crate contains the custom derives\r\nfor `infer_schema!`, `infer_table_from_schema!` and\r\n`embed_migrations!`. The corresponding macros are removed from diesel\r\nitself and moved to a new crate called `diesel_proc_macro`, which\r\nreexports the underlying custom derives. This ensures those macros\r\nworks without importing another crate.\r\n\r\nThe used mechanism is very similar to that what [serde](https://github.com/serde-rs/serde/blob/master/serde/src/lib.rs#L283) does.\r\n\r\nI propose this change for the following reasons:\r\n\r\n- Makes it easier and less error prone to use the provided custom derives\r\n- Allows us to include the documentation for the custom derives in diesels api documentation (currently suppressed by `#[doc(hidden)]`\r\n- Makes it less error prone to use our proc macro 2.0 workaround. (There is now no way to use this macros without having the underlying custom derives imported.)\r\n\r\nThis pull request should show the general impact of such a change. Feel free to close it if this kind of change is not wanted.\r\n\r\nThings to do:\r\n\r\n- [ ] Write changelog\r\n- [ ] See if all tests passes","created_at":"2017-10-01T13:23:08Z","updated_at":"2017-10-01T13:23:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/diesel-rs/diesel/pulls/1231/commits","review_comments_url":"https://api.github.com/repos/diesel-rs/diesel/pulls/1231/comments","review_comment_url":"https://api.github.com/repos/diesel-rs/diesel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diesel-rs/diesel/issues/1231/comments","statuses_url":"https://api.github.com/repos/diesel-rs/diesel/statuses/9c6779910db4f18e2103237490e0356eccd9d7a2","head":{"label":"weiznich:improve/codegen_import","ref":"improve/codegen_import","sha":"9c6779910db4f18e2103237490e0356eccd9d7a2","user":{"login":"weiznich","id":1674512,"avatar_url":"https://avatars1.githubusercontent.com/u/1674512?v=4","gravatar_id":"","url":"https://api.github.com/users/weiznich","html_url":"https://github.com/weiznich","followers_url":"https://api.github.com/users/weiznich/followers","following_url":"https://api.github.com/users/weiznich/following{/other_user}","gists_url":"https://api.github.com/users/weiznich/gists{/gist_id}","starred_url":"https://api.github.com/users/weiznich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weiznich/subscriptions","organizations_url":"https://api.github.com/users/weiznich/orgs","repos_url":"https://api.github.com/users/weiznich/repos","events_url":"https://api.github.com/users/weiznich/events{/privacy}","received_events_url":"https://api.github.com/users/weiznich/received_events","type":"User","site_admin":false},"repo":{"id":50463767,"name":"diesel","full_name":"weiznich/diesel","owner":{"login":"weiznich","id":1674512,"avatar_url":"https://avatars1.githubusercontent.com/u/1674512?v=4","gravatar_id":"","url":"https://api.github.com/users/weiznich","html_url":"https://github.com/weiznich","followers_url":"https://api.github.com/users/weiznich/followers","following_url":"https://api.github.com/users/weiznich/following{/other_user}","gists_url":"https://api.github.com/users/weiznich/gists{/gist_id}","starred_url":"https://api.github.com/users/weiznich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weiznich/subscriptions","organizations_url":"https://api.github.com/users/weiznich/orgs","repos_url":"https://api.github.com/users/weiznich/repos","events_url":"https://api.github.com/users/weiznich/events{/privacy}","received_events_url":"https://api.github.com/users/weiznich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weiznich/diesel","description":"A safe, extensible ORM and Query Builder for Rust","fork":true,"url":"https://api.github.com/repos/weiznich/diesel","forks_url":"https://api.github.com/repos/weiznich/diesel/forks","keys_url":"https://api.github.com/repos/weiznich/diesel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weiznich/diesel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weiznich/diesel/teams","hooks_url":"https://api.github.com/repos/weiznich/diesel/hooks","issue_events_url":"https://api.github.com/repos/weiznich/diesel/issues/events{/number}","events_url":"https://api.github.com/repos/weiznich/diesel/events","assignees_url":"https://api.github.com/repos/weiznich/diesel/assignees{/user}","branches_url":"https://api.github.com/repos/weiznich/diesel/branches{/branch}","tags_url":"https://api.github.com/repos/weiznich/diesel/tags","blobs_url":"https://api.github.com/repos/weiznich/diesel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weiznich/diesel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weiznich/diesel/git/refs{/sha}","trees_url":"https://api.github.com/repos/weiznich/diesel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weiznich/diesel/statuses/{sha}","languages_url":"https://api.github.com/repos/weiznich/diesel/languages","stargazers_url":"https://api.github.com/repos/weiznich/diesel/stargazers","contributors_url":"https://api.github.com/repos/weiznich/diesel/contributors","subscribers_url":"https://api.github.com/repos/weiznich/diesel/subscribers","subscription_url":"https://api.github.com/repos/weiznich/diesel/subscription","commits_url":"https://api.github.com/repos/weiznich/diesel/commits{/sha}","git_commits_url":"https://api.github.com/repos/weiznich/diesel/git/commits{/sha}","comments_url":"https://api.github.com/repos/weiznich/diesel/comments{/number}","issue_comment_url":"https://api.github.com/repos/weiznich/diesel/issues/comments{/number}","contents_url":"https://api.github.com/repos/weiznich/diesel/contents/{+path}","compare_url":"https://api.github.com/repos/weiznich/diesel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weiznich/diesel/merges","archive_url":"https://api.github.com/repos/weiznich/diesel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weiznich/diesel/downloads","issues_url":"https://api.github.com/repos/weiznich/diesel/issues{/number}","pulls_url":"https://api.github.com/repos/weiznich/diesel/pulls{/number}","milestones_url":"https://api.github.com/repos/weiznich/diesel/milestones{/number}","notifications_url":"https://api.github.com/repos/weiznich/diesel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weiznich/diesel/labels{/name}","releases_url":"https://api.github.com/repos/weiznich/diesel/releases{/id}","deployments_url":"https://api.github.com/repos/weiznich/diesel/deployments","created_at":"2016-01-26T22:25:14Z","updated_at":"2016-01-26T22:25:15Z","pushed_at":"2017-10-01T13:06:04Z","git_url":"git://github.com/weiznich/diesel.git","ssh_url":"git@github.com:weiznich/diesel.git","clone_url":"https://github.com/weiznich/diesel.git","svn_url":"https://github.com/weiznich/diesel","homepage":"","size":5696,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"diesel-rs:master","ref":"master","sha":"498156d0f0d318faf5868bb4583748c870875080","user":{"login":"diesel-rs","id":16763251,"avatar_url":"https://avatars2.githubusercontent.com/u/16763251?v=4","gravatar_id":"","url":"https://api.github.com/users/diesel-rs","html_url":"https://github.com/diesel-rs","followers_url":"https://api.github.com/users/diesel-rs/followers","following_url":"https://api.github.com/users/diesel-rs/following{/other_user}","gists_url":"https://api.github.com/users/diesel-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/diesel-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diesel-rs/subscriptions","organizations_url":"https://api.github.com/users/diesel-rs/orgs","repos_url":"https://api.github.com/users/diesel-rs/repos","events_url":"https://api.github.com/users/diesel-rs/events{/privacy}","received_events_url":"https://api.github.com/users/diesel-rs/received_events","type":"Organization","site_admin":false},"repo":{"id":41609775,"name":"diesel","full_name":"diesel-rs/diesel","owner":{"login":"diesel-rs","id":16763251,"avatar_url":"https://avatars2.githubusercontent.com/u/16763251?v=4","gravatar_id":"","url":"https://api.github.com/users/diesel-rs","html_url":"https://github.com/diesel-rs","followers_url":"https://api.github.com/users/diesel-rs/followers","following_url":"https://api.github.com/users/diesel-rs/following{/other_user}","gists_url":"https://api.github.com/users/diesel-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/diesel-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diesel-rs/subscriptions","organizations_url":"https://api.github.com/users/diesel-rs/orgs","repos_url":"https://api.github.com/users/diesel-rs/repos","events_url":"https://api.github.com/users/diesel-rs/events{/privacy}","received_events_url":"https://api.github.com/users/diesel-rs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diesel-rs/diesel","description":"A safe, extensible ORM and Query Builder for Rust","fork":false,"url":"https://api.github.com/repos/diesel-rs/diesel","forks_url":"https://api.github.com/repos/diesel-rs/diesel/forks","keys_url":"https://api.github.com/repos/diesel-rs/diesel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diesel-rs/diesel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diesel-rs/diesel/teams","hooks_url":"https://api.github.com/repos/diesel-rs/diesel/hooks","issue_events_url":"https://api.github.com/repos/diesel-rs/diesel/issues/events{/number}","events_url":"https://api.github.com/repos/diesel-rs/diesel/events","assignees_url":"https://api.github.com/repos/diesel-rs/diesel/assignees{/user}","branches_url":"https://api.github.com/repos/diesel-rs/diesel/branches{/branch}","tags_url":"https://api.github.com/repos/diesel-rs/diesel/tags","blobs_url":"https://api.github.com/repos/diesel-rs/diesel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diesel-rs/diesel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diesel-rs/diesel/git/refs{/sha}","trees_url":"https://api.github.com/repos/diesel-rs/diesel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diesel-rs/diesel/statuses/{sha}","languages_url":"https://api.github.com/repos/diesel-rs/diesel/languages","stargazers_url":"https://api.github.com/repos/diesel-rs/diesel/stargazers","contributors_url":"https://api.github.com/repos/diesel-rs/diesel/contributors","subscribers_url":"https://api.github.com/repos/diesel-rs/diesel/subscribers","subscription_url":"https://api.github.com/repos/diesel-rs/diesel/subscription","commits_url":"https://api.github.com/repos/diesel-rs/diesel/commits{/sha}","git_commits_url":"https://api.github.com/repos/diesel-rs/diesel/git/commits{/sha}","comments_url":"https://api.github.com/repos/diesel-rs/diesel/comments{/number}","issue_comment_url":"https://api.github.com/repos/diesel-rs/diesel/issues/comments{/number}","contents_url":"https://api.github.com/repos/diesel-rs/diesel/contents/{+path}","compare_url":"https://api.github.com/repos/diesel-rs/diesel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diesel-rs/diesel/merges","archive_url":"https://api.github.com/repos/diesel-rs/diesel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diesel-rs/diesel/downloads","issues_url":"https://api.github.com/repos/diesel-rs/diesel/issues{/number}","pulls_url":"https://api.github.com/repos/diesel-rs/diesel/pulls{/number}","milestones_url":"https://api.github.com/repos/diesel-rs/diesel/milestones{/number}","notifications_url":"https://api.github.com/repos/diesel-rs/diesel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diesel-rs/diesel/labels{/name}","releases_url":"https://api.github.com/repos/diesel-rs/diesel/releases{/id}","deployments_url":"https://api.github.com/repos/diesel-rs/diesel/deployments","created_at":"2015-08-29T22:51:00Z","updated_at":"2017-10-01T09:23:06Z","pushed_at":"2017-09-30T20:34:17Z","git_url":"git://github.com/diesel-rs/diesel.git","ssh_url":"git@github.com:diesel-rs/diesel.git","clone_url":"https://github.com/diesel-rs/diesel.git","svn_url":"https://github.com/diesel-rs/diesel","homepage":"http://diesel.rs","size":10979,"stargazers_count":1892,"watchers_count":1892,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":191,"mirror_url":null,"open_issues_count":116,"forks":191,"open_issues":116,"watchers":1892,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/diesel-rs/diesel/pulls/1231"},"html":{"href":"https://github.com/diesel-rs/diesel/pull/1231"},"issue":{"href":"https://api.github.com/repos/diesel-rs/diesel/issues/1231"},"comments":{"href":"https://api.github.com/repos/diesel-rs/diesel/issues/1231/comments"},"review_comments":{"href":"https://api.github.com/repos/diesel-rs/diesel/pulls/1231/comments"},"review_comment":{"href":"https://api.github.com/repos/diesel-rs/diesel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diesel-rs/diesel/pulls/1231/commits"},"statuses":{"href":"https://api.github.com/repos/diesel-rs/diesel/statuses/9c6779910db4f18e2103237490e0356eccd9d7a2"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":172,"deletions":178,"changed_files":67}}
{"actor":{"display_login":"weiznich"}}