I am trying to write a simple application which reads the a database and produces a set of functions with which to access it; so far so good. Now, what I have come across is that some of the columns in my database are defined as MySQL enum types (e.g. ENUM('red','green','violet')
) and I would like to validate the stuff I send to the database rather than receive an error from the driver when an unacceptable value is given, so I was wondering if there is a way to retrieve the possible values for the enum from within clojure.
I am using [clojure.java.jdbc "0.3.0-alpha5"]
and [mysql/mysql-connector-java "5.1.25"]
. In order to get the metadata for the table I am currently using java.sql.DatabaseMetaData
, but trying .getPseudoColumns
just gives me nil
every time.