Rust

destinations

Module

The destinations resources are imported into.

Contents

8 submodules.

destinations::appwrite

Own page

An Appwrite project as the destination: databases are written straight to the project's databases, the rest through the Appwrite API or the platform database.

use utopia_migration::destinations::appwrite::Appwrite;
Rust
pub struct Appwrite

An Appwrite project as a destination.

Also implements Debug.
use utopia_migration::destinations::appwrite::Options;
Rust
pub struct Options

The arguments of Appwrite::new beyond the connection.

Rust
pub type DsnResolver = Arc<dyn Fn(&ResourceRef) -> String + Send + Sync>

Resolves the DSN written into a migrated database's database attribute on the destination.

destinations::appwrite::api

Own page

Users, teams, storage, functions, messaging, sites and rules, written through the Appwrite API.

destinations::appwrite::project

Own page

Project settings, integrations, auth settings and project variables, written to the platform and project databases.

destinations::appwrite::schema

Own page

Databases, tables, columns, indexes and rows, written to the project's databases.

destinations::csv

Own page

Rows exported to a CSV file.

use utopia_migration::destinations::csv::Csv;
Rust
pub struct Csv

Rows of one table exported to <directory>/<filename>.csv on a storage device. Each imported batch writes a header line (when headers are on) and one line per row; values are converted to text (null, true, false, arrays as JSON or their $id). Destination::shutdown copies the file to the device.

Also implements Debug.
use utopia_migration::destinations::csv::CsvOptions;
Rust
pub struct CsvOptions

CSV formatting options.

Also implements Default.

destinations::json

Own page

Rows exported to a JSON file.

use utopia_migration::destinations::json::Json;
Rust
pub struct Json

Rows of one table exported to <directory>/<filename>.json on a storage device: a JSON array of objects with $id, $permissions, $createdAt and $updatedAt first. Batches are written to a local temporary file; Destination::shutdown closes the array and copies it to the device.

Also implements Debug.
use utopia_migration::destinations::json::sanitize_filename;
Rust
pub fn sanitize_filename(filename: &str) -> String

Of the CSV and JSON destinations: :/<>"|*? and bytes outside printable ASCII become _, the result is trimmed, and an empty result (or "0") is export.

destinations::local

Own page

A backup in a local directory.

use utopia_migration::destinations::local::Local;
Rust
pub struct Local

A backup in a local directory: every resource's JSON in backup.json (by group and type, rewritten after each resource), files under files/, deployment archives in deployments/.

Also implements Debug.

destinations::on_duplicate

Own page

What a destination does with a resource it already has.

use utopia_migration::OnDuplicate;
Rust
pub enum OnDuplicate

How a destination treats resources that already exist on it.

use utopia_migration::SchemaAction;
Rust
pub enum SchemaAction

What to do with a schema resource (database, table, column, index): create it, leave the existing one, or update it.