Skip to content

Instantly share code, notes, and snippets.

@yokolet
Created May 15, 2013 15:48
Show Gist options
  • Save yokolet/5584995 to your computer and use it in GitHub Desktop.
Save yokolet/5584995 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