feltdb-client
A native async Rust client for a FeltDB server: the Rust
counterpart of @feltdb/core's server runtime. It holds no state of its own; the server is the
authority for every read and write.
[]
= "0.2"
= "1"
= { = "1", = ["macros", "rt-multi-thread"] }
use ;
use json;
async
What it covers
| Server surface | Client |
|---|---|
Records: GET/POST /collections/…, PATCH, DELETE |
get, list, create, update, delete |
Atomic, idempotent transactions with preconditions and fences: POST /transactions |
commit with Transaction, Operation, Precondition |
Read bases: POST /transactions/read-basis |
read_basis, then Transaction::fence |
Compare-and-set: POST /collections/{c}/{id}/cas |
compare_and_set → CasOutcome |
Bounded query: POST /query |
query with BoundedQuery |
Committed revision: GET /revision |
revision |
Live events: GET /events (SSE) |
events → EventStream |
Canonical application API under /v1 |
client.application(id): discover, query, commit (per-operation if_version via update_if_version/delete_if_version), read_basis, events, replay, provenance, sign_in/sign_up/session/sign_out |
Committed state version: GET /v1/state/version |
application.state_version() |
Control plane: /api/tenants, /api/applications/… drafts, revisions, promotion; POST /admin/backups |
client.control(): create_tenant, create_application, create_draft, update_draft, validate_draft, commit_draft, revision, promote, backup |
Health: GET /health |
health |
| Capability discovery | capabilities |
| Anything else | request(Method, path, body) |
Errors carry the server's stable code, its request_id, and for a refused transaction the
structured PreconditionFailure. The canonical query and transaction documents are feltdb's
own types (re-exported under feltdb_client::wire), so the client and server serialize the same
structs.
A server behind a private CA is trusted with
Client::builder(url).add_root_certificate_pem(pem), in addition to the bundled public roots; verification is never
disabled.
The event stream does not reconnect by itself; reopen it from EventStream::last_event_id().
For an embedded store in your own process, use the feltdb
crate instead; to run the server, cargo install feltdb-server.
License: MIT.