pub struct MappingSchema { /* private fields */ }Expand description
A mapping-based schema implementation
Supports nested schemas with different levels:
- Level 1:
{table: {col: type}} - Level 2:
{db: {table: {col: type}}} - Level 3:
{catalog: {db: {table: {col: type}}}}
Implementations§
Source§impl MappingSchema
impl MappingSchema
Sourcepub fn with_dialect(dialect: DialectType) -> Self
pub fn with_dialect(dialect: DialectType) -> Self
Create a schema with a specific dialect
Sourcepub fn without_normalization(self) -> Self
pub fn without_normalization(self) -> Self
Create a schema with normalization disabled
Sourcepub fn set_visible_columns(&mut self, table: &str, columns: &[&str])
pub fn set_visible_columns(&mut self, table: &str, columns: &[&str])
Set visibility for columns in a table
Trait Implementations§
Source§impl Clone for MappingSchema
impl Clone for MappingSchema
Source§fn clone(&self) -> MappingSchema
fn clone(&self) -> MappingSchema
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MappingSchema
impl Debug for MappingSchema
Source§impl Default for MappingSchema
impl Default for MappingSchema
Source§impl Schema for MappingSchema
impl Schema for MappingSchema
Source§fn dialect(&self) -> Option<DialectType>
fn dialect(&self) -> Option<DialectType>
Get the dialect associated with this schema (if any)
Source§fn add_table(
&mut self,
table: &str,
columns: &[(String, DataType)],
_dialect: Option<DialectType>,
) -> SchemaResult<()>
fn add_table( &mut self, table: &str, columns: &[(String, DataType)], _dialect: Option<DialectType>, ) -> SchemaResult<()>
Add or update a table in the schema
Source§fn column_names(&self, table: &str) -> SchemaResult<Vec<String>>
fn column_names(&self, table: &str) -> SchemaResult<Vec<String>>
Get column names for a table
Source§fn get_column_type(&self, table: &str, column: &str) -> SchemaResult<DataType>
fn get_column_type(&self, table: &str, column: &str) -> SchemaResult<DataType>
Get the type of a column in a table
Source§fn supported_table_args(&self) -> &[&str]
fn supported_table_args(&self) -> &[&str]
Get supported table argument levels
Auto Trait Implementations§
impl Freeze for MappingSchema
impl RefUnwindSafe for MappingSchema
impl Send for MappingSchema
impl Sync for MappingSchema
impl Unpin for MappingSchema
impl UnwindSafe for MappingSchema
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
Mutably borrows from an owned value. Read more