{"action":"created","issue":{"url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/132","repository_url":"https://api.github.com/repos/auraphp/Aura.Sql","labels_url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/132/labels{/name}","comments_url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/132/comments","events_url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/132/events","html_url":"https://github.com/auraphp/Aura.Sql/issues/132","id":180202566,"number":132,"title":"sqliteCreateFunction method doesn't work","user":{"login":"bohwaz","id":584819,"avatar_url":"https://avatars.githubusercontent.com/u/584819?v=3","gravatar_id":"","url":"https://api.github.com/users/bohwaz","html_url":"https://github.com/bohwaz","followers_url":"https://api.github.com/users/bohwaz/followers","following_url":"https://api.github.com/users/bohwaz/following{/other_user}","gists_url":"https://api.github.com/users/bohwaz/gists{/gist_id}","starred_url":"https://api.github.com/users/bohwaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bohwaz/subscriptions","organizations_url":"https://api.github.com/users/bohwaz/orgs","repos_url":"https://api.github.com/users/bohwaz/repos","events_url":"https://api.github.com/users/bohwaz/events{/privacy}","received_events_url":"https://api.github.com/users/bohwaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-30T01:49:07Z","updated_at":"2016-09-30T18:48:12Z","closed_at":null,"body":"This is funny:\r\n\r\n```\r\n$aura = new ExtendedPdo('sqlite::memory:');\r\n$aura->sqliteCreateFunction('strpos', 'strpos);\r\n// Fatal error: Call to undefined method Aura\\Sql\\ExtendedPdo::sqliteCreateFunction()\r\n```\r\n\r\nThe method seems to exist only after connection:\r\n\r\n```\r\nclass PDO_Test extends PDO {\r\n    public function __construct() {}\r\n    public function connect($dsn)\r\n    {\r\n        parent::__construct($dsn);\r\n        $this->sqliteCreateFunction('strpos', 'strpos');\r\n    }\r\n}\r\n\r\n$pdo = new PDO_Test;\r\nvar_dump(method_exists($pdo, 'sqliteCreateFunction'));\r\n// false\r\n\r\n$pdo->connect('sqlite::memory:');\r\nvar_dump(method_exists($pdo, 'sqliteCreateFunction'));\r\n// true\r\n```\r\n\r\nI guess this would be the same with sqliteCreateAggregate and sqliteCreateCollation and other DB-specific methods of PDO."},"comment":{"url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/comments/250822934","html_url":"https://github.com/auraphp/Aura.Sql/issues/132#issuecomment-250822934","issue_url":"https://api.github.com/repos/auraphp/Aura.Sql/issues/132","id":250822934,"user":{"login":"pmjones","id":25754,"avatar_url":"https://avatars.githubusercontent.com/u/25754?v=3","gravatar_id":"","url":"https://api.github.com/users/pmjones","html_url":"https://github.com/pmjones","followers_url":"https://api.github.com/users/pmjones/followers","following_url":"https://api.github.com/users/pmjones/following{/other_user}","gists_url":"https://api.github.com/users/pmjones/gists{/gist_id}","starred_url":"https://api.github.com/users/pmjones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmjones/subscriptions","organizations_url":"https://api.github.com/users/pmjones/orgs","repos_url":"https://api.github.com/users/pmjones/repos","events_url":"https://api.github.com/users/pmjones/events{/privacy}","received_events_url":"https://api.github.com/users/pmjones/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T18:48:12Z","updated_at":"2016-09-30T18:48:12Z","body":"> Why not proxy all non-defined method calls through to the underlying PDO object?\r\n\r\n@dhrrgn That's a neat idea; I wonder if it would work. You could skip the BadMethodCallException entirely and just let fail. Hard to put into an interface, but then, it might not matter.\r\n\r\nIf anyone's interested in writing up a solution for this, I'd be happy to review their PR."}}
{"actor":{"display_login":"pmjones"}}