Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

oops. s/engine/db/

  • Loading branch information...
commit 7d3b19e66545aaffc889951778db08c84b919bd5 1 parent 6160ee6
Brandon Bickford authored January 21, 2012

Showing 1 changed file with 5 additions and 10 deletions. Show diff stats Hide diff stats

  1. 15  README.md
15  README.md
Source Rendered
@@ -30,19 +30,19 @@ A small SQL library for Clojure
30 30
   :address
31 31
   :user_id)
32 32
 
33  
-(def engine (create-engine schema "org.sqlite.JDBC" "jdbc:sqlite::memory:"))
  33
+(def db (create-db schema "org.sqlite.JDBC" "jdbc:sqlite::memory:"))
34 34
 (execute-sql db "create table user (id integer primary key, name text, created_at integer)")
35 35
 (execute-sql db "create table email (id integer primary key, user_id integer, address text)")
36 36
 
37  
-(insert engine :user {:id 1 :name "Brandon"})
38  
-(insert engine :email {:address "foo@bar.com" :user_id 1})
39  
-(insert engine :email {:address "bar@bar.com" :user_id 1})
  37
+(insert db :user {:id 1 :name "Brandon"})
  38
+(insert db :email {:address "foo@bar.com" :user_id 1})
  39
+(insert db :email {:address "bar@bar.com" :user_id 1})
40 40
 
41 41
 (println (-> select 
42 42
              (from :user)
43 43
              (join :email (on (= :email.user_id :user.id)))
44 44
              (where (= :id 1))
45  
-             (execute engine)))
  45
+             (execute db)))
46 46
 ; [{:user {:name "Brandon" :id 5} :email {:address "foo@bar.com" :user_id 1 :id 1}}
47 47
 ;  {:user {:name "Brandon" :id 5} :email {:address "bar@bar.com" :user_id 1 :id 2}}]
48 48
 
@@ -53,8 +53,3 @@ A small SQL library for Clojure
53 53
 ; [{:name "Brandon" :id 5 :emails [{:address "foo@bar.com" :user_id 1 :id 1} {:address "bar@bar.com" :user_id 1 :id 2}]}]
54 54
 ```
55 55
 
56  
-
57  
-
58  
-
59  
-
60  
-

0 notes on commit 7d3b19e

Please sign in to comment.
Something went wrong with that request. Please try again.