#[non_exhaustive]pub struct TableSuffixRequest<'a> {
pub temporary: bool,
pub primary_key: &'a [String],
pub clustering_columns: &'a [String],
pub version_column: Option<&'a str>,
}Expand description
What a table’s CREATE TABLE is about to say — what
SqlRenderer::render_table_suffix is handed to decide the clause after
the column list.
One struct rather than several arguments, so the slot can learn more about a
table without changing its signature. Razeri builds it; a dialect reads it.
A dialect’s own tests build one with TableSuffixRequest::new and the
with_ methods, which is also why it cannot be written out field by field
outside this crate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.temporary: boolWhether the table is dropped at the end of its session, its transaction or its batch. A transient table that outlives its session is not temporary.
primary_key: &'a [String]The table’s primary-key columns in key order, unquoted. Empty on a table with no primary key.
clustering_columns: &'a [String]The columns the design’s storage plan asked this table be clustered by, unquoted, and only those this table has. Empty on most tables.
version_column: Option<&'a str>The column whose greatest value survives when rows share a key, on the
one table Razeri versions that way: the target of an engine whose
MergeShape is
InsertDedup. None on every other table.
Implementations§
Source§impl<'a> TableSuffixRequest<'a>
impl<'a> TableSuffixRequest<'a>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
A persistent table with no primary key, no clustering columns and no version column.
Sourcepub const fn with_temporary(self, temporary: bool) -> Self
pub const fn with_temporary(self, temporary: bool) -> Self
The same table, temporary or not.
Sourcepub const fn with_primary_key(self, columns: &'a [String]) -> Self
pub const fn with_primary_key(self, columns: &'a [String]) -> Self
The same table, with these primary-key columns.
Sourcepub const fn with_clustering_columns(self, columns: &'a [String]) -> Self
pub const fn with_clustering_columns(self, columns: &'a [String]) -> Self
The same table, with these clustering columns.
Sourcepub const fn with_version_column(self, column: Option<&'a str>) -> Self
pub const fn with_version_column(self, column: Option<&'a str>) -> Self
The same table, with this version column.