pub struct CombinedSchema {
pub table_schemas: HashMap<TableKey, (usize, TableSchema)>,
pub total_columns: usize,
}Expand description
Represents the combined schema from multiple tables (for JOINs)
Fields§
§table_schemas: HashMap<TableKey, (usize, TableSchema)>Map from table name (normalized via TableKey) to (start_index, TableSchema) start_index is where this table’s columns begin in the combined row Keys are always lowercase for case-insensitive lookups
total_columns: usizeTotal number of columns across all tables
Implementations§
Source§impl CombinedSchema
impl CombinedSchema
Sourcepub fn from_table(table_name: String, schema: TableSchema) -> Self
pub fn from_table(table_name: String, schema: TableSchema) -> Self
Create a new combined schema from a single table
Note: Table name is automatically normalized via TableKey for case-insensitive lookups
Sourcepub fn from_derived_table(
alias: String,
column_names: Vec<String>,
column_types: Vec<DataType>,
) -> Self
pub fn from_derived_table( alias: String, column_names: Vec<String>, column_types: Vec<DataType>, ) -> Self
Create a new combined schema from a derived table (subquery result)
Note: Alias is automatically normalized via TableKey for case-insensitive lookups
Sourcepub fn combine(
left: CombinedSchema,
right_table: impl Into<TableKey>,
right_schema: TableSchema,
) -> Self
pub fn combine( left: CombinedSchema, right_table: impl Into<TableKey>, right_schema: TableSchema, ) -> Self
Combine two schemas (for JOIN operations)
Note: Right table name is automatically normalized via TableKey for case-insensitive lookups
Sourcepub fn get_column_index(
&self,
table: Option<&str>,
column: &str,
) -> Option<usize>
pub fn get_column_index( &self, table: Option<&str>, column: &str, ) -> Option<usize>
Look up a column by name (optionally qualified with table name) Uses case-insensitive matching for table/alias and column names
Sourcepub fn get_table(&self, table_name: &str) -> Option<&(usize, TableSchema)>
pub fn get_table(&self, table_name: &str) -> Option<&(usize, TableSchema)>
Get a table schema by name (case-insensitive lookup)
Sourcepub fn contains_table(&self, table_name: &str) -> bool
pub fn contains_table(&self, table_name: &str) -> bool
Check if a table exists (case-insensitive lookup)
Sourcepub fn table_names(&self) -> Vec<String>
pub fn table_names(&self) -> Vec<String>
Get all table names as strings
Sourcepub fn insert_table(
&mut self,
name: impl Into<TableKey>,
start_index: usize,
schema: TableSchema,
)
pub fn insert_table( &mut self, name: impl Into<TableKey>, start_index: usize, schema: TableSchema, )
Insert or update a table in the schema
Trait Implementations§
Source§impl Clone for CombinedSchema
impl Clone for CombinedSchema
Source§fn clone(&self) -> CombinedSchema
fn clone(&self) -> CombinedSchema
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CombinedSchema
impl RefUnwindSafe for CombinedSchema
impl Send for CombinedSchema
impl Sync for CombinedSchema
impl Unpin for CombinedSchema
impl UnwindSafe for CombinedSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more