{"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/knex/issues/624","labels_url":"https://api.github.com/repos/tgriesser/knex/issues/624/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/624/comments","events_url":"https://api.github.com/repos/tgriesser/knex/issues/624/events","html_url":"https://github.com/tgriesser/knex/issues/624","id":54164165,"number":624,"title":"Query Inspection","user":{"login":"ozum","id":1497060,"avatar_url":"https://avatars.githubusercontent.com/u/1497060?v=3","gravatar_id":"","url":"https://api.github.com/users/ozum","html_url":"https://github.com/ozum","followers_url":"https://api.github.com/users/ozum/followers","following_url":"https://api.github.com/users/ozum/following{/other_user}","gists_url":"https://api.github.com/users/ozum/gists{/gist_id}","starred_url":"https://api.github.com/users/ozum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozum/subscriptions","organizations_url":"https://api.github.com/users/ozum/orgs","repos_url":"https://api.github.com/users/ozum/repos","events_url":"https://api.github.com/users/ozum/events{/privacy}","received_events_url":"https://api.github.com/users/ozum/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-13T08:47:34Z","updated_at":"2015-02-04T15:07:54Z","closed_at":null,"body":"Hi,\r\n\r\nIs there a proper way to inspect query before execution? I want to get table name and joined table names of the query.\r\n\r\n    var query = knex.select('*').from('ua_entity').innerJoin('ua_field', 'ua_field.entity_id', 'ua_entity.id');\r\n\r\nI can use non-public attributes. However this is of course inappropriate.\r\n\r\n    var table = query._single.table;\r\n    var joinedTable = query._statements[1].table; // Or by iteration of _statements\r\n\r\nIf there isn't any public attribute/function for inspection, could you please add that feature at least for getting table names and column names of the query?\r\n\r\nThank you."},"comment":{"url":"https://api.github.com/repos/tgriesser/knex/issues/comments/72870811","html_url":"https://github.com/tgriesser/knex/issues/624#issuecomment-72870811","issue_url":"https://api.github.com/repos/tgriesser/knex/issues/624","id":72870811,"user":{"login":"amir-s","id":905963,"avatar_url":"https://avatars.githubusercontent.com/u/905963?v=3","gravatar_id":"","url":"https://api.github.com/users/amir-s","html_url":"https://github.com/amir-s","followers_url":"https://api.github.com/users/amir-s/followers","following_url":"https://api.github.com/users/amir-s/following{/other_user}","gists_url":"https://api.github.com/users/amir-s/gists{/gist_id}","starred_url":"https://api.github.com/users/amir-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amir-s/subscriptions","organizations_url":"https://api.github.com/users/amir-s/orgs","repos_url":"https://api.github.com/users/amir-s/repos","events_url":"https://api.github.com/users/amir-s/events{/privacy}","received_events_url":"https://api.github.com/users/amir-s/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T15:07:54Z","updated_at":"2015-02-04T15:07:54Z","body":"+1\r\nI was looking for this feature!"}}