{"action":"created","issue":{"url":"https://api.github.com/repos/bugsbio/squirrel/issues/1","labels_url":"https://api.github.com/repos/bugsbio/squirrel/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/bugsbio/squirrel/issues/1/comments","events_url":"https://api.github.com/repos/bugsbio/squirrel/issues/1/events","html_url":"https://github.com/bugsbio/squirrel/issues/1","id":94156974,"number":1,"title":"How to plug into yesql?","user":{"login":"jjfine","id":528749,"avatar_url":"https://avatars.githubusercontent.com/u/528749?v=3","gravatar_id":"","url":"https://api.github.com/users/jjfine","html_url":"https://github.com/jjfine","followers_url":"https://api.github.com/users/jjfine/followers","following_url":"https://api.github.com/users/jjfine/following{/other_user}","gists_url":"https://api.github.com/users/jjfine/gists{/gist_id}","starred_url":"https://api.github.com/users/jjfine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjfine/subscriptions","organizations_url":"https://api.github.com/users/jjfine/orgs","repos_url":"https://api.github.com/users/jjfine/repos","events_url":"https://api.github.com/users/jjfine/events{/privacy}","received_events_url":"https://api.github.com/users/jjfine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-09T21:36:49Z","updated_at":"2015-07-09T22:21:29Z","closed_at":null,"body":"In this [yesql issue](https://github.com/krisajenkins/yesql/issues/8), you mention that squirrel easily plugs into yesql, but I can't figure out an easy way to do it. All I'm coming up with is something like this:\r\n\r\n``` Clojure\r\n(defquery \"get-all-things-query.sql\" {:connection my-connection})\r\n(defn get-all-things []\r\n  (map to-clj (get-all-things-query)))\r\n```\r\n\r\n...which would have to be done for every query. Seems like too much repetition. Any pointers?\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/bugsbio/squirrel/issues/comments/120164296","html_url":"https://github.com/bugsbio/squirrel/issues/1#issuecomment-120164296","issue_url":"https://api.github.com/repos/bugsbio/squirrel/issues/1","id":120164296,"user":{"login":"rsslldnphy","id":1231200,"avatar_url":"https://avatars.githubusercontent.com/u/1231200?v=3","gravatar_id":"","url":"https://api.github.com/users/rsslldnphy","html_url":"https://github.com/rsslldnphy","followers_url":"https://api.github.com/users/rsslldnphy/followers","following_url":"https://api.github.com/users/rsslldnphy/following{/other_user}","gists_url":"https://api.github.com/users/rsslldnphy/gists{/gist_id}","starred_url":"https://api.github.com/users/rsslldnphy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsslldnphy/subscriptions","organizations_url":"https://api.github.com/users/rsslldnphy/orgs","repos_url":"https://api.github.com/users/rsslldnphy/repos","events_url":"https://api.github.com/users/rsslldnphy/events{/privacy}","received_events_url":"https://api.github.com/users/rsslldnphy/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T22:21:29Z","updated_at":"2015-07-09T22:21:29Z","body":"Yeah, maybe \"nicely\" is a slight overstatement, but I think it's about the best we can do without changes in yesql. One thing you could do here, however, is use the `:row-fn` option, so your code could be:\r\n\r\n```clojure\r\n(defquery get-all-things \"get-all-things-query.sql\" {:connection my-connection :row-fn to-clj})\r\n```"}}