pub enum DropObjectKind {
Table,
View,
MaterializedView,
Index,
Schema,
Type,
Sequence,
Macro,
MacroTable,
Trigger,
}Expand description
The kind of object a DROP statement removes.
The routine kinds (FUNCTION/PROCEDURE) take an argument-type signature, so
they are a separate Statement::DropRoutine
statement rather than a variant here;
this covers the object kinds a plain name list can drop.
Variants§
Table
DROP TABLE.
View
DROP VIEW.
MaterializedView
DROP MATERIALIZED VIEW.
Index
DROP INDEX.
Schema
DROP SCHEMA.
Type
DROP TYPE <name> [, …] — a user-defined type (DuckDB/PostgreSQL), gated by
StatementDdlGates::create_type (the same
flag that admits CreateType). The comma list and CASCADE/RESTRICT behaviour
ride the shared DropStatement grammar; DuckDB parse-accepts a multi-name list and
only rejects it at plan time (“can only drop one object at a time”), so the shape is
the general one.
Sequence
DROP SEQUENCE <name> [, …] — a sequence generator (DuckDB/PostgreSQL), gated by
StatementDdlGates::create_sequence (the same
flag that admits CreateSequence). The comma list and CASCADE/RESTRICT ride the
shared DropStatement grammar. DuckDB’s parser accepts DROP SEQUENCE (the
IF EXISTS form binds; the bare/list/CASCADE forms parse but bind-reject a missing
object — engine-measured), so the modelled shape is the general one.
Macro
DROP MACRO <name> [, …] — a scalar macro (DuckDB), gated by
StatementDdlGates::create_macro (the same
flag that admits CreateMacro). Unlike PostgreSQL’s DROP FUNCTION, the macro drop
takes no argument-type signature (DROP MACRO m(int) is a DuckDB syntax error), so it
rides the shared DropStatement name-list grammar rather than the signature
Statement::DropRoutine path — the FUNCTION spelling
(which DuckDB accepts as a synonym) still routes to that routine drop, so the two DROP
spellings land on distinct nodes and no MacroSpelling tag is needed here. The comma
list and CASCADE/RESTRICT ride the shared grammar; DuckDB parse-accepts a multi-name
list and only bind-rejects it (“can only drop one object at a time” — engine-measured).
MacroTable
DROP MACRO TABLE <name> [, …] — a table macro (DuckDB), the drop counterpart of a
CREATE MACRO … AS TABLE. Separate from Macro because DuckDB
keeps scalar and table macros in distinct namespaces (DROP MACRO m drops a “Macro
Function”, DROP MACRO TABLE m a “Table Macro Function” — engine-measured) and the
TABLE keyword must round-trip verbatim. Gated by the same
StatementDdlGates::create_macro flag;
only MACRO TABLE (not TABLE MACRO or FUNCTION TABLE) is accepted — engine-measured.
Trigger
DROP TRIGGER [IF EXISTS] [<schema> .] <name> — a trigger (MySQL / SQLite), gated by
either trigger-modelling flag (SQLite’s
StatementDdlGates::create_trigger or
MySQL’s
StatementDdlGates::compound_statements).
Both dialects spell the same name-only drop (no ON <table>, which is PostgreSQL’s
separate trigger-drop shape), so it rides the shared DropStatement name-list grammar.
Trait Implementations§
Source§impl Clone for DropObjectKind
impl Clone for DropObjectKind
Source§fn clone(&self) -> DropObjectKind
fn clone(&self) -> DropObjectKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DropObjectKind
Source§impl Debug for DropObjectKind
impl Debug for DropObjectKind
Source§impl<'de> Deserialize<'de> for DropObjectKind
impl<'de> Deserialize<'de> for DropObjectKind
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 DropObjectKind
Source§impl Hash for DropObjectKind
impl Hash for DropObjectKind
Source§impl PartialEq for DropObjectKind
impl PartialEq for DropObjectKind
Source§impl Render for DropObjectKind
impl Render for DropObjectKind
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 more