Skip to content

Instantly share code, notes, and snippets.

@wellfilverd
Created September 19, 2023 13:29
Show Gist options
  • Save wellfilverd/8c424d32c7256cd4b0c87f5959c48f1b to your computer and use it in GitHub Desktop.
Save wellfilverd/8c424d32c7256cd4b0c87f5959c48f1b to your computer and use it in GitHub Desktop.
Datomic Dev Local Import Attribute
(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