datomic

is there a canonical way to grab all idents from a particular datomic namespace?

删除回忆录丶 提交于 2019-12-01 04:50:12
问题 say I had :user/name and :user/gender installed as datomic schema. (pprint (d/q '[:find ?ident :where [?e :db/ident ?ident] [_ :db.install/attribute ?e]] (d/db conn))) finds all the db.install/attributes #{[:db/code] [:user/gender] [:fressian/tag] [:db/unique] [:user/name] [:db/fn] [:db/noHistory] [:db/fulltext] [:db/lang] [:db/valueType] [:db/doc] [:db/isComponent] [:db.install/function] [:db/cardinality] [:db/txInstant] [:db/index]} however, I only want to list items in the :user namespace

Why does Datomic yield the same temporary ID twice in a row when iterating?

你离开我真会死。 提交于 2019-11-29 16:04:05
This will produce two different ids, which is great: #db/id[:db.part/user] #db/id[:db.part/user] but anything like the following (I tried a lot of ideas so far) will produce the same id twice, which is not what I want: (repeatedly 2 (fn [] #db/id[:db.part/user])) (for [n [1 2]] #db/id[:db.part/user]) All yield something like (#db/id[:db.part/user -1000774] #db/id[:db.part/user -1000774]) where the number produced is the same for each call. What I actually want is for the calls to NOT produce a number at all, so that I can just add the produced data via a transaction. Any ideas? Just to be