Skip to content

Create a schema for an existing annotated CLOUD database from a REPL

Jarrod edited this page Sep 15, 2022 · 7 revisions

Include the schema cartographer library and the client api as a dependencies in your project.

Clojars Project

(ns your-namespace
  (:require
    [datomic.client.api :as d]
    [schema-cartographer.core :as cartographer]))

(def cfg-map {:server-type :ion
              :region "us-east-1"
              :system "your-system" ; <stack-name> also called <system-name>
              :endpoint "https://ClientApiGatewayEndpoint.execute-api.us-east-1.amazonaws.com"})

(def client (d/client cfg-map))
(def conn (d/connect client {:db-name "your-database"})))

;; Arguments to the save-schema-edn
;; 1) `db` 
;; 2) `path` to save the resulting schema file to
;; 3) `db-type` this should be :cloud
(cartographer/save-schema-edn db "resources/db-schema.edn" :cloud)

Progress will be logged to the repl while the utility is running.

Load the resulting output file in the UI that resides at https://schema-cartographer.com