summaryrefslogtreecommitdiffstats
path: root/src/controller/routes.phel
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller/routes.phel')
-rw-r--r--src/controller/routes.phel8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/controller/routes.phel b/src/controller/routes.phel
index 726f57b..b6335ca 100644
--- a/src/controller/routes.phel
+++ b/src/controller/routes.phel
@@ -5,12 +5,8 @@
(:require phel.router :as r)
(:require phel.http :as h)
(:require phel.pdo)
- (:require phel.string :as str))
-
-(def conn (pdo/connect "sqlite:test.db"))
-(pdo/exec conn "create table if not exists books (id integer primary key autoincrement, title varchar(255), subtitle varchar(255))")
-(pdo/exec conn "create table if not exists authors (id integer primary key autoincrement, name varchar(255))")
-(pdo/exec conn "create table if not exists authors_books (author_id integer, book_id integer)")
+ (:require phel.string :as str)
+ (:require lezer.db :refer [conn]))
(defn index-handler [req router]
(let [books (for [b :in (pdo/select conn "select * from books")]