StaticconnectConnect to an Oxia service and wait for the initial shard assignments to arrive before returning.
host:port of any Oxia server. The client
uses this address only to discover shard assignments; subsequent
requests go directly to each shard's leader.
See OxiaClientOptions.
Associate a value with a key.
The key to write. When PutOptions.sequenceKeysDeltas is used this is the prefix; the returned PutResult.key is the full server-assigned key.
Bytes to store. Strings are encoded as UTF-8.
See PutOptions.
The final key and version metadata for the written record.
UnexpectedVersionIdError if expectedVersionId
mismatches the server's current version.
SessionNotFoundError for an ephemeral put when the client's session on the target shard no longer exists server-side.
InvalidOptionsError for incompatible option
combinations (e.g. sequenceKeysDeltas without partitionKey).
Delete the record stored at key.
The key to delete.
See DeleteOptions.
true if a record existed and was removed, false if no
record was found at that key (or at that key within the target
partition).
UnexpectedVersionIdError if expectedVersionId
mismatches the server's current version.
Delete every record whose key falls in [minKeyInclusive, maxKeyExclusive).
Without a partitionKey the operation is fanned out to every shard;
with one it targets a single shard.
Bounds are interpreted in Oxia's hierarchical key order — see https://oxia-db.github.io/docs/features/oxia-key-sorting
Start of the range (inclusive).
End of the range (exclusive).
See DeleteRangeOptions.
Retrieve the record for a key.
With the default EQUAL comparison this is an exact-match lookup
on a single shard. With any other ComparisonType — or with
useIndex — the client fans out to every shard and picks the best
match in hierarchical key order.
The key to look up. When useIndex is set, this is
treated as a secondary key for that index.
See GetOptions.
The matched record (primary key, value, and version).
KeyNotFoundError if no record matches.
List every key in [minKeyInclusive, maxKeyExclusive).
Without a partitionKey, each shard is queried in parallel and the
results are merged. Keys are returned in Oxia's hierarchical sort
order — see https://oxia-db.github.io/docs/features/oxia-key-sorting
Use OxiaClient.rangeScan if you also need the values.
Start of the range (inclusive).
End of the range (exclusive).
See ListOptions.
Sorted keys in the range, or [] if none match.
Stream records in [minKeyInclusive, maxKeyExclusive) as an
AsyncIterable<GetResult>.
Without a partitionKey, one streaming RPC is opened per shard and
the results are merged in hierarchical key order. Break out of the
for await (...) loop to cancel the remaining server streams.
Use OxiaClient.list if you only need the keys (cheaper).
Start of the range (inclusive).
End of the range (exclusive).
See RangeScanOptions.
Subscribe to change notifications across every shard. Returns an
AsyncIterable that yields one Notification per change; the
returned object's close() method stops the subscription and ends
the iterator. Multiple subscriptions can run concurrently.
Subscribe to updates on a sequential key. Yields the latest assigned
key each time the sequence advances; the returned object's close()
method ends the subscription.
The key prefix used with sequence-key puts.
Requires partitionKey to route to the owning shard.
Release all resources held by the client: close any open sessions (triggering server-side removal of this client's ephemerals), stop the shard-assignment watcher, and close every gRPC channel.
Idempotent. Any subsequent client call throws OxiaError.
Asynchronous client for the Oxia service.
Build one with OxiaClient.connect. Call OxiaClient.close when done to release the gRPC channels, stop the background shard-assignment watcher, and cleanly tear down any open sessions.
The client is safe to use from multiple async contexts — every method is non-blocking and internally dispatches to the appropriate shard leader.
Example