pub struct CreateView<X: Extension = NoExt> {Show 13 fields
pub or_replace: bool,
pub options: ViewOptions,
pub materialized: bool,
pub recursive: bool,
pub temporary: Option<TemporaryTableKind>,
pub if_not_exists: bool,
pub name: ObjectName,
pub columns: ThinVec<Ident>,
pub to: Option<ObjectName>,
pub query: Box<Query<X>>,
pub check_option: Option<ViewCheckOption>,
pub with_data: Option<bool>,
pub meta: Meta,
}Expand description
CREATE [OR REPLACE] [TEMP|TEMPORARY] VIEW and CREATE MATERIALIZED VIEW,
with the AS <query> body that every view shares (a view body reuses Query
rather than re-deriving the SELECT grammar).
One node covers both spellings, distinguished by materialized. The divergent
tails are mutually exclusive by construction: the parser fills check_option
only for a regular view and with_data only for a materialized one. OR REPLACE and the MATERIALIZED keyword (with its WITH [NO] DATA populate
clause) are PostgreSQL extensions gated by schema_change_syntax dialect data;
the ANSI WITH [CASCADED|LOCAL] CHECK OPTION is always accepted.
recursive records the CREATE [OR REPLACE] [TEMP|TEMPORARY] RECURSIVE VIEW
spelling (DuckDB, gated by
ViewSequenceClauseSyntax::recursive_views):
the keyword
sits between the TEMP/TEMPORARY prefix and VIEW, never composes with
MATERIALIZED (engine-rejected), and — mirroring the engine, which desugars a
recursive view to WITH RECURSIVE — requires the explicit columns list, so
the parser rejects the bare RECURSIVE VIEW v AS … form.
Fields§
§or_replace: boolWhether the or replace form was present in the source.
options: ViewOptionsThe MySQL [ALGORITHM = …] [DEFINER = …] [SQL SECURITY …] definition-option prefix
(see ViewOptions); all-None for every non-MySQL view and a bare MySQL view. The
options sit between OR REPLACE and the VIEW keyword.
materialized: boolWhether the materialized form was present in the source.
recursive: boolWhether the recursive form was present in the source.
temporary: Option<TemporaryTableKind>Optional temporary for this syntax.
if_not_exists: boolWhether the if not exists form was present in the source.
name: ObjectNameName referenced by this syntax.
columns: ThinVec<Ident>Columns in source order.
to: Option<ObjectName>Optional TO <target> storage relation for dialects that expose one.
query: Box<Query<X>>Query governed by this node.
check_option: Option<ViewCheckOption>Optional check option for this syntax.
with_data: Option<bool>Whether the with data form was present in the source.
meta: MetaSource location and node identity.
Trait Implementations§
Source§impl<X: Clone + Extension> Clone for CreateView<X>
impl<X: Clone + Extension> Clone for CreateView<X>
Source§fn clone(&self) -> CreateView<X>
fn clone(&self) -> CreateView<X>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, X> Deserialize<'de> for CreateView<X>where
X: Deserialize<'de> + Extension,
impl<'de, X> Deserialize<'de> for CreateView<X>where
X: Deserialize<'de> + Extension,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl<X: Eq + Extension> Eq for CreateView<X>
Source§impl<X: Extension + Render> Render for CreateView<X>
impl<X: Extension + Render> Render for CreateView<X>
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl<X> Serialize for CreateView<X>
impl<X> Serialize for CreateView<X>
Source§impl<X: Extension> Spanned for CreateView<X>
impl<X: Extension> Spanned for CreateView<X>
impl<X: PartialEq + Extension> StructuralPartialEq for CreateView<X>
Auto Trait Implementations§
impl<X> Freeze for CreateView<X>
impl<X> RefUnwindSafe for CreateView<X>where
X: RefUnwindSafe,
impl<X> Send for CreateView<X>where
X: Send,
impl<X> Sync for CreateView<X>where
X: Sync,
impl<X> Unpin for CreateView<X>
impl<X> UnsafeUnpin for CreateView<X>
impl<X> UnwindSafe for CreateView<X>where
X: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.