{"action":"opened","issue":{"url":"https://api.github.com/repos/tgriesser/knex/issues/1537","repository_url":"https://api.github.com/repos/tgriesser/knex","labels_url":"https://api.github.com/repos/tgriesser/knex/issues/1537/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/1537/comments","events_url":"https://api.github.com/repos/tgriesser/knex/issues/1537/events","html_url":"https://github.com/tgriesser/knex/issues/1537","id":162775031,"number":1537,"title":"How do I use knex.raw() with  `where in`","user":{"login":"rogerschlachter","id":338873,"avatar_url":"https://avatars.githubusercontent.com/u/338873?v=3","gravatar_id":"","url":"https://api.github.com/users/rogerschlachter","html_url":"https://github.com/rogerschlachter","followers_url":"https://api.github.com/users/rogerschlachter/followers","following_url":"https://api.github.com/users/rogerschlachter/following{/other_user}","gists_url":"https://api.github.com/users/rogerschlachter/gists{/gist_id}","starred_url":"https://api.github.com/users/rogerschlachter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogerschlachter/subscriptions","organizations_url":"https://api.github.com/users/rogerschlachter/orgs","repos_url":"https://api.github.com/users/rogerschlachter/repos","events_url":"https://api.github.com/users/rogerschlachter/events{/privacy}","received_events_url":"https://api.github.com/users/rogerschlachter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-28T20:09:24Z","updated_at":"2016-06-28T20:09:24Z","closed_at":null,"body":"This may be a silly, easy question but I've been poking around and haven't been able to find the answer. \r\nI have this query with a sub query\r\n``return knex.raw(`\r\n\t\t\t\tupdate gps_message gm\r\n\t\t\t\tset status = 'PROCESSING'\r\n\t\t\t\tfrom (\r\n\t\t\t\t\tselect id\r\n\t\t\t\t\tfrom gps_message\r\n\t\t\t\t\twhere status = 'MATCHED'\r\n\t\t\t\t\torder by id\r\n\t\t\t\t\tlimit ?\r\n\t\t\t\t\t) sub\r\n\t\t\t\twhere gm.id = sub.id\r\n\t\t\t\treturning *\r\n\t\t\t`, [limit])``\r\n\r\n\r\nBut when I try to add in the `and id in (?)` like this, \r\n``return knex.raw(`\r\n\t\t\t\tupdate gps_message gm\r\n\t\t\t\tset status = 'PROCESSING'\r\n\t\t\t\tfrom (\r\n\t\t\t\t\tselect id\r\n\t\t\t\t\tfrom gps_message\r\n\t\t\t\t\twhere status = 'MATCHED'\r\n                                        and id in (?)\r\n\t\t\t\t\torder by id\r\n\t\t\t\t\tlimit ?\r\n\t\t\t\t\t) sub\r\n\t\t\t\twhere gm.id = sub.id\r\n\t\t\t\treturning *\r\n\t\t\t`, [[1,2,3],limit])``\r\n\r\nI get this\r\n`invalid input syntax for integer: \"{\"1\",\"2\",\"3\"}\"`\r\n\r\n\r\nAm I missing something here?"}}
{"actor":{"display_login":"rogerschlachter"}}