NEW RasterizedDB 1.1.0 is out: sharding and the gateway, the message broker, roles and row-level security, compression, .NET on NuGet, and the enterprise edition. What's new ›
DOCS / RUST CLIENT

Rust client

The native-protocol client and ORM for Rust: queries, models, migrations, transactions, KV.

Getting started with the Rust clientCargo.toml and features, making the server reachable, a first query, a first model, sharing one clientConnectingEvery Options field with defaults; Trust/Peer/PeerAs/Password logins; TLS pinning, private CA, web roots; database selection; connections; timeouts; reconnects; the 1.1.0 trust-role changeQueriesThe query calls, $n parameters and quoting helpers, reading rows by position, many-row writes, notices, the simple-query form, sessions and cancellingTypesThe full Rust/SQL type table, NULL and Option, Numeric, floats, JSON/JSONB, points in time, UUIDs, arrays, Value, SqlEnum, your own ToSql/FromSql typesTransactionsbegin/commit/rollback, the retrying closure, isolation, row locks, savepoints, SQLSTATEs in transactions, connection loss, the idle limit, the Executor traitThe ORM#[derive(Model)] and every attribute, CRUD, upserts, update_many, optimistic locking, timestamps, soft delete, hooks, partitioned tables, the query builder, aggregates, keyset pages and streamsRelationshas_many/has_one/belongs_to/many_to_many/count_of, eager and lazy loading, where_has, attach/detach/sync, foreign keysMigrationsThe Migrator, migrating on connect (Apply/Verify/Off), plan/status/rollback, step kinds, scenarios (baseline, locks, out of order), SyncPolicy model syncKey/value cache from RustUse the server's Redis-compatible cache from Rust: typed values and maps, TTLs, counters, closure queries, models stored as hashes, the ORM's read-through cache with invalidation, caching patterns, a full API reference, errors and limitsMessage broker clientConnect to the built-in broker from Rust: topics, queues, exchanges, the batching producer, push subscriptions with acks, offsets and dead letters, fetch, models as messages, error codes, full option tables with defaultsAdministration APITyped client.admin() calls for stores, table placement, indexes, partitions, tables and stats, config, roles and grants, backups/restore and replication: the statement each sends and what it returnsClient-side shardingSpread tenants over several ordinary servers from Rust: write the shard map, connect a Router, route models with shard_by, merge fan-out reads, run one-shard transactions, move or roll back a tenant with rdb-shard, and handle the six sharding errorsErrorsEvery Error variant, the is_… checks, when a SQLSTATE is available, what to retry, handling patterns

Other parts: RasterizedDB ServerEnterpriseEmbedded engineC# / .NET clientSharding gatewaySetup scriptsDocker recipes

✓ page rendered in 100 µs axum + tera + htmx · no other javascript