sources
ModuleThe sources resources are exported from.
Contents
10 submodules.
sources::appwrite
Own pageThe Appwrite source: its readers, and the builders that turn what they read into resources.
use utopia_migration::sources::appwrite::get_attribute;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;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;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;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;pub fn get_record(database_type: &str, record: &Array) -> Result<ResourceRef>A row (Database) or document (DocumentsDB, VectorsDB) resource.
sources::appwrite::api_reader
Own pageReading databases through the Appwrite API.
use utopia_migration::sources::appwrite::api_reader::ApiReader;pub struct ApiReaderReads databases through the API's TablesDB service; rows and the rest as the models' arrays.
sources::appwrite::reader
Own pageHow the Appwrite source reads databases: through the API, or straight from the project's database.
use utopia_migration::sources::appwrite::reader::DatabaseReader;pub struct DatabaseReaderReads straight from the project's database (_databases, _attributes,
_indexes and the per-database collections).
Debug.use utopia_migration::sources::appwrite::reader::Cursor;pub enum CursorWhere a cursor points: a resource, or an id.
use utopia_migration::sources::appwrite::reader::ReaderQuery;pub enum ReaderQueryA query of a reader: an API query string, or a database query.
use utopia_migration::sources::appwrite::reader::Reader;pub trait Reader: Send + SyncLists 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;pub fn plain(doc: &Document) -> ArrayA document as a plain array (getArrayCopy()).
pub type DatabaseResolver = Arc<dyn Fn(&Document) -> Db + Send + Sync>Resolves the database a database document's data lives in.
sources::appwrite::source
Own pageAn Appwrite project as the source.
use utopia_migration::sources::appwrite::source::Appwrite;pub struct AppwriteAn Appwrite project as a source.
Debug.pub const SOURCE_API: &str = "api"Read databases through the API.
pub const SOURCE_DATABASE: &str = "database"Read databases straight from the project's database.
sources::csv
Own pageRows of one table from a CSV file, typed by the table's columns.
use utopia_migration::sources::csv::Csv;pub struct CsvRows of one table from a CSV file on a storage device. The header names the columns; values are typed by the table's columns, read from the project's database. The file is deleted after the export.
Debug.use utopia_migration::sources::csv::detect_delimiter;pub fn detect_delimiter<R: Read>(stream: R) -> io::Result<u8>The delimiter of CSV data: of ,, ;, tab and |, the one that
splits the first five non-blank lines into the most consistent number of
fields with the most fields longer than one character (, when none
splits anything).
sources::firebase
Own pageA Firebase project as the source: users from Identity Toolkit, documents from Firestore, files from Cloud Storage.
use utopia_migration::sources::firebase::Firebase;pub struct FirebaseA Firebase project, read with a service account.
Debug.use utopia_migration::sources::firebase::sanitize_bucket_id;pub fn sanitize_bucket_id(id: &str) -> StringA bucket id Appwrite accepts: the first label of a domain-like id, at
most 36 characters of [a-zA-Z0-9._-], not starting with ., _ or -.
sources::json
Own pageRows from a JSON file: an array of objects, streamed.
use utopia_migration::sources::json::Json;pub struct JsonRows of one table from a JSON file on a storage device: each item of the
top-level array is a row ($id and $permissions are taken out of its
attributes). The file is deleted after the export.
Debug.sources::nhost
Own pageAn NHost project as the source: users, the public schema's tables and rows, and storage files, read from its PostgreSQL database; file contents through its storage API.
use utopia_migration::sources::nhost::NHost;pub struct NHostAn NHost project.
Debug.use utopia_migration::sources::nhost::convert_index;pub fn convert_index(definition: &str, table: &ResourceRef) -> Option<ResourceRef>The index of a CREATE <TYPE> INDEX <name> ON <schema>.<table> USING btree (<column>) definition (only those match: a plain CREATE INDEX,
several columns or another method do not).
use utopia_migration::sources::nhost::status_code_from_error;pub fn status_code_from_error(e: &Error) -> i64The status code of an error: its SQLSTATE's, or its positive code.
use utopia_migration::sources::nhost::status_code_from_sql_state;pub fn status_code_from_sql_state(sql_state: Option<&str>) -> i64The status code of a PostgreSQL SQLSTATE.
sources::pg
Own pageuse utopia_migration::sources::pg::Pg;pub struct PgA connection.
Debug.use utopia_migration::sources::pg::Param;pub enum ParamA parameter of a query.
sources::supabase
Own pageA Supabase project as the source: NHost's database export, with Supabase's users, buckets and objects; object contents through its storage API.
use utopia_migration::sources::supabase::Supabase;pub struct SupabaseA Supabase project.
Debug.