Remote client library: the same core operation surface as the embedded peer — db, transact, q, pull, datoms, and the time-travel reads — served through a running transactor over the wire protocol (docs/wire-protocol.md).
A client connection holds one socket; operations are serialized on it. (api/db conn) returns a RemoteDb marker pinned to the transactor's current t; as-of/since/history derive further markers; transact reports carry :db-before/:db-after markers at the surrounding ts. Entity navigation is a peer-only feature and is rejected explicitly in client mode.
Remote client library: the same core operation surface as the embedded peer — db, transact, q, pull, datoms, and the time-travel reads — served through a running transactor over the wire protocol (docs/wire-protocol.md). A client connection holds one socket; operations are serialized on it. (api/db conn) returns a RemoteDb marker pinned to the transactor's current t; as-of/since/history derive further markers; transact reports carry :db-before/:db-after markers at the surrounding ts. Entity navigation is a peer-only feature and is rejected explicitly in client mode.
(as-of db t)A marker for the server-side db value as of t (a t counter or tx entity id).
A marker for the server-side db value as of t (a t counter or tx entity id).
(connect {:keys [host port token] :or {host "127.0.0.1" port 4334}})Connect to a running transactor: {:host "127.0.0.1" :port 4334 :token "..."} — :token must match the transactor's when it was started with one. Performs the protocol handshake; a refusal (wrong token, version mismatch) throws.
Connect to a running transactor:
{:host "127.0.0.1" :port 4334 :token "..."} — :token must match the
transactor's when it was started with one. Performs the protocol
handshake; a refusal (wrong token, version mismatch) throws.(datoms db index components)Enumerate datoms server-side. Datoms arrive as plain maps with :e :a :v :tx :added (attribute idents as :a).
Enumerate datoms server-side. Datoms arrive as plain maps with :e :a :v :tx :added (attribute idents as :a).
(db c)A marker for the transactor's current db value.
A marker for the transactor's current db value.
(entid db ident)Resolve an ident to its entity id via a server-side lookup; entity ids pass through.
Resolve an ident to its entity id via a server-side lookup; entity ids pass through.
(history db)A marker for the server-side history value (every assertion and retraction, each with its added flag).
A marker for the server-side history value (every assertion and retraction, each with its added flag).
(listen c callback)Open a notification socket to the same transactor and invoke (callback msg) for every pushed transaction completion ({:notification :tx-completed :t t}). The handshake and the :listen ack run here, so a refusal throws — connection refused, version mismatch, a failed ack — and the subscription is active when listen returns. A connection that drops later ends the reader thread quietly (a crash is not observable on a push channel). Returns {:stop! f}. Callbacks run on the reader thread — return fast.
Open a notification socket to the same transactor and invoke (callback
msg) for every pushed transaction completion ({:notification
:tx-completed :t t}). The handshake and the :listen ack run here, so a
refusal throws — connection refused, version mismatch, a failed ack —
and the subscription is active when listen returns. A connection that
drops later ends the reader thread quietly (a crash is not observable
on a push channel). Returns {:stop! f}. Callbacks run on the reader
thread — return fast.(q query db & inputs)Run a Datalog query server-side against the remote db; extra :in inputs (beyond $) travel in :args.
Run a Datalog query server-side against the remote db; extra :in inputs (beyond $) travel in :args.
(since db t)A marker for a server-side since view: only facts asserted after t.
A marker for a server-side since view: only facts asserted after t.
(transact c tx-data)Submit tx-data through the transactor. The report carries :t, :tx-data, :tempids, and :db-before/:db-after RemoteDb markers (the db values themselves live server-side).
Submit tx-data through the transactor. The report carries :t, :tx-data, :tempids, and :db-before/:db-after RemoteDb markers (the db values themselves live server-side).
(with db tx-data)Speculative transaction executed server-side against the remote db (or its as-of view). No storage effect. :db-after addresses the speculative value held by the transactor (:db-ref); it is readable with q/pull/datoms until the transactor drops it.
Speculative transaction executed server-side against the remote db (or its as-of view). No storage effect. :db-after addresses the speculative value held by the transactor (:db-ref); it is readable with q/pull/datoms until the transactor drops it.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |