This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-29
Channels
- # aws (1)
- # aws-lambda (1)
- # beginners (34)
- # boot (61)
- # cljs-dev (126)
- # cljsjs (10)
- # cljsrn (4)
- # clojure (27)
- # clojure-russia (7)
- # clojure-spec (1)
- # clojure-uk (26)
- # clojurescript (42)
- # cursive (31)
- # datascript (4)
- # datomic (16)
- # hoplon (51)
- # klipse (1)
- # lein-figwheel (1)
- # lumo (79)
- # off-topic (16)
- # om (7)
- # parinfer (5)
- # planck (2)
- # re-frame (6)
- # reagent (3)
- # ring-swagger (5)
- # untangled (11)
@pesterhazy, sorry typo there. the problem I was having is that the syntax i was using there was in edn; in clojure, it needs to be different. so i ended up doing this in the repl:
(def id (datomic.api/tempid :db.part/db))
(def tx [[:db/add id :db/ident :arb/title]
[:db/add id :db/unique :db.unique/identity]
[:db/add id :db/valueType :db.type/string]
[:db/add id :db/cardinality :db.cardinality/one]
[:db/add id :db/fulltext true]
[:db/add id :db/index true]
[:db/add :db.part/db :db.install/attribute id]])
(pprint (<!! (client/transact conn {:tx-data tx})))
I ended up getting the same error as before, which I just can’t make sense of: > Unable to resolve entity: {:idx -1000000, :part :db.part/db} in datom [{:idx -1000000, :part :db.part/db} :db/ident :arb/title]"
@ezmiller77 hm that's strange, it works for me using d/transact
ah I see
the problem is you're using the client api with regular tempids
Clients will support string tempids only.
http://blog.datomic.com/2016/11/datomic-update-client-api-unlimited.html
if you use the regular peer api, it should work as expected
it would be nice if that was documented here: http://docs.datomic.com/clojure-client/index.html
okay, i got the impression at some point that the client peer was the more basic/easier-to-use.
Oh yes it was this paragraph: > There are two ways to consume Datomic: with an in-process peer library, or with a client library. If you are trying Datomic for the first time, we recommend that you begin with a client library. When you are ready to plan a system, you can return to this page for guidance on whether to use peers, clients, or both.
Yep @pesterhazy that was the key! I just excluded these lines: :db/id #db/id[:db.part/db]
and :db.install/_attribute :db.part/db}
b/c apparently tempids re also optional.
> The Datomic Starter license is perpetual, but is limited to 1 year of maintenance and updates does that mean that after a year, I won’t be able to upgrade to a newer version any more?
Is it possible to describe a schema entity that is both stand-alone and embedded, i.e. a component and also not a component?