feat: integrate thiserror
This commit is contained in:
parent
677fd19bec
commit
5ced11c40d
2 changed files with 15 additions and 4 deletions
|
|
@ -1,17 +1,25 @@
|
|||
|
||||
use std::collections::HashSet;
|
||||
use thiserror::Error;
|
||||
|
||||
use minisql::{operation::{ColumnSelection, Condition, InsertionValues, Operation}, schema::TableSchema, type_system::{DbType, IndexableValue, Value}};
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Error)]
|
||||
pub enum ValidationError {
|
||||
#[error("table {0} does not exist")]
|
||||
TableDoesNotExist(String),
|
||||
#[error("table {0} already exists")]
|
||||
TableExists(String),
|
||||
#[error("column {0} does not exist")]
|
||||
ColumnDoesNotExist(String),
|
||||
#[error("bad column position {0}")]
|
||||
BadColumnPosition(usize),
|
||||
#[error("duplicate column {0}")]
|
||||
DuplicateColumn(String),
|
||||
#[error("type mismatch")]
|
||||
TypeMismatch,
|
||||
#[error("value for required column {0} is missing")]
|
||||
ValueForRequiredColumnIsMissing(String)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue