Skip to content

Instantly share code, notes, and snippets.

@hooptie45
Forked from yokolet/gist:5584995
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hooptie45/37f8a2f66e3862a6f1e5 to your computer and use it in GitHub Desktop.
Save hooptie45/37f8a2f66e3862a6f1e5 to your computer and use it in GitHub Desktop.
$ bin/shell
Datomic Java Shell
Type Shell.help(); for help.
datomic % uri = "datomic:dev://localhost:4334/heh";
<datomic:dev://localhost:4334/heh>
datomic % Peer.createDatabase(uri);
<true>
datomic % conn = Peer.connect(uri);
<{:db-id "heh-5193abce-9c7a-459f-9ace-7e8d666f1776", :unsent-updates-queue 0, :pending-txes 0, :next-t 1000, :basis-t 62, :index-rev 0, :index-root {:rev 0, :key "5193abed-2868-4e58-9138-c17710ed331c"}, :log-root {:rev 0, :key "5193abed-2160-48d3-81b3-3c3635a67df5"}}>
datomic % datom = Util.list("db/add",
Peer.tempid("db.part/user"),
"db/doc",
"hello world");
<[db/add, #db/id[db.part/user -1000000], db/doc, hello world]>
datomic % resp = conn.transact(Util.list(datom));
<datomic.promise$settable_future$reify__4843@2974f221>
datomic % entities = Peer.q("[:find ?entity :where [?entity :db/doc \"hello world\"]]", conn.db());
<[[17592186045417]]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment