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

后端 未结 2 907
失恋的感觉
失恋的感觉 2021-01-13 14:23

say I had :user/name and :user/gender installed as datomic schema.

(pprint (d/q \'[:find ?ident :where
               [?e :db/ident         


        
2条回答
  •  遥遥无期
    2021-01-13 15:03

    You can use the Tupelo Datomic library to grab all EIDs for a given partition. Just use:

    (ns xyz
      (:require [tupelo.datomic :as td] ...
    
      ; Create a partition named :people (we could namespace it like :db.part/people if we wished)
      (td/transact *conn* 
        (td/new-partition :people ))
    
    ; Find all EID's in the :people partition
    (let [people-eids (td/partition-eids *conn* :people) ]
       ...)
    

    More information can be found in the Datomic Mailing List. Enjoy!

提交回复
热议问题