pub struct TableSchema {
pub name: String,
pub arrow_schema: SchemaRef,
pub primary_key: Vec<String>,
}Expand description
Schema definition for a table tracked by the HTAP engine.
Fields§
§name: StringTable name (must match the OLTP table name).
arrow_schema: SchemaRefArrow schema describing the column types.
primary_key: Vec<String>Column names that form the primary key (required for UPDATE/DELETE propagation).
Implementations§
Source§impl TableSchema
impl TableSchema
Sourcepub fn new(
name: impl Into<String>,
schema: SchemaRef,
primary_key: Vec<String>,
) -> Self
pub fn new( name: impl Into<String>, schema: SchemaRef, primary_key: Vec<String>, ) -> Self
Create a new TableSchema.
name must be a valid SQL identifier (see validate_identifier).
primary_key is a list of column names that uniquely identify a row;
it must be non-empty and every column must exist in schema.
Call TableSchema::validate before passing this to
SchemaRegistry::register, or use register directly (it calls
validate internally).
Sourcepub fn validate(&self) -> Result<(), CoreError>
pub fn validate(&self) -> Result<(), CoreError>
Validate the schema.
Checks:
- Table name and all column names are safe SQL identifiers (
[A-Za-z0-9_]). - At least one primary key column is declared.
- Every declared primary key column exists in the Arrow schema.
§Errors
Returns CoreError::SchemaValidation with a descriptive message if
any check fails.
Trait Implementations§
Source§impl Clone for TableSchema
impl Clone for TableSchema
Source§fn clone(&self) -> TableSchema
fn clone(&self) -> TableSchema
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 moreAuto Trait Implementations§
impl Freeze for TableSchema
impl RefUnwindSafe for TableSchema
impl Send for TableSchema
impl Sync for TableSchema
impl Unpin for TableSchema
impl UnsafeUnpin for TableSchema
impl UnwindSafe for TableSchema
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