Skip to main content

CommandPlan

Enum CommandPlan 

Source
pub enum CommandPlan {
Show 64 variants CreateTable(Box<CreateTable>), CreateTableIfNotExists(DeferredCreateTable), CreateIndex(CreateIndex), Insert(Box<InsertPlan>), Update(Box<UpdatePlan>), Delete(Box<DeletePlan>), Drop(DropStmt), AlterTable(Box<AlterTableStmt>), AlterView(AlterViewStmt), CreateView { name: String, column_names: Vec<String>, query: Box<QueryPlan>, or_replace: bool, persistence: RelationPersistence, options: Vec<(String, String)>, }, CreateMaterializedView { name: String, column_names: Vec<String>, if_not_exists: bool, with_no_data: bool, options: Vec<(String, String)>, query: Box<QueryPlan>, }, RefreshMaterializedView { name: String, concurrently: bool, with_no_data: bool, }, CreateSchema { name: Option<String>, if_not_exists: bool, authorization: Option<SchemaAuthorization>, }, AlterSchemaOwner { name: String, new_owner: String, }, Notify { channel: String, payload: String, }, Listen { channel: String, }, Unlisten { channel: Option<String>, }, SetVariable { name: String, value: String, local: bool, is_default: bool, }, ResetVariable { name: String, }, ResetAllVariables, SetConstraints { constraints: Vec<SetConstraintName>, deferred: bool, }, ShowVariable { name: String, }, Discard { target: DiscardTarget, }, Load { library: String, }, Explain { analyze: bool, verbose: bool, format: Option<String>, body: Box<UnifiedPlan>, }, Analyze { table: Option<String>, }, Vacuum(VacuumStmt), Truncate { tables: Vec<TruncateTarget>, cascade: bool, restart_identity: bool, }, Transaction(TransactionStmt), DeclareCursor { name: String, binary: bool, scroll: Option<bool>, hold: bool, query: Box<QueryPlan>, }, FetchCursor(FetchCursorStmt), CloseCursor { name: Option<String>, }, CreateSequence(CreateSequence), CreateDomain(CreateDomain), AlterSequence(AlterSequence), CreateTableAs { name: String, if_not_exists: bool, column_names: Vec<String>, with_no_data: bool, persistence: RelationPersistence, on_commit: OnCommitAction, query: Box<QueryPlan>, }, Prepare { name: String, parameter_types: Vec<ColumnType>, body: Box<UnifiedPlan>, }, Execute { name: String, params: Vec<ExpressionPlan>, }, Deallocate { name: Option<String>, }, CreateForeignServer(CreateForeignServer), CreateForeignTable(CreateForeignTable), CreateForeignTableIfNotExists(DeferredCreateForeignTable), AlterForeignTable(AlterForeignTableStmt), Merge(Box<MergePlan>), CreateFunction(Box<CreateFunction>), DropFunction(DropFunctionStmt), AlterRoutine(AlterRoutineStmt), AlterRoutineOwner(AlterRoutineOwnerStmt), RenameRoutine(RenameRoutineStmt), GrantRoutine(GrantRoutineStmt), GrantTable(GrantTableStmt), GrantSequence(GrantSequenceStmt), GrantDatabase(GrantDatabaseStmt), GrantSchema(GrantSchemaStmt), GrantRole(GrantRoleStmt), CreateRole(CreateRoleStmt), AlterRole(AlterRoleStmt), DropRole(DropRoleStmt), CreateTrigger(CreateTrigger), DropTrigger(DropTrigger), CreateRule(CreateRule), DropRule(DropRule), DoBlock { language: String, body: String, }, Call { name: String, args: Vec<ExpressionPlan>, },
}
Expand description

Non-query statement plans. Mutations own physical sources and scalar IR; query-bearing catalog commands own explicit query children. Typed DDL and procedural payloads contain catalog data, never a second SQL dispatcher.

Variants§

§

CreateTable(Box<CreateTable>)

§

CreateTableIfNotExists(DeferredCreateTable)

§

CreateIndex(CreateIndex)

§

Insert(Box<InsertPlan>)

§

Update(Box<UpdatePlan>)

§

Delete(Box<DeletePlan>)

§

Drop(DropStmt)

§

AlterTable(Box<AlterTableStmt>)

§

AlterView(AlterViewStmt)

§

CreateView

Fields

§name: String
§column_names: Vec<String>
§or_replace: bool
§options: Vec<(String, String)>
§

CreateMaterializedView

Fields

§name: String
§column_names: Vec<String>
§if_not_exists: bool
§with_no_data: bool
§options: Vec<(String, String)>
§

RefreshMaterializedView

Fields

§name: String
§concurrently: bool
§with_no_data: bool
§

CreateSchema

Fields

§if_not_exists: bool
§

AlterSchemaOwner

Fields

§name: String
§new_owner: String
§

Notify

Fields

§channel: String
§payload: String
§

Listen

Fields

§channel: String
§

Unlisten

Fields

§channel: Option<String>
§

SetVariable

Fields

§name: String
§value: String
§local: bool
§is_default: bool
§

ResetVariable

Fields

§name: String
§

ResetAllVariables

§

SetConstraints

Fields

§constraints: Vec<SetConstraintName>
§deferred: bool
§

ShowVariable

Fields

§name: String
§

Discard

Fields

§

Load

Fields

§library: String
§

Explain

Fields

§analyze: bool
§verbose: bool
§format: Option<String>
§

Analyze

Fields

§

Vacuum(VacuumStmt)

§

Truncate

Fields

§cascade: bool
§restart_identity: bool
§

Transaction(TransactionStmt)

§

DeclareCursor

Fields

§name: String
§binary: bool
§scroll: Option<bool>
§hold: bool
§

FetchCursor(FetchCursorStmt)

§

CloseCursor

Fields

§

CreateSequence(CreateSequence)

§

CreateDomain(CreateDomain)

§

AlterSequence(AlterSequence)

§

CreateTableAs

Fields

§name: String
§if_not_exists: bool
§column_names: Vec<String>
§with_no_data: bool
§on_commit: OnCommitAction
§

Prepare

Fields

§name: String
§parameter_types: Vec<ColumnType>
§

Execute

Fields

§name: String
§

Deallocate

Fields

§

CreateForeignServer(CreateForeignServer)

§

CreateForeignTable(CreateForeignTable)

§

CreateForeignTableIfNotExists(DeferredCreateForeignTable)

§

AlterForeignTable(AlterForeignTableStmt)

§

Merge(Box<MergePlan>)

§

CreateFunction(Box<CreateFunction>)

§

DropFunction(DropFunctionStmt)

§

AlterRoutine(AlterRoutineStmt)

§

AlterRoutineOwner(AlterRoutineOwnerStmt)

§

RenameRoutine(RenameRoutineStmt)

§

GrantRoutine(GrantRoutineStmt)

§

GrantTable(GrantTableStmt)

§

GrantSequence(GrantSequenceStmt)

§

GrantDatabase(GrantDatabaseStmt)

§

GrantSchema(GrantSchemaStmt)

§

GrantRole(GrantRoleStmt)

§

CreateRole(CreateRoleStmt)

§

AlterRole(AlterRoleStmt)

§

DropRole(DropRoleStmt)

§

CreateTrigger(CreateTrigger)

§

DropTrigger(DropTrigger)

§

CreateRule(CreateRule)

§

DropRule(DropRule)

§

DoBlock

Fields

§language: String
§body: String
§

Call

Fields

§name: String

Implementations§

Source§

impl CommandPlan

Source

pub fn ctes(&self) -> &[CtePlan]

WITH definitions owned by this command, in declaration order.

Source

pub fn ctes_mut(&mut self) -> Option<&mut Vec<CtePlan>>

Source

pub fn query_inputs(&self) -> Vec<&QueryPlan>

Query children evaluated in the command’s WITH scope, including every scalar_subqueries entry. Source-plan subqueries are owned by source_input; visitors should not traverse scalar_subqueries separately.

Source

pub fn query_inputs_mut(&mut self) -> Vec<&mut QueryPlan>

Source

pub fn source_input(&self) -> Option<&SourcePlan>

Source

pub fn source_input_mut(&mut self) -> Option<&mut SourcePlan>

Source

pub fn mutation_target(&self) -> Option<&str>

Source

pub fn mutation_target_mut(&mut self) -> Option<&mut String>

Source

pub fn returning(&self) -> Option<&[ProjectionPlan]>

Source§

impl CommandPlan

Source

pub fn expressions(&self) -> Vec<&ScalarExpr>

Scalar expressions owned by the command, excluding its relational children.

Source

pub fn expressions_mut(&mut self) -> Vec<&mut ScalarExpr>

Scalar expressions owned by the command, excluding its relational children.

Source

pub fn scalar_subqueries(&self) -> &[QueryPlan]

Source

pub fn target_qualifier(&self) -> Option<&str>

Source

pub fn returning_aliases(&self) -> Option<&ReturningAliases>

Source§

impl CommandPlan

Source

pub fn name(&self) -> &'static str

Trait Implementations§

Source§

impl Clone for CommandPlan

Source§

fn clone(&self) -> CommandPlan

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 Debug for CommandPlan

Source§

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

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

impl<'de> Deserialize<'de> for CommandPlan

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 Serialize for CommandPlan

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

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> ErasedDestructor for T
where T: 'static,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.