{"action":"closed","issue":{"url":"https://api.github.com/repos/jkk/honeysql/issues/125","repository_url":"https://api.github.com/repos/jkk/honeysql","labels_url":"https://api.github.com/repos/jkk/honeysql/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/jkk/honeysql/issues/125/comments","events_url":"https://api.github.com/repos/jkk/honeysql/issues/125/events","html_url":"https://github.com/jkk/honeysql/issues/125","id":157071499,"number":125,"title":"function call arguments and `if`","user":{"login":"mattly","id":891,"avatar_url":"https://avatars.githubusercontent.com/u/891?v=3","gravatar_id":"","url":"https://api.github.com/users/mattly","html_url":"https://github.com/mattly","followers_url":"https://api.github.com/users/mattly/followers","following_url":"https://api.github.com/users/mattly/following{/other_user}","gists_url":"https://api.github.com/users/mattly/gists{/gist_id}","starred_url":"https://api.github.com/users/mattly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattly/subscriptions","organizations_url":"https://api.github.com/users/mattly/orgs","repos_url":"https://api.github.com/users/mattly/repos","events_url":"https://api.github.com/users/mattly/events{/privacy}","received_events_url":"https://api.github.com/users/mattly/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-05-26T20:26:28Z","updated_at":"2016-07-10T15:44:02Z","closed_at":"2016-07-10T15:44:02Z","body":"so I'm trying to do `select sum(if(foo = 1, 1, 0)) as foo_count`, but it seems there's no sane way to represent this in honeysql without resorting to `sql/raw`: `(sql/call :sum (sql/call :if (sql/raw \"foo = 1\") 1 0))`. What I'd *like* to do (and what it seems like I should be able to do) for the `if` call is `(sql/call :if [:= :foo 1] 1 0)` but that formats into `if((=, :foo, 1), 1, 0)`. Is there a better way to do this? I couldn't find any examples of using `if`"}}
{"actor":{"display_login":"ddellacosta"}}