diff options
-rw-r--r-- | INSTALL | 6 | ||||
-rw-r--r-- | cljssss-g.clj | 10 |
2 files changed, 15 insertions, 1 deletions
@@ -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) |