diff --git a/README.md b/README.md index bb3638b..48ff6c3 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ this `app-config`, being top level, can be used in other namespaces, including t ``` [here](https://github.com/tolitius/mount/blob/master/test/mount/nyse.clj) -is an example of a Datomic connection that "depends" on the similar `app-config`. +is an example of a Datomic connection that "depends" on a similar `app-config`. ## The Importance of Being Reloadable @@ -160,7 +160,10 @@ dev=> (reset) notice that it stopped and started again. -After the REPL was just started, schema was not created. Since the app was `(reset)`, it was brought to that starting point, so no schema again: +In nyse's connection [:stop](https://github.com/tolitius/mount/blob/a7424d4895ad7abe4933b425e718a6bdf1a0c22f/test/mount/nyse.clj#L18) +function database is deleted. Hence after `(reset)` was called the app was brought its starting point: database was created by the +[:start](https://github.com/tolitius/mount/blob/a7424d4895ad7abe4933b425e718a6bdf1a0c22f/test/mount/nyse.clj#L11) function, +but no schema again: ```clojure dev=> (find-orders "GOOG") @@ -181,7 +184,7 @@ dev=> (find-orders "AAPL") ({:db/id 17592186045418, :order/symbol "AAPL", :order/bid 111.712M, :order/qty 250, :order/offer 111.811M}) ``` -## license +## License Copyright © 2015 tolitius diff --git a/test/mount/app.clj b/test/mount/app.clj index f0ca4e8..8d8da2e 100644 --- a/test/mount/app.clj +++ b/test/mount/app.clj @@ -40,7 +40,7 @@ :order/qty qty}])) -(defn find-orders [ticker] ;; can take connection as param +(defn find-orders [ticker] ;; can take connection as param (let [orders (d/q '[:find ?e :in $ ?ticker :where [?e :order/symbol ?ticker]] (d/db nyse/conn) ticker)] diff --git a/test/mount/nyse.clj b/test/mount/nyse.clj index bbbb954..d29f06b 100644 --- a/test/mount/nyse.clj +++ b/test/mount/nyse.clj @@ -14,7 +14,7 @@ (defn disconnect [conf conn] (let [uri (get-in conf [:datomic :uri])] (info "disconnecting from " uri) - (.release conn) ;; usually it's no released, here just to illustrate the access to connection on (stop) + (.release conn) ;; usually it's not released, here just to illustrate the access to connection on (stop) (d/delete-database uri))) (defstate conn :start (new-connection app-config)