This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-14
Channels
- # announcements (31)
- # babashka (9)
- # beginners (4)
- # calva (67)
- # cider (6)
- # clj-yaml (10)
- # clojure (105)
- # clojure-austin (8)
- # clojure-bay-area (1)
- # clojure-europe (12)
- # clojure-germany (3)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-uk (2)
- # clojurescript (5)
- # core-logic (4)
- # data-science (29)
- # datomic (6)
- # dev-tooling (5)
- # emacs (3)
- # hyperfiddle (22)
- # introduce-yourself (4)
- # lsp (8)
- # malli (10)
- # off-topic (8)
- # pathom (74)
- # polylith (39)
- # practicalli (1)
- # reitit (3)
- # shadow-cljs (2)
- # spacemacs (3)
- # squint (4)
- # tools-deps (4)
Sorry. Noob here. I’m missing something. Working with Datomic Cloud, dev-local. I cannot figure out how to inspect the schema. Where’s the data dictionary or whatever it might be called? How can I tell what’s in the thing? Are the use cases such that structure inspection (never mind backup) isn’t necessary?
Without console: Entity 0 (also called :db.part/db) references all partitions and schema, so you can query or pull from it. You can also just query attribute attributes (like :db/valueType for eg) directly. All schema lives alongside data in the same database as mostly-normal entities
This is our snippet, on datomic-cloud:
(defn- our-attr? [attr]
(and
(not (.startsWith (namespace attr) "db"))
(not (.startsWith (namespace attr) "fressian"))))
(defn schema
"Returns a data representation of db schema."
[db]
(->> (d/pull db '{:eid 0 :selector [{:db.install/attribute [*]}]})
:db.install/attribute
(map #(update % :db/valueType :db/ident))
(map #(update % :db/cardinality :db/ident))))
(defn our-schema
"Returns a data representation of our schema, excluding Datomic attrs."
[db]
(filter
#(our-attr? (:db/ident %))
(schema db)))
And this from @U0508JRJC needs more visibility: https://github.com/JarrodCTaylor/schema-cartographer-cloud and https://schema-cartographer.com/