{"action":"created","issue":{"url":"https://api.github.com/repos/jakob/Postico/issues/297","repository_url":"https://api.github.com/repos/jakob/Postico","labels_url":"https://api.github.com/repos/jakob/Postico/issues/297/labels{/name}","comments_url":"https://api.github.com/repos/jakob/Postico/issues/297/comments","events_url":"https://api.github.com/repos/jakob/Postico/issues/297/events","html_url":"https://github.com/jakob/Postico/issues/297","id":192013197,"number":297,"title":"Run query with parameters","user":{"login":"doekman","id":1086388,"avatar_url":"https://avatars.githubusercontent.com/u/1086388?v=3","gravatar_id":"","url":"https://api.github.com/users/doekman","html_url":"https://github.com/doekman","followers_url":"https://api.github.com/users/doekman/followers","following_url":"https://api.github.com/users/doekman/following{/other_user}","gists_url":"https://api.github.com/users/doekman/gists{/gist_id}","starred_url":"https://api.github.com/users/doekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doekman/subscriptions","organizations_url":"https://api.github.com/users/doekman/orgs","repos_url":"https://api.github.com/users/doekman/repos","events_url":"https://api.github.com/users/doekman/events{/privacy}","received_events_url":"https://api.github.com/users/doekman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-28T14:01:14Z","updated_at":"2016-11-28T14:42:56Z","closed_at":null,"body":"In my Python-code (with sqlalchemy and psycopg2), I have queries like:\r\n\r\n```sql\r\nINSERT INTO my_table(title, isbn, copy_nr)\r\nVALUES(:title, :isbn, 1)\r\n```\r\n\r\nthe parts `:title` and `:isbn` are parameters which are supplied by code. \r\n\r\nI would be very handy, when parameters are detected, Postico would pop-up a window to enter values for those parameters (types would be needed to be specified too). Ideally, Postico would recognise if the same query was run, so it could remember the entered values and provide them as default values.\r\n\r\nI've used this behaviour in TOAD, and it makes a developers life a little better :-)\r\n\r\nNot sure if this fits in your philosophy about Postico."},"comment":{"url":"https://api.github.com/repos/jakob/Postico/issues/comments/263288170","html_url":"https://github.com/jakob/Postico/issues/297#issuecomment-263288170","issue_url":"https://api.github.com/repos/jakob/Postico/issues/297","id":263288170,"user":{"login":"doekman","id":1086388,"avatar_url":"https://avatars.githubusercontent.com/u/1086388?v=3","gravatar_id":"","url":"https://api.github.com/users/doekman","html_url":"https://github.com/doekman","followers_url":"https://api.github.com/users/doekman/followers","following_url":"https://api.github.com/users/doekman/following{/other_user}","gists_url":"https://api.github.com/users/doekman/gists{/gist_id}","starred_url":"https://api.github.com/users/doekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doekman/subscriptions","organizations_url":"https://api.github.com/users/doekman/orgs","repos_url":"https://api.github.com/users/doekman/repos","events_url":"https://api.github.com/users/doekman/events{/privacy}","received_events_url":"https://api.github.com/users/doekman/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T14:42:56Z","updated_at":"2016-11-28T14:42:56Z","body":"Python uses types for the queries; most types I use are text, integer, date/time (though at the moment date/time are ISO date strings; I'm new to Python). \r\n\r\nYou could just ask for Postgres literals, so a difference between an empty string and NULL can be made (Microsoft came up with the solution to type Ctrl+0 to insert a NULL value in the UI, but I don't like it). And you don't need type-UI/type-dropdown's with this solution. To not bother the user, quotes can be added automatically (when it's not NULL/integer/already a string). \r\n\r\nI always think it's great to list some examples (input between brackets):\r\n\r\n* []: empty string\r\n* [NULL]: SQL's NULL\r\n* [123]: All digits, it's probably an integer, nothing to do\r\n* [12.3]: A fixed point number, also nothing to doo\r\n* [+1.23e-4]: A float/real, nothing to do\r\n* [Hello World's!]: A string, automatically escape and enclose in quotes\r\n* ['Hi there']: A string, already quoted so nothing to infer\r\n* [2016-11-28]: A string, because it's not all digits, so add quotes\r\n* [TRUE]: A boolean, nothing to do\r\n* [yes]: A string, so add quotes\r\n\r\nNot sure if I want to add cast's (::TEXT) to my code, just for this feature.\r\n\r\nHope this helps :-)"}}
{"actor":{"display_login":"doekman"}}