pub struct CreateView {Show 16 fields
pub or_alter: bool,
pub or_replace: bool,
pub materialized: bool,
pub secure: bool,
pub name: ObjectName,
pub name_before_not_exists: bool,
pub columns: Vec<ViewColumnDef>,
pub query: Box<Query>,
pub options: CreateTableOptions,
pub cluster_by: Vec<Ident>,
pub comment: Option<String>,
pub with_no_schema_binding: bool,
pub if_not_exists: bool,
pub temporary: bool,
pub to: Option<ObjectName>,
pub params: Option<CreateViewParams>,
}Expand description
CREATE VIEW statement.
Fields§
§or_alter: boolTrue if this is a CREATE OR ALTER VIEW statement
or_replace: boolThe OR REPLACE clause is used to re-create the view if it already exists.
materialized: boolif true, has MATERIALIZED view modifier
secure: boolSnowflake: SECURE view modifier https://docs.snowflake.com/en/sql-reference/sql/create-view#syntax
name: ObjectNameView name
name_before_not_exists: boolIf if_not_exists is true, this flag is set to true if the view name comes before the IF NOT EXISTS clause.
Example:
CREATE VIEW myview IF NOT EXISTS AS SELECT 1`Otherwise, the flag is set to false if the view name comes after the clause Example:
CREATE VIEW IF NOT EXISTS myview AS SELECT 1`columns: Vec<ViewColumnDef>Optional column definitions
query: Box<Query>The query that defines the view.
options: CreateTableOptionsTable options (e.g., WITH (..), OPTIONS (…))
cluster_by: Vec<Ident>BigQuery: CLUSTER BY columns
comment: Option<String>Snowflake: Views can have comments in Snowflake. https://docs.snowflake.com/en/sql-reference/sql/create-view#syntax
with_no_schema_binding: boolif true, has RedShift [WITH NO SCHEMA BINDING] clause https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_VIEW.html
if_not_exists: boolif true, has SQLite IF NOT EXISTS clause https://www.sqlite.org/lang_createview.html
temporary: boolif true, has SQLite TEMP or TEMPORARY clause https://www.sqlite.org/lang_createview.html
to: Option<ObjectName>if not None, has Clickhouse TO clause, specify the table into which to insert results
https://clickhouse.com/docs/en/sql-reference/statements/create/view#materialized-view
params: Option<CreateViewParams>MySQL: Optional parameters for the view algorithm, definer, and security context
Trait Implementations§
Source§impl Clone for CreateView
impl Clone for CreateView
Source§fn clone(&self) -> CreateView
fn clone(&self) -> CreateView
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateView
impl Debug for CreateView
Source§impl Display for CreateView
impl Display for CreateView
Source§impl From<CreateView> for Statement
impl From<CreateView> for Statement
Source§fn from(cv: CreateView) -> Self
fn from(cv: CreateView) -> Self
Source§impl Hash for CreateView
impl Hash for CreateView
Source§impl Ord for CreateView
impl Ord for CreateView
Source§fn cmp(&self, other: &CreateView) -> Ordering
fn cmp(&self, other: &CreateView) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CreateView
impl PartialEq for CreateView
Source§impl PartialOrd for CreateView
impl PartialOrd for CreateView
Source§impl Spanned for CreateView
impl Spanned for CreateView
Source§impl Visit for CreateView
impl Visit for CreateView
Source§impl VisitMut for CreateView
impl VisitMut for CreateView
Source§fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
VisitorMut. Read more