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
(defn keyword->pg-enum | |
"Convert a keyword value into an enum-compatible object." | |
[enum-type kw] | |
(doto (org.postgresql.util.PGobject.) | |
(.setType enum-type) | |
(.setValue (name kw)))) | |
(def ->status | |
"Convert a keyword status into a something_status enum object" | |
(partial keyword->pg-enum "something_status")) |