CreateView in sqlparser::ast - Rust

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.

True if this is a CREATE OR ALTER VIEW statement

MsSql

The OR REPLACE clause is used to re-create the view if it already exists.

if true, has MATERIALIZED view modifier

View name

If 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

The query that defines the view.

Table options (e.g., WITH (..), OPTIONS (…))

BigQuery: CLUSTER BY columns

MySQL: Optional parameters for the view algorithm, definer, and security context

§
§
§
§
§
§