Fork me on GitHub
#sql
<
2022-06-08
>
rmxm19:06:21

How do you deal with enums in next.jdbc? I know I can hack into PGObjects and modify some stuff ad-hoc etc, question is do you do it transparently or explicitly when accessing database?

rmxm19:06:25

Ok I will answer myself, reading upon this article https://www.bevuta.com/en/blog/using-postgresql-enums-in-clojure/ still interested if people do it application level or tweaking libraries

dharrigan20:06:57

There is documentation in next.jdbc on enumerated types, if that is of any help

chrisblom22:06:22

i've used enums once in a project, I just converted them explicitly using

(defn pgobject
  [type value]
  (doto (PGobject.)
    (.setType type)
    (.setValue value)))

(pgobject "typename" "enumoption")