Skip to content

Instantly share code, notes, and snippets.

@favila
Created August 28, 2019 17:05
Show Gist options
  • Save favila/4d5b2b787ff0b3e8399b44d4fbdaa340 to your computer and use it in GitHub Desktop.
Save favila/4d5b2b787ff0b3e8399b44d4fbdaa340 to your computer and use it in GitHub Desktop.
shell one-liner to check a datomic client connection
#!/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