pub struct UseStatement {
pub name: ObjectName,
pub meta: Meta,
}Expand description
A USE <schema> (MySQL) / USE <catalog> [. <schema>] (DuckDB) catalog/schema-switch
statement (gated by
UtilitySyntax::use_statement).
Sets the default catalog and schema for subsequent unqualified names — DuckDB’s
engine implements it as a SET schema, MySQL’s as SQLCOM_CHANGE_DB, but syntactically
it is its own statement. The name arity is dialect data gated by
UtilitySyntax::use_qualified_name: DuckDB accepts
USE db and USE db.schema but rejects a three-part USE a.b.c at parse time
(Expected "USE database" or "USE database.schema"), while MySQL’s USE ident takes a
single unqualified schema and ER_PARSE_ERRORs any dotted name (engine-measured on
mysql:8) — so this holds an ObjectName of one or two Idents and the parser
enforces whichever bound the dialect does. Under
UtilitySyntax::use_string_literal_name DuckDB also
admits a single-part Sconst target (USE 'n' / E'n' / $$n$$), folded into a
single-quoted Ident so the quotes round-trip. Non-generic, like DetachStatement:
a qualified name carries no expressions or extension nodes.
Fields§
§name: ObjectNameName referenced by this syntax.
meta: MetaSource location and node identity.
Trait Implementations§
Source§impl Clone for UseStatement
impl Clone for UseStatement
Source§fn clone(&self) -> UseStatement
fn clone(&self) -> UseStatement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UseStatement
impl Debug for UseStatement
Source§impl<'de> Deserialize<'de> for UseStatement
impl<'de> Deserialize<'de> for UseStatement
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 Eq for UseStatement
Source§impl Hash for UseStatement
impl Hash for UseStatement
Source§impl PartialEq for UseStatement
impl PartialEq for UseStatement
Source§impl Render for UseStatement
impl Render for UseStatement
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 Serialize for UseStatement
impl Serialize for UseStatement
impl StructuralPartialEq for UseStatement
Auto Trait Implementations§
impl Freeze for UseStatement
impl RefUnwindSafe for UseStatement
impl Send for UseStatement
impl Sync for UseStatement
impl Unpin for UseStatement
impl UnsafeUnpin for UseStatement
impl UnwindSafe for UseStatement
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.