use thiserror::Error;
#[derive(Debug, Error)]
pub enum RusticxError {
#[error("Connection error: {0}")]
Connection(String),
#[error("Query error: {0}")]
Query(String),
#[error("Serialization error: {0}")]
Serialization(String),
#[error("Deserialization error: {0}")]
Deserialization(String),
#[error("Record not found: {0}")]
NotFound(String),
#[error("Duplicate key: {0}")]
DuplicateKey(String),
#[error("Migration error: {0}")]
Migration(String),
#[error("Schema error: {0}")]
Schema(String),
#[error("Transaction error: {0}")]
Transaction(String),
#[error("Pool error: {0}")]
Pool(String),
#[error("Unsupported operation: {0}")]
Unsupported(String),
#[error("Configuration error: {0}")]
Configuration(String),
#[error("Type mismatch: expected {expected}, got {got}")]
TypeMismatch { expected: String, got: String },
#[error("Unknown error: {0}")]
Unknown(String),
}
pub type Result<T> = std::result::Result<T, RusticxError>;