clojure « postgresql « Java Database Q&A





1. Driver issue with PostgreSQL/Clojure    stackoverflow.com

I am attempting to access a Postgres database inside of Clojure. I've found a ton of examples of projects using DBs, setting up the database like this:

(def db
    ...

2. Clojure/postgresql: How do I access the enum values from the Jdbc4Array results?    stackoverflow.com

I have an enum in postgresql defined like so:

create type color as enum ('yellow', 'purple', 'white', 'black');
And I can get to the Jdbc4Array like so:
(def colors 
  ((first (sql/with-connection db/db ...

3. How do I drop or create a database from clojure.java.jdbc?    stackoverflow.com

I would like to create/drop a database from clojure.java.jdbc. This fails:

(require '[clojure.java.jdbc :as sql])

(def db
  {:classname "org.postgresql.Driver"
   :subprotocol "postgresql"
   :subname "//localhost/postgres"
   :user "postgres"})

(defn ...