Skip to content

Instantly share code, notes, and snippets.

@joevandyk
Forked from anonymous/gist:243d4dc223878317a4ee
Created December 19, 2012 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joevandyk/a8b10140d489bac627e6 to your computer and use it in GitHub Desktop.
Save joevandyk/a8b10140d489bac627e6 to your computer and use it in GitHub Desktop.
(def db (partial sql/with-connection "postgres://localhost/tanga_dev" ))
(db
(:username
(first
(sql/with-query-results results ["select * from users"] (into [] results)))))
@bsteuber
Copy link

(defmacro db [& body]
`(sql/with-connection "postgres://localhost/tanga_dev"
~@Body))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment