pub struct TableSpec {
pub name: String,
pub columns: Vec<ColumnSpec>,
pub engine: String,
pub order_by: Vec<String>,
pub partition_by: Option<String>,
pub ttl: Option<TtlSpec>,
pub indexes: Vec<IndexSpec>,
pub settings: Vec<(String, String)>,
}Expand description
A table built from a runtime spec. engine is app-controlled (not user input);
order_by entries are validated as column identifiers.
Safety posture for the production-DDL knobs (partition_by, ttl, indexes,
settings): these are app-controlled raw fragments emitted verbatim, with the
sole exception that identifiers (ttl.column, indexes[].name) are validated and
ttl.column must be a real column. Never build the raw fragments from untrusted
input.
Fields§
§name: String§columns: Vec<ColumnSpec>§engine: String§order_by: Vec<String>§partition_by: Option<String>App-controlled raw PARTITION BY expression, e.g.
"(organization_id, toDate(started_at))".
ttl: Option<TtlSpec>Optional table TTL policy.
indexes: Vec<IndexSpec>Secondary data-skipping indexes rendered inside the column parens.
settings: Vec<(String, String)>App-controlled SETTINGS pairs (key, raw-value RHS), e.g.
("storage_policy", "'hot_cold'"), ("index_granularity", "8192").
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TableSpec
impl RefUnwindSafe for TableSpec
impl Send for TableSpec
impl Sync for TableSpec
impl Unpin for TableSpec
impl UnsafeUnpin for TableSpec
impl UnwindSafe for TableSpec
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