pub struct CreateTable {Show 31 fields
pub name: TableRef,
pub on_cluster: Option<OnCluster>,
pub columns: Vec<ColumnDef>,
pub constraints: Vec<TableConstraint>,
pub if_not_exists: bool,
pub temporary: bool,
pub or_replace: bool,
pub table_modifier: Option<String>,
pub as_select: Option<Expression>,
pub as_select_parenthesized: bool,
pub on_commit: Option<OnCommit>,
pub clone_source: Option<TableRef>,
pub clone_at_clause: Option<Expression>,
pub is_copy: bool,
pub shallow_clone: bool,
pub leading_comments: Vec<String>,
pub with_properties: Vec<(String, String)>,
pub teradata_post_name_options: Vec<String>,
pub with_data: Option<bool>,
pub with_statistics: Option<bool>,
pub teradata_indexes: Vec<TeradataIndex>,
pub with_cte: Option<With>,
pub properties: Vec<Expression>,
pub partition_of: Option<Expression>,
pub post_table_properties: Vec<Expression>,
pub mysql_table_options: Vec<(String, String)>,
pub inherits: Vec<TableRef>,
pub on_property: Option<OnProperty>,
pub copy_grants: bool,
pub using_template: Option<Box<Expression>>,
pub rollup: Option<RollupProperty>,
}Expand description
CREATE TABLE statement
Fields§
§name: TableRef§on_cluster: Option<OnCluster>ClickHouse: ON CLUSTER clause for distributed DDL
columns: Vec<ColumnDef>§constraints: Vec<TableConstraint>§if_not_exists: bool§temporary: bool§or_replace: bool§table_modifier: Option<String>Table modifier: DYNAMIC, ICEBERG, EXTERNAL, HYBRID (Snowflake)
as_select: Option<Expression>§as_select_parenthesized: boolWhether the AS SELECT was wrapped in parentheses
on_commit: Option<OnCommit>ON COMMIT behavior for temporary tables
clone_source: Option<TableRef>Clone source table (e.g., CREATE TABLE t CLONE source_table)
clone_at_clause: Option<Expression>Time travel AT/BEFORE clause for CLONE (e.g., AT(TIMESTAMP => ‘…’))
is_copy: boolWhether this is a COPY operation (BigQuery) vs CLONE (Snowflake/Databricks)
shallow_clone: boolWhether this is a SHALLOW CLONE (Databricks/Delta Lake)
leading_comments: Vec<String>Leading comments before the statement
with_properties: Vec<(String, String)>WITH properties (e.g., WITH (FORMAT=‘parquet’))
teradata_post_name_options: Vec<String>Teradata: table options after name before columns (comma-separated)
with_data: Option<bool>Teradata: WITH DATA (true) or WITH NO DATA (false) after AS SELECT
with_statistics: Option<bool>Teradata: AND STATISTICS (true) or AND NO STATISTICS (false)
teradata_indexes: Vec<TeradataIndex>Teradata: Index specifications (NO PRIMARY INDEX, UNIQUE PRIMARY INDEX, etc.)
with_cte: Option<With>WITH clause (CTEs) - for CREATE TABLE … AS WITH … SELECT …
properties: Vec<Expression>Table properties like DEFAULT COLLATE (BigQuery)
partition_of: Option<Expression>PostgreSQL PARTITION OF property (e.g., CREATE TABLE t PARTITION OF parent …)
post_table_properties: Vec<Expression>TSQL: WITH(SYSTEM_VERSIONING=ON(…)) after column definitions
mysql_table_options: Vec<(String, String)>MySQL table options after column definitions (ENGINE=val, AUTO_INCREMENT=val, etc.)
inherits: Vec<TableRef>PostgreSQL INHERITS clause: INHERITS (parent1, parent2, …)
on_property: Option<OnProperty>TSQL ON filegroup or ON filegroup (partition_column) clause
copy_grants: boolSnowflake: COPY GRANTS clause to copy privileges from replaced table
using_template: Option<Box<Expression>>Snowflake: USING TEMPLATE expression for schema inference
rollup: Option<RollupProperty>StarRocks: ROLLUP (r1(col1, col2), r2(col1))
Implementations§
Trait Implementations§
Source§impl Clone for CreateTable
impl Clone for CreateTable
Source§fn clone(&self) -> CreateTable
fn clone(&self) -> CreateTable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more