use thiserror::Error;

/// Database adapter result type.
pub type DatabaseResult<T> = Result<T, DatabaseError>;

/// Database adapter errors.
#[derive(Debug, Error)]
pub enum DatabaseError {
    /// SQLx returned an error.
    #[error("database error: {0}")]
    Sqlx(#[from] sqlx::Error),

    /// The requested database kind is not enabled.
    #[error("database kind is not enabled: {0}")]
    Unsupported(String),
}
