Move TablePosition into schema

This commit is contained in:
Yuriy Dupyn 2024-01-28 18:43:53 +01:00
parent a2180a3e32
commit ec0a4f2510
4 changed files with 5 additions and 6 deletions

View file

@ -4,7 +4,7 @@ use thiserror::Error;
use crate::syntax;
use crate::syntax::{RawTableSchema, ColumnSchema, RawQuerySyntax};
use minisql::operation;
use minisql::{operation::Operation, type_system::Value, schema::{TableSchema, ColumnName, TableName}, type_system::DbType, interpreter::{TablePosition, DbSchema}};
use minisql::{operation::Operation, type_system::Value, schema::{TableSchema, ColumnName, Column, TableName, TablePosition}, type_system::DbType, interpreter::DbSchema};
#[derive(Debug, Error)]
pub enum ValidationError {
@ -158,7 +158,7 @@ fn validate_insert(table_name: TableName, insertion_values: syntax::InsertionVal
}
// Check types and prepare for creation of InsertionValues for the interpreter
let mut values_map: BTreeMap<_, Value> = BTreeMap::new(); // The reason for using BTreeMap
let mut values_map: BTreeMap<Column, Value> = BTreeMap::new(); // The reason for using BTreeMap
// instead of HashMap is that we need
// to get the values in a vector
// sorted by the key.