The clojure.contrib.sql module has a create-table function that takes the table name and a list of specifications, like this:
(sql/create-table :services
[:id :serial "PRIMARY KEY"]
[:service_name :varchar "NOT NULL"]
[:pass_hash :varchar "NOT NULL"]
[:token :varchar "NOT NULL"])
If I'm reusing the same columns again and again, is there a way to define something like this?
(def same-columns
[:id :serial "PRIMARY KEY"]
[:service_name :varchar "NOT NULL"]
[:pass_hash :varchar "NOT NULL"]
[:token :varchar "NOT NULL"])
When I tried running that in the REPL I got an error, because it passes too many arguments to def.