Created
September 19, 2023 13:29
-
-
Save andradefil/8c424d32c7256cd4b0c87f5959c48f1b to your computer and use it in GitHub Desktop.
Datomic Dev Local Import Attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[datomic.client.api :as d]) | |
(require '[datomic.local :as dl]) | |
(def client (d/client {:server-type :datomic-local | |
:system "dev"})) | |
(def db-name "test-uri-db") | |
(d/create-database client {:db-name db-name}) | |
(def conn (d/connect client {:db-name db-name})) | |
(d/transact conn {:tx-data [{:db/ident :uri/full-uri | |
:db/valueType :db.type/uri | |
:db/cardinality :db.cardinality/one}]}) | |
(d/transact | |
conn | |
{:tx-data [{:uri/full-uri (java.net.URI. "https://h.readthedocs.io/en/latest/api-reference/")}]}) | |
(dl/import-cloud | |
{:source {:server-type :dev-local | |
:system "dev" | |
:db-name db-name | |
} | |
:dest {:system "uri-test" | |
:server-type :dev-local | |
:db-name db-name}}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment