{"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/knex/issues/994","labels_url":"https://api.github.com/repos/tgriesser/knex/issues/994/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/994/comments","events_url":"https://api.github.com/repos/tgriesser/knex/issues/994/events","html_url":"https://github.com/tgriesser/knex/pull/994","id":107967633,"number":994,"title":"Query event in Transaction should be proxied to the main client","user":{"login":"wubzz","id":10179061,"avatar_url":"https://avatars.githubusercontent.com/u/10179061?v=3","gravatar_id":"","url":"https://api.github.com/users/wubzz","html_url":"https://github.com/wubzz","followers_url":"https://api.github.com/users/wubzz/followers","following_url":"https://api.github.com/users/wubzz/following{/other_user}","gists_url":"https://api.github.com/users/wubzz/gists{/gist_id}","starred_url":"https://api.github.com/users/wubzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wubzz/subscriptions","organizations_url":"https://api.github.com/users/wubzz/orgs","repos_url":"https://api.github.com/users/wubzz/repos","events_url":"https://api.github.com/users/wubzz/events{/privacy}","received_events_url":"https://api.github.com/users/wubzz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-23T17:27:33Z","updated_at":"2015-09-23T17:36:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tgriesser/knex/pulls/994","html_url":"https://github.com/tgriesser/knex/pull/994","diff_url":"https://github.com/tgriesser/knex/pull/994.diff","patch_url":"https://github.com/tgriesser/knex/pull/994.patch"},"body":"As discussed with @tgriesser in #855 the query event is no longer triggered onto the main client when in a transaction. It was simply a miss during the transaction overhaul, according to tgriessers's comments.\r\n\r\nExample code:\r\n```\r\ndbClient.on('query', function(obj) {\r\n\tconsole.log('onQuery'); //Works in knex < 8.0.0, fails in >= 8.0.0\r\n\treturn obj;\r\n});\r\n\r\ndbClient.transaction(function(tr) {\r\n\treturn tr.raw('SELECT version()').then(tr.commit).catch(tr.rollback);\r\n}).then(_.noop).catch(_.noop);\r\n```\r\n\r\nThere may be better ways of fixing this, I don't know."},"comment":{"url":"https://api.github.com/repos/tgriesser/knex/issues/comments/142674451","html_url":"https://github.com/tgriesser/knex/pull/994#issuecomment-142674451","issue_url":"https://api.github.com/repos/tgriesser/knex/issues/994","id":142674451,"user":{"login":"wubzz","id":10179061,"avatar_url":"https://avatars.githubusercontent.com/u/10179061?v=3","gravatar_id":"","url":"https://api.github.com/users/wubzz","html_url":"https://github.com/wubzz","followers_url":"https://api.github.com/users/wubzz/followers","following_url":"https://api.github.com/users/wubzz/following{/other_user}","gists_url":"https://api.github.com/users/wubzz/gists{/gist_id}","starred_url":"https://api.github.com/users/wubzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wubzz/subscriptions","organizations_url":"https://api.github.com/users/wubzz/orgs","repos_url":"https://api.github.com/users/wubzz/repos","events_url":"https://api.github.com/users/wubzz/events{/privacy}","received_events_url":"https://api.github.com/users/wubzz/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T17:36:33Z","updated_at":"2015-09-23T17:36:33Z","body":"@rhys-vdw Had to open a new one, tests weren't being trigger oncommit on the other PR ( #984 ) ...\r\n\r\nSeems to pull through."}}