corium-client
A fluent, async, Datomic-style client for corium. One API surface, two backends: query the peer library directly from storage, or reach a peer server over gRPC.
What it does
corium-client is the ergonomic front door to the peer. Datalog queries,
pull specifications, and transactions are built as typesafe, immutable,
builder-patterned values that lower to the boundary EDN the engine parses — a
malformed query is a type error, not a runtime parse failure.
- [
LocalPeer] wraps thecorium-peerConnection, so queries execute in-process against immutable database values read straight from storage — no round trip to the transactor. - [
RemotePeer] speaks the peer-server gRPC protocol, presenting the identical surface to processes that reach a hosted peer over the network.
Both implement the Peer trait and hand back Db values sharing query,
pull, datoms, stats, and the time-view methods as_of / since /
history.
Example
use ;
use ;
use Pull;
use ;
use ConnectConfig;
# async
The remote client is a drop-in: swap LocalPeer::connect for
RemotePeer::connect(endpoint, "people", token, tls) and the same
query/pull/transact code runs against a peer server.
Modules
| Module | What it provides |
|---|---|
query |
Query, Var, Term, Clause, find/aggregate/pull elements, data/pred/not/or/rule combinators |
pull |
Pull and Attr specs: attributes, *, :db/id, reverse refs, nesting, recursion, :as/:limit/:default |
tx |
TxBuilder, EntityMap, tempid/lookup/eid — the Datomic-dialect transaction forms |
result |
QueryResult, Row, and ResultShape with typed cell access |
value |
IntoEdn / FromEdn for boundary conversion and typed extraction |
Dependencies
- Engine:
corium-core,corium-db,corium-query. - Peer/network:
corium-peer,corium-protocol,tonic,tokio,async-trait.
See docs/architecture.md and the peer library
for the topology this sits on top of.