Created
January 9, 2010 02:24
-
-
Save anonymous/272668 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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