views:

3156

answers:

3

What methods to use a database from Clojure are there?

I know from Clojure you can do anything you can with Java, but that means that I may end up using something overly complicated (like Hybernate) which clashes with Clojure simplicity. Any recommendations or comments?

+9  A: 

clojure-contrib has an sql library which is a thin wrapper around JDBC (java.sql.DriverManager). The test file that comes with it has some examples of its usage.

Brian Carper
clojure-contrib has moved. It's here now: http://code.google.com/p/clojure-contrib/
Rollo Tomazzi
Actually it moved twice since I posted this. It's now here: http://github.com/richhickey/clojure-contrib :)
Brian Carper
+4  A: 

If you are open to using a Java library but want something that embraces simplicity, perhaps you'll like Persist. It'll only take you 10 minutes to have a look and see if it fits your needs.

Frederic Daoud
+1  A: 

I've used Berkeley DB for a simple key/value database in Clojure. See here.

Mark Probst