I hereby claim:
- I am bobby on github.
- I am bobbycalderwood (https://keybase.io/bobbycalderwood) on keybase.
- I have a public key ASDe1HxbA1OOwJOnXOSn_jwAnkkgYG3TOAra6y-aDghGJgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| (ns user | |
| (:require [clojure.java.io :as io] | |
| [datomic.api :as d])) | |
| (defn order-schema [] | |
| (read-string (slurp (io/resource "schema.edn")))) | |
| (defn start-datomic! [uri schema] | |
| (d/create-database uri) | |
| (let [conn (d/connect uri)] |
| (defn q-entities | |
| "For a Datomic datalog query taking a Datomic db as its first source and returning only | |
| entity ids, returns the corresponding entities." | |
| [query & sources] | |
| (map (comp (partial d/entity (first sources)) | |
| first) | |
| (apply q query sources))) |
| (ns devnewb | |
| (:require [datomic.api :as d :refer (db q)] | |
| [clojure.data.generators :as gen])) | |
| ;; Make sure a free transactor is running at URI below | |
| (def uri "datomic:free://localhost:4334/devnewb") | |
| ;; Caution!!! This happens on load! | |
| (d/delete-database uri) |
| (ns datomic-helpers | |
| (:require [datomic.api :as d])) | |
| ;;; Expose Datomic vars here, for convenience | |
| ;;; Ring middleware | |
| (defn wrap-datomic | |
| "A Ring middleware that provides a request-consistent database connection and | |
| value for the life of a request." |