chore: update documentation

This commit is contained in:
Lucas Nogueira
2026-09-22 11:30:47 -03:00
parent d869c162a7
commit a87a3c7d44
104 changed files with 4875 additions and 222 deletions
+14
View File
@@ -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),
}