Created
August 28, 2019 17:05
-
-
Save favila/4d5b2b787ff0b3e8399b44d4fbdaa340 to your computer and use it in GitHub Desktop.
shell one-liner to check a datomic client connection
This file contains 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
#!/bin/sh | |
ENDPOINT=localhost:8998 \ | |
ACCESS=accesskey \ | |
SECRET=secret \ | |
ALIAS=alias \ | |
clj -Sdeps '{:deps {com.datomic/client-pro {:mvn/version "0.8.28"}}}' \ | |
-e "(require '[datomic.client.api :as d])" \ | |
-e '(defmacro E [sym] `(System/getenv ~(name sym)))' \ | |
-e '(-> (d/client {:server-type :peer-server | |
:endpoint (E ENDPOINT) | |
:access-key (E ACCESS) | |
:secret (E SECRET)}) | |
(d/connect {:db-name (E ALIAS)}) | |
d/db (d/pull [:db/id :db/ident] 0))' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment