{"action":"created","issue":{"url":"https://api.github.com/repos/requery/requery/issues/834","repository_url":"https://api.github.com/repos/requery/requery","labels_url":"https://api.github.com/repos/requery/requery/issues/834/labels{/name}","comments_url":"https://api.github.com/repos/requery/requery/issues/834/comments","events_url":"https://api.github.com/repos/requery/requery/issues/834/events","html_url":"https://github.com/requery/requery/issues/834","id":379312015,"node_id":"MDU6SXNzdWUzNzkzMTIwMTU=","number":834,"title":"Question: How to use raw subquery with RxJava?","user":{"login":"jeffzoch","id":11867421,"node_id":"MDQ6VXNlcjExODY3NDIx","avatar_url":"https://avatars0.githubusercontent.com/u/11867421?v=4","gravatar_id":"","url":"https://api.github.com/users/jeffzoch","html_url":"https://github.com/jeffzoch","followers_url":"https://api.github.com/users/jeffzoch/followers","following_url":"https://api.github.com/users/jeffzoch/following{/other_user}","gists_url":"https://api.github.com/users/jeffzoch/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffzoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffzoch/subscriptions","organizations_url":"https://api.github.com/users/jeffzoch/orgs","repos_url":"https://api.github.com/users/jeffzoch/repos","events_url":"https://api.github.com/users/jeffzoch/events{/privacy}","received_events_url":"https://api.github.com/users/jeffzoch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-09T20:32:54Z","updated_at":"2018-11-10T06:52:14Z","closed_at":"2018-11-10T06:51:28Z","author_association":"NONE","body":"If I use a raw subquery like so:\r\n```\r\nval ids = ds.raw(\"select id from ticket where opType = '$opType' \" +\r\n                   \"and status = '${TicketStatus.NEW}' \" +\r\n                   \"and scheduledStart <= TIMESTAMP '${time.format(df)}' \" +\r\n                   \"and rownum <= $numAssignments\")\r\n                   .map { t ->t.get<String>(\"id\") }\r\n```\r\ni would like to place the result of this query in an update like:\r\n```update\r\n                    .where(Ticket::id.`in`(ids)\r\n                    .get().toSingle()\r\n```\r\nbut it requires a mutable list (instead of a flowable) and therefore is blocking which can lead to strange behavior when combined with other flowables. Any advice on how I can make sure that when i subscribe to the update the raw subquery is triggered then and not right away?"},"comment":{"url":"https://api.github.com/repos/requery/requery/issues/comments/437563285","html_url":"https://github.com/requery/requery/issues/834#issuecomment-437563285","issue_url":"https://api.github.com/repos/requery/requery/issues/834","id":437563285,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzU2MzI4NQ==","user":{"login":"jeffzoch","id":11867421,"node_id":"MDQ6VXNlcjExODY3NDIx","avatar_url":"https://avatars0.githubusercontent.com/u/11867421?v=4","gravatar_id":"","url":"https://api.github.com/users/jeffzoch","html_url":"https://github.com/jeffzoch","followers_url":"https://api.github.com/users/jeffzoch/followers","following_url":"https://api.github.com/users/jeffzoch/following{/other_user}","gists_url":"https://api.github.com/users/jeffzoch/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffzoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffzoch/subscriptions","organizations_url":"https://api.github.com/users/jeffzoch/orgs","repos_url":"https://api.github.com/users/jeffzoch/repos","events_url":"https://api.github.com/users/jeffzoch/events{/privacy}","received_events_url":"https://api.github.com/users/jeffzoch/received_events","type":"User","site_admin":false},"created_at":"2018-11-10T06:52:14Z","updated_at":"2018-11-10T06:52:14Z","author_association":"NONE","body":"I used Single.callable{} and wrapped the raw query in that so that it would be called only when the outer observable is subscribed to. This worked well. "}}
{"actor":{"display_login":"jeffzoch"}}