Merge remote-tracking branch 'origin/parsing' into parsing
This commit is contained in:
commit
f30d749962
3 changed files with 23 additions and 7 deletions
|
|
@ -1,19 +1,32 @@
|
|||
|
||||
use std::collections::HashSet;
|
||||
use thiserror::Error;
|
||||
|
||||
use minisql::{operation::{ColumnSelection, Condition, InsertionValues, Operation}, schema::{TableSchema, ColumnName, TableName}, type_system::DbType};
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Error)]
|
||||
pub enum ValidationError {
|
||||
#[error("table {0} does not exist")]
|
||||
TableDoesNotExist(TableName),
|
||||
#[error("table {0} already exists")]
|
||||
TableAlreadyExists(TableName),
|
||||
// TODO
|
||||
// #[error("columns {0} do not exist")]
|
||||
#[error("columns do not exist")]
|
||||
ColumnsDoNotExist(Vec<ColumnName>),
|
||||
DuplicateColumn(String),
|
||||
#[error("duplicate column {0}")]
|
||||
DuplicateColumn(ColumnName),
|
||||
// TODO: You need to actually print the error message
|
||||
#[error("type mismatch")]
|
||||
TypeMismatch(TypeMismatch),
|
||||
// TODO
|
||||
// #[error("values for required columns {0} are missing")]
|
||||
#[error("values for required columns are missing")]
|
||||
RequiredColumnsAreMissing(Vec<ColumnName>)
|
||||
}
|
||||
|
||||
// TODO: Add derive(Error)
|
||||
#[derive(Debug)]
|
||||
pub struct TypeMismatch {
|
||||
pub column_name: ColumnName,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue