mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-26 21:41:48 +02:00
chore: update documentation
This commit is contained in:
@@ -4,16 +4,30 @@
|
||||
|
||||
use serde::{Serialize, Serializer};
|
||||
|
||||
/// Errors that can happen while connecting to a database, running migrations
|
||||
/// or executing a query.
|
||||
///
|
||||
/// Serializes to its [`std::fmt::Display`] representation, which is what the
|
||||
/// frontend receives when a command fails.
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
/// An error reported by [`sqlx`], such as a failed connection or a query the database rejected.
|
||||
#[error(transparent)]
|
||||
Sql(#[from] sqlx::Error),
|
||||
/// A migration registered with [`crate::Builder::add_migrations`] could not be resolved or applied.
|
||||
#[error(transparent)]
|
||||
Migration(#[from] sqlx::migrate::MigrateError),
|
||||
/// The connection string is missing its `scheme:` prefix, or the scheme does not
|
||||
/// match any of the enabled database drivers. Contains the offending connection string.
|
||||
#[error("invalid connection url: {0}")]
|
||||
InvalidDbUrl(String),
|
||||
/// The requested database has not been connected to with the `load` command
|
||||
/// and is not listed in the plugin's `preload` configuration.
|
||||
/// Contains the connection string of the database.
|
||||
#[error("database {0} not loaded")]
|
||||
DatabaseNotLoaded(String),
|
||||
/// A value selected from the database has a SQL type that cannot be converted
|
||||
/// to JSON. Contains the name of that SQL type.
|
||||
#[error("unsupported datatype: {0}")]
|
||||
UnsupportedDatatype(String),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user