Skip to content

Instantly share code, notes, and snippets.

@yokolet
Created May 15, 2013 18:57
Show Gist options
  • Save yokolet/5586371 to your computer and use it in GitHub Desktop.
Save yokolet/5586371 to your computer and use it in GitHub Desktop.
datomic % uri="datomic:sql://heh?jdbc:postgresql://localhost:5432/heh";
<datomic:sql://heh?jdbc:postgresql://localhost:5432/heh>
datomic % Peer.createDatabase(uri);
<true>
datomic % conn = Peer.connect(uri);
<{:db-id "heh-5193d8ad-0ec4-4fcc-b995-0915581bb2e0", :unsent-updates-queue 0, :pending-txes 0, :next-t 1000, :basis-t 62, :index-rev 0, :index-root {:rev 0, :key "5193d921-b783-47c2-a9cf-7e555747b8cd"}, :log-root {:rev 0, :key "5193d921-17a1-4a03-9717-f10a869812cb"}}>
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@2b5825fa>
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