Skip to content

Instantly share code, notes, and snippets.

@stuarthalloway
Created September 17, 2013 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuarthalloway/6594895 to your computer and use it in GitHub Desktop.
Save stuarthalloway/6594895 to your computer and use it in GitHub Desktop.
(require '[datomic.api :as d])
(def uri "datomic:mem://foo")
(d/create-database uri)
(def conn (d/connect uri))
@(d/transact conn [{:db/id (d/tempid :db.part/db)
:db/ident :card-1-reference
:db/valueType :db.type/ref
:db/isComponent true
:db/cardinality :db.cardinality/one
:db.install/_attribute :db.part/db}])
;; cardinality one nested map
@(d/transact conn [{:db/id (d/tempid :db.part/user)
:card-1-reference {:db/doc "nested entity map"}}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment