Skip to main content

DropObjectKind

Enum DropObjectKind 

Source
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

Source§

fn clone(&self) -> DropObjectKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DropObjectKind

Source§

impl Debug for DropObjectKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DropObjectKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for DropObjectKind

Source§

impl Hash for DropObjectKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DropObjectKind

Source§

fn eq(&self, other: &DropObjectKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Render for DropObjectKind

Source§

fn render(&self, _ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result

Return the render for this value.
Source§

fn operand_binding_power(&self) -> Option<BindingPower>

The binding power this node contributes when it appears as an operand, or None (the default) for a self-delimiting node — an atom, call, or constructor — that never needs parentheses. Read more
Source§

impl Serialize for DropObjectKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DropObjectKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> RenderExt for T
where T: Render,

Source§

fn displayed<'a>(&'a self, ctx: &'a RenderCtx<'a>) -> Displayed<'a, T>

Pair this node with an explicit canonical RenderCtx so format!, to_string, and {} render it. This is the canonical path: the ctx’s resolver and source must match the node’s parse.
Source§

fn debug_sql<'a>(&'a self, resolver: &'a dyn Resolver) -> DebugSql<'a, Self>
where Self: Sized,

Render this node for debugging against an explicitly-supplied resolver (the debug-SQL mitigation), returning a Display adapter. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.