pub struct TableConfig {
pub table: String,
pub columns: HashMap<String, String>,
pub extra_columns: HashMap<String, ColumnDef>,
pub skip_columns: HashSet<String>,
}Expand description
Per-table schema configuration.
Fields§
§table: StringPhysical table name (or Redis key component).
columns: HashMap<String, String>Column name overrides: logical_name -> db_column_name.
Fields not listed here use their logical name unchanged.
extra_columns: HashMap<String, ColumnDef>Extra columns to include in DDL, INSERT, and SELECT statements. Populated by hooks at runtime; schema config declares the column definitions so backends know the SQL type and default value.
skip_columns: HashSet<String>Logical column names to omit from DDL, INSERT, and SELECT.
Use when the physical schema lacks a standard column
(e.g. a team’s RESPONSES table has no safety_identifier).
Implementations§
Source§impl TableConfig
impl TableConfig
Sourcepub fn with_table(name: &str) -> Self
pub fn with_table(name: &str) -> Self
Create a TableConfig with the given table name and no column overrides.
Sourcepub fn col<'a>(&'a self, field: &'a str) -> &'a str
pub fn col<'a>(&'a self, field: &'a str) -> &'a str
Resolve a column name.
Returns the remapped name if an override is configured, or the logical field name unchanged otherwise.
Sourcepub fn is_skipped(&self, field: &str) -> bool
pub fn is_skipped(&self, field: &str) -> bool
Returns true if field is in the skip_columns set.
Skipped columns are omitted from DDL, INSERT, and SELECT statements.
Sourcepub fn qualified_table(&self, owner: Option<&str>) -> String
pub fn qualified_table(&self, owner: Option<&str>) -> String
Fully qualified table name, e.g. ADMIN."MY_TABLE" with an owner
or just my_table without.
The table name is quoted to preserve case. For Oracle, call
SchemaConfig::uppercase_for_oracle() first so the quoted names match
Oracle’s uppercase catalog entries.
Trait Implementations§
Source§impl Clone for TableConfig
impl Clone for TableConfig
Source§fn clone(&self) -> TableConfig
fn clone(&self) -> TableConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TableConfig
impl Debug for TableConfig
Source§impl Default for TableConfig
impl Default for TableConfig
Source§fn default() -> TableConfig
fn default() -> TableConfig
Source§impl<'de> Deserialize<'de> for TableConfigwhere
TableConfig: Default,
impl<'de> Deserialize<'de> for TableConfigwhere
TableConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for TableConfig
impl PartialEq for TableConfig
Source§impl Serialize for TableConfig
impl Serialize for TableConfig
impl StructuralPartialEq for TableConfig
Auto Trait Implementations§
impl Freeze for TableConfig
impl RefUnwindSafe for TableConfig
impl Send for TableConfig
impl Sync for TableConfig
impl Unpin for TableConfig
impl UnsafeUnpin for TableConfig
impl UnwindSafe for TableConfig
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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