#[derive(Debug, thiserror::Error)]
pub enum DbError {
#[error("sql error: {0}")]
Sql(String),
#[error("unique constraint violation")]
UniqueViolation,
#[error("type mismatch at column {col}: expected {expected}")]
TypeMismatch {
col: usize,
expected: &'static str,
},
#[error("integer value {0} out of range for signed 64-bit storage")]
IntegerOutOfRange(i128),
#[error("column index {0} out of bounds")]
ColumnOutOfBounds(usize),
#[error("unexpected null at column {0}")]
UnexpectedNull(usize),
}