From e1feb02f5fbaa7dbb3c83ac26fd3eb00f9b72b36 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 3 Dec 2011 23:38:48 +0100 Subject: Move database configuration to config.sexp. --- src/mulk/benki/config.clj | 5 +++++ src/mulk/benki/db.clj | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 src/mulk/benki/config.clj (limited to 'src') diff --git a/src/mulk/benki/config.clj b/src/mulk/benki/config.clj new file mode 100644 index 0000000..4b9493b --- /dev/null +++ b/src/mulk/benki/config.clj @@ -0,0 +1,5 @@ +(ns mulk.benki.config + (:refer-clojure)) + +(def benki-config + (read-string (slurp "config.sexp"))) diff --git a/src/mulk/benki/db.clj b/src/mulk/benki/db.clj index c1f5cc6..61de478 100644 --- a/src/mulk/benki/db.clj +++ b/src/mulk/benki/db.clj @@ -1,15 +1,11 @@ (ns mulk.benki.db (:refer-clojure) - (:use mulk.benki.util) + (:use [mulk.benki util config]) (:require [clojure.java.jdbc :as sql])) (def ^:private db - {:classname "org.postgresql.Driver" - :subprotocol "postgresql" - :subname "//localhost:5432/benki" - :user "benki" - :password (clojure.string/trim (slurp "dbpassword.txt"))}) + (:database benki-config)) (defn call-with-db [thunk] (sql/with-connection db -- cgit v1.2.3