Skip to main content

ExplainStatement

Struct ExplainStatement 

Source
pub struct ExplainStatement { /* private fields */ }

Implementations§

Source§

impl ExplainStatement

Source

pub fn new() -> Self

Source

pub fn statement(self, statement: impl Into<ExplainableStatement>) -> Self

Set the statement to be explained.

Source§

impl ExplainStatement

Source

pub fn analyze(self) -> Self

Available on crate features backend-mysql or backend-postgres only.

Set ANALYZE to true.

Source

pub fn format(self, format: ExplainFormat) -> Self

Available on crate features backend-mysql or backend-postgres only.

Set the output format.

Source§

impl ExplainStatement

Source

pub fn verbose(self, verbose: bool) -> Self

Available on crate feature backend-postgres only.

Set VERBOSE.

Source

pub fn costs(self, costs: bool) -> Self

Available on crate feature backend-postgres only.

Set COSTS.

Source

pub fn settings(self, settings: bool) -> Self

Available on crate feature backend-postgres only.

Set SETTINGS.

Source

pub fn generic_plan(self, generic_plan: bool) -> Self

Available on crate feature backend-postgres only.

Set GENERIC_PLAN.

Source

pub fn buffers(self, buffers: bool) -> Self

Available on crate feature backend-postgres only.

Set BUFFERS.

Source

pub fn serialize_text(self) -> Self

Available on crate feature backend-postgres only.

Set SERIALIZE TEXT.

Source

pub fn serialize_binary(self) -> Self

Available on crate feature backend-postgres only.

Set SERIALIZE BINARY.

Source

pub fn serialize_none(self) -> Self

Available on crate feature backend-postgres only.

Set SERIALIZE NONE.

Source

pub fn wal(self, wal: bool) -> Self

Available on crate feature backend-postgres only.

Set WAL.

Source

pub fn timing(self, timing: bool) -> Self

Available on crate feature backend-postgres only.

Set TIMING.

Source

pub fn summary(self, summary: bool) -> Self

Available on crate feature backend-postgres only.

Set SUMMARY.

Source

pub fn memory(self, memory: bool) -> Self

Available on crate feature backend-postgres only.

Set MEMORY.

Source§

impl ExplainStatement

Source

pub fn table(table: impl IntoTableRef) -> Self

Available on crate feature backend-mysql only.

Create a MySQL EXPLAIN for tbl_name [col_name | wild].

§Examples
use sea_query::{ExplainStatement, MysqlQueryBuilder};

assert_eq!(
    ExplainStatement::table("glyph").to_string(MysqlQueryBuilder),
    "EXPLAIN `glyph`"
);
assert_eq!(
    ExplainStatement::table_with_column("glyph", "size").to_string(MysqlQueryBuilder),
    "EXPLAIN `glyph` `size`"
);
assert_eq!(
    ExplainStatement::table_with_wildcard("glyph", "size_%").to_string(MysqlQueryBuilder),
    "EXPLAIN `glyph` 'size_%'"
);
Source

pub fn table_with_column( table: impl IntoTableRef, column: impl IntoIden, ) -> Self

Available on crate feature backend-mysql only.
Source

pub fn table_with_wildcard( table: impl IntoTableRef, wildcard: &'static str, ) -> Self

Available on crate feature backend-mysql only.
Source

pub fn into_variable(self, variable: impl Into<String>) -> Self

Available on crate feature backend-mysql only.

Store the EXPLAIN output into a MySQL user variable.

Source

pub fn column(self, column: impl IntoIden) -> Self

Available on crate feature backend-mysql only.

Set the column name for EXPLAIN tbl_name col_name.

Source

pub fn for_connection(self, id: u64) -> Self

Available on crate feature backend-mysql only.

Explain a statement for a specific connection id.

Source

pub fn for_schema(self, schema: impl IntoIden) -> Self

Available on crate feature backend-mysql only.

Explain a statement for a specific schema.

Source

pub fn for_database(self, database: impl IntoIden) -> Self

Available on crate feature backend-mysql only.

Explain a statement for a specific database.

Source§

impl ExplainStatement

Source

pub fn query_plan(self) -> Self

Available on crate feature backend-sqlite only.

Use EXPLAIN QUERY PLAN.

Source§

impl ExplainStatement

Source

pub fn build_collect_into( &self, query_builder: impl QueryBuilder, sql: &mut impl SqlWriter, )

Build SQL into the provided writer.

Source

pub fn build_collect( &self, query_builder: impl QueryBuilder, sql: &mut impl SqlWriter, ) -> String

Build SQL into the provided writer and return the resulting string.

Source

pub fn build(&self, query_builder: impl QueryBuilder) -> (String, Values)

Build SQL and collect values.

Source

pub fn to_string(&self, query_builder: impl QueryBuilder) -> String

Build the SQL string.

Trait Implementations§

Source§

impl Clone for ExplainStatement

Source§

fn clone(&self) -> ExplainStatement

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 ExplainStatement

Source§

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

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

impl Default for ExplainStatement

Source§

fn default() -> ExplainStatement

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ExplainStatement

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ExplainStatement

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