use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Error, Debug)]
pub enum Error {
#[error("MySQL error: {0}")]
MySql(#[from] mysql_async::Error),
#[error("Type conversion error: expected {expected}, got {actual}")]
TypeConversion {
expected: &'static str,
actual: String,
},
#[error("Column not found: {0}")]
ColumnNotFound(String),
#[error("Unexpected null value for column: {0}")]
UnexpectedNull(String),
#[error("Query error: {0}")]
Query(String),
#[error("Connection error: {0}")]
Connection(String),
#[error("Failed to decode row: {0}")]
RowDecode(String),
#[error("{0}")]
Other(Box<dyn std::error::Error + Send + Sync>),
}