{"action":"created","issue":{"url":"https://api.github.com/repos/cloudera/impyla/issues/66","labels_url":"https://api.github.com/repos/cloudera/impyla/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/cloudera/impyla/issues/66/comments","events_url":"https://api.github.com/repos/cloudera/impyla/issues/66/events","html_url":"https://github.com/cloudera/impyla/pull/66","id":66221521,"number":66,"title":"Query parameters","user":{"login":"tjeb","id":1710740,"avatar_url":"https://avatars.githubusercontent.com/u/1710740?v=3","gravatar_id":"","url":"https://api.github.com/users/tjeb","html_url":"https://github.com/tjeb","followers_url":"https://api.github.com/users/tjeb/followers","following_url":"https://api.github.com/users/tjeb/following{/other_user}","gists_url":"https://api.github.com/users/tjeb/gists{/gist_id}","starred_url":"https://api.github.com/users/tjeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjeb/subscriptions","organizations_url":"https://api.github.com/users/tjeb/orgs","repos_url":"https://api.github.com/users/tjeb/repos","events_url":"https://api.github.com/users/tjeb/events{/privacy}","received_events_url":"https://api.github.com/users/tjeb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-03T20:22:11Z","updated_at":"2015-04-03T23:26:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cloudera/impyla/pulls/66","html_url":"https://github.com/cloudera/impyla/pull/66","diff_url":"https://github.com/cloudera/impyla/pull/66.diff","patch_url":"https://github.com/cloudera/impyla/pull/66.patch"},"body":"Even though PEP 249 only requires cursor.execute() to support one parameter style (the one specified in the module's paramstyle value, in this case pyformat), I think it would be nice to also support some of the others, similar to what the sqlite3 module does.\r\n\r\nThis branchs adds support for named style (first commit), question mark style and numeric style (second commit). The third commit adds some exception for commonly used errors (though I left the pyformat replacement as it is, e.g. it would raise a KeyError for a nonexistent parameter, as it already did). Final commit is a slight documentation addition to the specialized tokenizer (added in the first commit since the python tokenizers don't really appear to fit the use-case).\r\n\r\nThe default (and paramstyle value) is still pyformat."},"comment":{"url":"https://api.github.com/repos/cloudera/impyla/issues/comments/89451362","html_url":"https://github.com/cloudera/impyla/pull/66#issuecomment-89451362","issue_url":"https://api.github.com/repos/cloudera/impyla/issues/66","id":89451362,"user":{"login":"caseyching","id":6964808,"avatar_url":"https://avatars.githubusercontent.com/u/6964808?v=3","gravatar_id":"","url":"https://api.github.com/users/caseyching","html_url":"https://github.com/caseyching","followers_url":"https://api.github.com/users/caseyching/followers","following_url":"https://api.github.com/users/caseyching/following{/other_user}","gists_url":"https://api.github.com/users/caseyching/gists{/gist_id}","starred_url":"https://api.github.com/users/caseyching/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseyching/subscriptions","organizations_url":"https://api.github.com/users/caseyching/orgs","repos_url":"https://api.github.com/users/caseyching/repos","events_url":"https://api.github.com/users/caseyching/events{/privacy}","received_events_url":"https://api.github.com/users/caseyching/received_events","type":"User","site_admin":false},"created_at":"2015-04-03T23:26:39Z","updated_at":"2015-04-03T23:26:39Z","body":"Nice! Doing a simple string replace instead of trying to parse a query might be better though. Something like https://github.com/mysql/mysql-connector-python/blob/master/lib/mysql/connector/cursor.py#L492 ? The parsing is missing a lot of cases, for example I think \"foo = (:bar)\" won't parse correctly? Also some tests should be added for when the replacement value itself contains a quote."}}