Rust

appwrite

Module

The Appwrite source: its readers, and the builders that turn what they read into resources.

Contents

3 submodules, and what the module defines itself.

use utopia_migration::sources::appwrite::get_attribute;
Rust
pub fn get_attribute(collection: &ResourceRef, definition: &Array) -> Result<ResourceRef>

The attribute form of get_column for a collection.

use utopia_migration::sources::appwrite::get_column;
Rust
pub fn get_column(table: &ResourceRef, definition: &Array) -> Result<ResourceRef>

A column resource of table from a column definition (as the API or the attributes collection report it). A format given as the type (email, url, ip, enum) and a missing size are resolved the way the server resolves them (resolve).

use utopia_migration::sources::appwrite::get_database;
Rust
pub fn get_database(database_type: &str, database: &Array) -> Result<ResourceRef>

A database resource of database_type (DocumentsDB, VectorsDB, or Database).

use utopia_migration::sources::appwrite::get_entity;
Rust
pub fn get_entity(database_type: &str, entity: &Array) -> Result<ResourceRef>

A table (Database) or collection (DocumentsDB, VectorsDB) resource.

use utopia_migration::sources::appwrite::get_record;
Rust
pub fn get_record(database_type: &str, record: &Array) -> Result<ResourceRef>

A row (Database) or document (DocumentsDB, VectorsDB) resource.

appwrite::api_reader

Own page

Reading databases through the Appwrite API.

use utopia_migration::sources::appwrite::api_reader::ApiReader;
Rust
pub struct ApiReader

Reads databases through the API's TablesDB service; rows and the rest as the models' arrays.

appwrite::reader

Own page

How the Appwrite source reads databases: through the API, or straight from the project's database.

use utopia_migration::sources::appwrite::reader::DatabaseReader;
Rust
pub struct DatabaseReader

Reads straight from the project's database (_databases, _attributes, _indexes and the per-database collections).

Also implements Debug.
use utopia_migration::sources::appwrite::reader::Cursor;
Rust
pub enum Cursor

Where a cursor points: a resource, or an id.

use utopia_migration::sources::appwrite::reader::ReaderQuery;
Rust
pub enum ReaderQuery

A query of a reader: an API query string, or a database query.

use utopia_migration::sources::appwrite::reader::Reader;
Rust
pub trait Reader: Send + Sync

Lists databases, tables, columns, indexes and rows for the Appwrite source, and builds the queries it pages them with.

use utopia_migration::sources::appwrite::reader::plain;
Rust
pub fn plain(doc: &Document) -> Array

A document as a plain array (getArrayCopy()).

Rust
pub type DatabaseResolver = Arc<dyn Fn(&Document) -> Db + Send + Sync>

Resolves the database a database document's data lives in.

appwrite::source

Own page

An Appwrite project as the source.

use utopia_migration::sources::appwrite::source::Appwrite;
Rust
pub struct Appwrite

An Appwrite project as a source.

Also implements Debug.
Rust
pub const SOURCE_API: &str = "api"

Read databases through the API.

Rust
pub const SOURCE_DATABASE: &str = "database"

Read databases straight from the project's database.