aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2009-02-19 12:17:10 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2009-02-19 12:17:10 +0100
commita35b9044a5bf26152f30bc4abe981bb7dd985e7b (patch)
treed828e24aeaafee9e1e64c833a175eafe3a39d1f1
parent2380054696fb2fd01c7b296042a2188cb73cc077 (diff)
Depend on SQLiteJDBC.
-rw-r--r--INSTALL6
-rw-r--r--cljssss-g.clj10
2 files changed, 15 insertions, 1 deletions
diff --git a/INSTALL b/INSTALL
index 14b595b..930c6d6 100644
--- a/INSTALL
+++ b/INSTALL
@@ -3,7 +3,7 @@
#title CljSSSS^g Quick Start Guide
#desc The CljSSSS^g installation guide
-; Time-stamp: <2009-02-18 20:31:12 mulk>
+; Time-stamp: <2009-02-19 11:57:16 mulk>
;
; C-c i t insert-time-stamp
; C-c C-t muse-project-publish-this-file
@@ -19,6 +19,8 @@ The following dependencies need to be on your class path:
- Clojure
+ - Clojure Contrib
+
- Compojure along with all of its dependencies, including:
- Fact
- Jetty
@@ -28,6 +30,8 @@ The following dependencies need to be on your class path:
- <verbatim>StringTemplate</verbatim> along with ANTLR
+ - SQLiteJDBC
+
----
diff --git a/cljssss-g.clj b/cljssss-g.clj
index 435c6c5..c99a0df 100644
--- a/cljssss-g.clj
+++ b/cljssss-g.clj
@@ -1,9 +1,12 @@
(ns cljssss-g
(require [clojure.xml :as xml]
+ [clojure.contrib.sql :as sql]
compojure)
(import (org.antlr.stringtemplate StringTemplateGroup))
(use compojure))
+(Class/forName "org.sqlite.JDBC")
+
(def templates (new StringTemplateGroup ""))
(defservlet cljssss-g
@@ -15,5 +18,12 @@
(ANY "*"
(page-not-found)))
+(defmacro with-db [& body]
+ `(sql/with-connection {:classname "org.sqlite.JDBC"
+ :subprotocol "sqlite"
+ :subname "cljssss-g.sqlite3"}
+ (sql/transaction
+ ~@body)))
+
(run-server {:port 8080}
"/*" cljssss-g)