You should be able to get a list of all partitions in the database by searching for all objects associated with the object :db.part/db , using the attribute :db.install/partition :
(ns myns (:require [datomic.api :as d])) (defn get-partitions [db] (d/q '[:find ?ident :where [:db.part/db :db.install/partition ?p] [?p :db/ident ?ident]] db))
Note
The current version of Datomic (build 0.8.3524) has a drawback, so :db.part/tx and :db.part/user (two of the three built-in partitions) are specially processed and are not actually associated with :db.part/db via :db.install/partition , so the result of the above request function will not contain these two.
This issue will be addressed in a future Datomic compilation. In the meantime, you should take care to include :db.part/tx and :db.part/user in the result set.
source share