Skip to content

Instantly share code, notes, and snippets.

Created January 9, 2010 02:24
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 anonymous/272668 to your computer and use it in GitHub Desktop.
Save anonymous/272668 to your computer and use it in GitHub Desktop.
(defmacro dosql [& forms] `(run *conn-info* ~@forms))
(defn setup
[]
(try (dosql
(create-table
users
[id int
username "varchar(64)"
password "varchar(64)"
public_key "varchar(1024)"
private_key "varchar(1024)"]
:primary-key id
:auto-inc id
:unique username
:not-nulls [id username password public_key private_key])
)
(catch java.sql.SQLException e
(when (empty? (re-seq #"exists" (.getMessage e))) (throw e)))
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment