pub struct TableSchema {
pub name: String,
pub columns: Vec<ColumnSchema>,
pub access_pattern: AccessPattern,
pub temperature: DataTemperature,
pub workload: WorkloadType,
pub primary_key: Vec<String>,
pub shard_key: Option<String>,
pub partition_key: Option<PartitionKey>,
pub preferred_nodes: Vec<String>,
pub estimated_rows: u64,
pub avg_row_size: usize,
}Expand description
Table schema information
Fields§
§name: StringTable name
columns: Vec<ColumnSchema>Columns
access_pattern: AccessPatternAccess pattern classification
temperature: DataTemperatureTemperature (HOT/WARM/COLD)
workload: WorkloadTypeWorkload type
primary_key: Vec<String>Primary key columns
shard_key: Option<String>Shard key (if sharded)
partition_key: Option<PartitionKey>Partition key (if partitioned)
preferred_nodes: Vec<String>Preferred nodes
estimated_rows: u64Estimated row count
avg_row_size: usizeAverage row size in bytes
Implementations§
Source§impl TableSchema
impl TableSchema
Sourcepub fn with_column(self, column: ColumnSchema) -> Self
pub fn with_column(self, column: ColumnSchema) -> Self
Add a column
Sourcepub fn with_access_pattern(self, pattern: AccessPattern) -> Self
pub fn with_access_pattern(self, pattern: AccessPattern) -> Self
Set access pattern
Sourcepub fn with_temperature(self, temp: DataTemperature) -> Self
pub fn with_temperature(self, temp: DataTemperature) -> Self
Set temperature
Sourcepub fn with_workload(self, workload: WorkloadType) -> Self
pub fn with_workload(self, workload: WorkloadType) -> Self
Set workload
Sourcepub fn with_primary_key(self, columns: Vec<String>) -> Self
pub fn with_primary_key(self, columns: Vec<String>) -> Self
Set primary key
Sourcepub fn with_shard_key(self, key: impl Into<String>) -> Self
pub fn with_shard_key(self, key: impl Into<String>) -> Self
Set shard key
Sourcepub fn with_preferred_node(self, node: impl Into<String>) -> Self
pub fn with_preferred_node(self, node: impl Into<String>) -> Self
Add preferred node
Sourcepub fn with_estimated_rows(self, rows: u64) -> Self
pub fn with_estimated_rows(self, rows: u64) -> Self
Set estimated rows
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
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>
Converts
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>
Converts
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