This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-13
Channels
- # admin-announcements (6)
- # beginners (19)
- # boot (1)
- # cbus (2)
- # cider (3)
- # clara (24)
- # cljs-dev (4)
- # cljsrn (18)
- # clojure (168)
- # clojure-boston (1)
- # clojure-dev (55)
- # clojure-russia (199)
- # clojure-sg (2)
- # clojurescript (38)
- # clojurex (1)
- # core-async (15)
- # css (16)
- # cursive (62)
- # datomic (23)
- # editors-rus (17)
- # events (3)
- # funcool (1)
- # hoplon (360)
- # ldnclj (37)
- # lein-figwheel (11)
- # leiningen (1)
- # nginx (1)
- # off-topic (13)
- # om (361)
- # onyx (1)
- # re-frame (56)
- # reagent (24)
- # robots (1)
- # spacemacs (46)
- # yada (9)
Why can I not set the eid for an entity? doing
(d/transact conn [{:db/id 175921860454230 :user/name "test_new" }])
throws an error [...]:cause ":db.error/invalid-entity-id Invalid entity id: 175921860454230"[...]
can't I set the eid?is the id already in storage? if not, you need to use d/tempid
to create a temporary id for it to convert to an in-storage one
you can’t make eids directly by yourself
@raywillig: Did not know that, it could come in handy.
@sjol: No, you cannot set EIDs. The transactor creates & manages EIDs to support efficient indexing and storage. Transactions may refer to existing entity IDs, but must use d/tempid
to create new entities.
I’m trying to import messaging data and set :db/txImport
to the timestamp for each message. I’m running into time conflicts when I try a second import with overlapping timestamps. do I have to import in strict timestamp order? i.e., import all messages in a set of transactions ordered by timestamp.
@zirmite: That’s correct. http://docs.datomic.com/best-practices.html#set-txinstant-on-imports "note that you must choose a :db/txInstant value that is not older than any existing transaction's :db/txInstant value and not newer than the transactor's clock time"
i had read that passage multiple times but only after asking my question here did it really sink in
Are there any limitations on the size of a pull pattern? I just ran into a bug where I had listed all the attributes I needed, and some where not returned. When I instead put *
in the pattern, it worked.
0.0.5198 release notes included: * Fixed bug where the pull API did not always return all explicit reverse references.
I would also check for something simple but easy-to-miss like misspelled attribute names.
I wish I had a cleaner example, but here I add one attribute and lose another:
> (keys (first (d/q '[:find [(pull ?g [:group/docId
:group/blocked_psns
:group/keywords :group/negative_phrases :group/negative_urls :group/negative_domains :group/psns :group/topic :group/type :group/url_prefix :group/verticals
{:group/campaign [*]}
{:creative/_groups [*]}]) ...] :where [?g :group/docId "560d4087090adba02ce7d98e"]] (d/db conn))))
=> (:group/docId :group/verticals :group/type :group/keywords :group/blocked_psns :group/topic :group/campaign :creative/_groups)
^ So far so good, :creative/_groups
is there. Now let's add :group/cpc
to the pull
form: > (keys (first (d/q '[:find [(pull ?g [:group/docId
:group/blocked_psns :group/cpc
:group/keywords :group/negative_phrases :group/negative_urls :group/negative_domains :group/psns :group/topic :group/type :group/url_prefix :group/verticals
{:group/campaign [*]}
{:creative/_groups [*]}]) ...] :where [?g :group/docId "560d4087090adba02ce7d98e"]] (d/db conn))))
=> (:group/docId :group/verticals :group/type :group/keywords :group/blocked_psns :group/topic :group/campaign :group/cpc)
Ah, that's a reverse reference, so it looks like the bugfix @marshall just mentioned may be it.
yes, can confirm that upgrading to 0.9. 5198 fixed it. thanks, @marshall and @stuartsierra!