Rust

Database

Partly Rust
Document database: collections, attributes, indexes, documents, queries, permissions, relationships and tenancy over pluggable adapters (PostgreSQL, MariaDB, MySQL, SQLite, in-memory, Redis, Pool, Mirror).

In Appwrite#

Appwrite runs some of its classes from the Rust crate; the rest are still PHP.

4 PHP classes served from Rust
Rust 107,825 lines (86,092 code)split
PartCodeCommentsBlankTotalFiles
Rust source86,09212,6469,087107,825251

Comments include doc comments. Each side counts its src/.

Served from Rust (4)
Utopia\Database\DateTimeUtopia\Database\IdUtopia\Database\PermissionUtopia\Database\Role

Install#

Shell
cargo add utopia-database

Overview#

A document database: collections with typed attributes and indexes, documents with permissions, queries, relationships, tenancy and caching, over pluggable storage adapters.

The crate reads and writes the same tables, rows and metadata as utopia-php/database, so PHP and Rust services share one dataset.

Port status

Only the modules without I/O are here so far: identifiers, roles, permissions, dates and the errors they fail with. The rest of the crate (the model, the adapters, the validators and the Error marks they set) comes from appwrite/appwrite#14308.

PHP classes and their Rust items

PHPRust
Utopia\Database\Idid
Utopia\Database\RoleRole
Utopia\Database\Permission, PermissionTypePermission, PermissionType
Utopia\Database\DateTimedatetime
Utopia\Database\Exception and Exception\*Error, Kind

Modules#

Each module groups one concept of the library. Internal ones hold items the crate re-exports at its root.

API#

What utopia_database exports at its root.