Rust

[Redis]: documents stored in Redis.

Every key starts with utopia:{namespace}:{database}:

KeyTypeHolds
utopia:{ns}:dbsSETdatabase names (per namespace)
…:colsSETcollection ids of the database
…:meta:{col}HASHschema, attrs, indexes, docCount, sizeBytes
…:doc:{col}:{id}STRINGthe document as JSON
…:idx:{col}SETthe ids of the collection's documents
…:seq:{col}STRINGthe last $sequence given
…:perm:{col}:{r|c|u|d|w}:{role}SETids a role may act on
…:perm:doc:{col}:{id}HASHrole => its action letters
Rust
use utopia_database::Adapter;
use utopia_database::adapter::redis::Redis;

let adapter = Redis::connect("redis://localhost:6379/3").await?;
adapter.set_database("appwrite")?;
adapter.set_namespace("_1")?;
adapter.create("appwrite").await?;
Compiles in CI; needs a running service to execute.

Contents

3 submodules, and what the module defines itself.

use utopia_database::adapter::redis::Redis;
Rust
pub struct Redis

The Redis adapter. See the module docs.

Rust
pub const KEY_PREFIX: &str = "utopia"

The prefix of every key (KEY_PREFIX).

Rust
pub const SEP: &str = ":"

The separator of key segments (SEP).

redis::documents

Own page

Documents of the Redis adapter: reads, writes, bulk writes, upserts, sequences, deletes and increments, journalled inside transactions.

redis::operators

Own page

Operators of the Redis adapter: applied here to the stored value, as the SQL adapters apply them in SQL.

redis::schema

Own page

Databases, collections, attributes, indexes and relationships of the Redis adapter: the meta hash of each collection and the scans that rewrite or drop its keys.