Skip to main content

Bound

Enum Bound 

Source
pub enum Bound {
Show 16 variants Query(Plan), CreateTable(CreateTable), CreateView(CreateView), DropTable(DropTable), Schema(SchemaChange), Sequence(SequenceChange), Type(TypeChange), Alter(Alter), Index(IndexChange), Insert(Insert), Setting(Setting), Checkpoint(Option<String>), Attach(Attach), Detach { name: String, if_exists: bool, }, Transaction(Transaction), Explain { plan: Plan, analyze: bool, statistics: bool, codegen: bool, },
}
Expand description

One statement, bound.

Not #[non_exhaustive]. A new variant here is a new kind of statement, and the compiler pointing at every place that has to decide what to do with it is the whole value of the enum.

Variants§

§

Query(Plan)

A query, which is the only one of these that produces rows.

§

CreateTable(CreateTable)

CREATE TABLE.

§

CreateView(CreateView)

CREATE VIEW.

§

DropTable(DropTable)

DROP TABLE or DROP VIEW.

§

Schema(SchemaChange)

CREATE SCHEMA or DROP SCHEMA.

§

Sequence(SequenceChange)

CREATE SEQUENCE or DROP SEQUENCE.

§

Type(TypeChange)

CREATE TYPE or DROP TYPE.

§

Alter(Alter)

ALTER TABLE or ALTER VIEW.

§

Index(IndexChange)

CREATE INDEX or DROP INDEX.

§

Insert(Insert)

INSERT INTO.

§

Setting(Setting)

SET name = value, or RESET name, which is the same thing with no value.

§

Checkpoint(Option<String>)

Flushes a persistent database snapshot, of the named database when one is named.

§

Attach(Attach)

ATTACH.

§

Detach

DETACH, with the name and whether IF EXISTS was written.

Fields

§name: String
§if_exists: bool
§

Transaction(Transaction)

BEGIN, COMMIT or ROLLBACK, which have nothing to bind and are carried as written.

§

Explain

EXPLAIN over a query, holding the plan of the query rather than the query.

The same Plan a Bound::Query would have carried, bound the same way and by the same code. What makes it an explain is that the layer above optimizes it and prints it instead of running it, which is the point: a plan that was built differently because somebody asked to see it is not the plan that runs.

With analyze set the layer above runs it as well and prints what happened on it. Still the same plan, for the same reason.

With statistics set it prints what the planner knew as well, which is the use and the class behind every number in the plan. That one changes nothing about the plan or the run either.

With codegen set the layer above hands the plan to the compiled engine and prints what it generated instead.

Fields

§plan: Plan
§analyze: bool
§statistics: bool
§codegen: bool

Trait Implementations§

Source§

impl Debug for Bound

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Bound

§

impl !UnwindSafe for Bound

§

impl Freeze for Bound

§

impl Send for Bound

§

impl Sync for Bound

§

impl Unpin for Bound

§

impl UnsafeUnpin for Bound

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> 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, 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.