pub struct AlterDatabase {
pub if_exists: bool,
pub name: Ident,
pub action: AlterDatabaseAction,
pub meta: Meta,
}Expand description
An ALTER DATABASE [IF EXISTS] <name> SET ALIAS TO <alias> statement (DuckDB), gated by
StatementDdlGates::alter_database.
DuckDB’s sole AlterDatabaseStmt production re-aliases an attached database
(third_party/libpg_query/grammar/statements/alter_database.y at the pinned v1.5.4
commit 08e34c447b). The grammar reduces SET <ident> TO <name>, but its action rejects
any keyword but ALIAS, so only SET ALIAS TO is a parse-accept (engine-measured: SET FOO TO is a syntax error, and ALTER DATABASE d RENAME TO e is likewise a syntax error —
DuckDB has no RENAME form for a database). The change is held in an
AlterDatabaseAction enum so a sibling dialect (MySQL’s charset/collation ALTER DATABASE) can add its own action variants without reshaping this node.
Fields§
§if_exists: boolWhether the IF EXISTS existence guard was present in the source.
name: IdentThe database name.
action: AlterDatabaseActionThe change applied to the database.
meta: MetaSource location and node identity.
Trait Implementations§
Source§impl Clone for AlterDatabase
impl Clone for AlterDatabase
Source§fn clone(&self) -> AlterDatabase
fn clone(&self) -> AlterDatabase
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 AlterDatabase
impl Debug for AlterDatabase
Source§impl<'de> Deserialize<'de> for AlterDatabase
impl<'de> Deserialize<'de> for AlterDatabase
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 AlterDatabase
Source§impl Hash for AlterDatabase
impl Hash for AlterDatabase
Source§impl PartialEq for AlterDatabase
impl PartialEq for AlterDatabase
Source§impl Render for AlterDatabase
impl Render for AlterDatabase
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 AlterDatabase
impl Serialize for AlterDatabase
impl StructuralPartialEq for AlterDatabase
Auto Trait Implementations§
impl Freeze for AlterDatabase
impl RefUnwindSafe for AlterDatabase
impl Send for AlterDatabase
impl Sync for AlterDatabase
impl Unpin for AlterDatabase
impl UnsafeUnpin for AlterDatabase
impl UnwindSafe for AlterDatabase
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.