{"action":"created","issue":{"url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/133","repository_url":"https://api.github.com/repos/auraphp/Aura.Sql","labels_url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/133/comments","events_url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/133/events","html_url":"https://github.com/auraphp/Aura.Sql/issues/133","id":194851734,"number":133,"title":"Profiler logs most queries twice","user":{"login":"pavarnos","id":589595,"avatar_url":"https://avatars.githubusercontent.com/u/589595?v=3","gravatar_id":"","url":"https://api.github.com/users/pavarnos","html_url":"https://github.com/pavarnos","followers_url":"https://api.github.com/users/pavarnos/followers","following_url":"https://api.github.com/users/pavarnos/following{/other_user}","gists_url":"https://api.github.com/users/pavarnos/gists{/gist_id}","starred_url":"https://api.github.com/users/pavarnos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavarnos/subscriptions","organizations_url":"https://api.github.com/users/pavarnos/orgs","repos_url":"https://api.github.com/users/pavarnos/repos","events_url":"https://api.github.com/users/pavarnos/events{/privacy}","received_events_url":"https://api.github.com/users/pavarnos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-11T19:49:34Z","updated_at":"2016-12-27T14:50:56Z","closed_at":null,"body":"call $xpdo->fetchAll('select * from my_table');\r\nIt calls perform() as below\r\n```php\r\n    public function perform($statement, array $values = [])\r\n    {\r\n        $this->connect();\r\n        $sth = $this->prepareWithValues($statement, $values);\r\n        $this->profiler->start(__FUNCTION__);\r\n        $sth->execute();\r\n        $this->profiler->finish($statement, $values);\r\n        return $sth;\r\n    }\r\n```\r\n\r\nprepareWithValues() also calls $this->profiler->start() and finish(), so each query gets two items in the log (unless you write a special logger filter to ignore one of them). Can you think of a good way around this from within ExtendedPDO? I can't at the moment...\r\n\r\nI think the root of my discomfort with this is our earlier discussion about a ProfiledExtendedPDO. It seems wasteful to have 2 calls to a null profiler for every query when the majority of (production) use does not need logging at all.\r\n"},"comment":{"url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/comments/269335590","html_url":"https://github.com/auraphp/Aura.Sql/issues/133#issuecomment-269335590","issue_url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/133","id":269335590,"user":{"login":"frederikbosch","id":1552577,"avatar_url":"https://avatars.githubusercontent.com/u/1552577?v=3","gravatar_id":"","url":"https://api.github.com/users/frederikbosch","html_url":"https://github.com/frederikbosch","followers_url":"https://api.github.com/users/frederikbosch/followers","following_url":"https://api.github.com/users/frederikbosch/following{/other_user}","gists_url":"https://api.github.com/users/frederikbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/frederikbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frederikbosch/subscriptions","organizations_url":"https://api.github.com/users/frederikbosch/orgs","repos_url":"https://api.github.com/users/frederikbosch/repos","events_url":"https://api.github.com/users/frederikbosch/events{/privacy}","received_events_url":"https://api.github.com/users/frederikbosch/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T14:50:56Z","updated_at":"2016-12-27T14:50:56Z","body":"@pavarnos This can be achieved as follows [starting with PHP 7.2](https://wiki.php.net/rfc/debugging_pdo_prepared_statement_emulation).\r\n\r\n```php\r\n<?php\r\n$stmt->activeQueryString();\r\n```\r\n\r\nIt could be used for logging."}}
{"actor":{"display_login":"frederikbosch"}}