{"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/813","labels_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/813/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/813/comments","events_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/813/events","html_url":"https://github.com/tgriesser/bookshelf/issues/813","id":91671306,"number":813,"title":"Multiple queries?","user":{"login":"nicholaswyoung","id":98955,"avatar_url":"https://avatars.githubusercontent.com/u/98955?v=3","gravatar_id":"","url":"https://api.github.com/users/nicholaswyoung","html_url":"https://github.com/nicholaswyoung","followers_url":"https://api.github.com/users/nicholaswyoung/followers","following_url":"https://api.github.com/users/nicholaswyoung/following{/other_user}","gists_url":"https://api.github.com/users/nicholaswyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/nicholaswyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicholaswyoung/subscriptions","organizations_url":"https://api.github.com/users/nicholaswyoung/orgs","repos_url":"https://api.github.com/users/nicholaswyoung/repos","events_url":"https://api.github.com/users/nicholaswyoung/events{/privacy}","received_events_url":"https://api.github.com/users/nicholaswyoung/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tgriesser/bookshelf/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/tgriesser/bookshelf/labels/relations","name":"relations","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-29T02:16:20Z","updated_at":"2015-07-05T04:22:29Z","closed_at":"2015-07-05T04:22:29Z","body":"I'll post the log to this issue in the morning, but it seems that Bookshelf is issuing several queries when it should only dispatch one. \r\n\r\nI'm dealing with several related models, all capable of being joined on their primary key. And yet, when I query using ```withRelated```, it issues one query per table. \r\n\r\nWhat am I missing? Do the normal ```this.belongsTo``` and ```this.hasMany``` handle joins as I expect, or is there some additional magic I need to employ?"},"comment":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/comments/118579060","html_url":"https://github.com/tgriesser/bookshelf/issues/813#issuecomment-118579060","issue_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/813","id":118579060,"user":{"login":"nicholaswyoung","id":98955,"avatar_url":"https://avatars.githubusercontent.com/u/98955?v=3","gravatar_id":"","url":"https://api.github.com/users/nicholaswyoung","html_url":"https://github.com/nicholaswyoung","followers_url":"https://api.github.com/users/nicholaswyoung/followers","following_url":"https://api.github.com/users/nicholaswyoung/following{/other_user}","gists_url":"https://api.github.com/users/nicholaswyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/nicholaswyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicholaswyoung/subscriptions","organizations_url":"https://api.github.com/users/nicholaswyoung/orgs","repos_url":"https://api.github.com/users/nicholaswyoung/repos","events_url":"https://api.github.com/users/nicholaswyoung/events{/privacy}","received_events_url":"https://api.github.com/users/nicholaswyoung/received_events","type":"User","site_admin":false},"created_at":"2015-07-05T04:22:29Z","updated_at":"2015-07-05T04:22:29Z","body":"@rhys-vdw All good here. Thanks for following up! "}}