Skip to main content

IntoStatement

Trait IntoStatement 

Source
pub trait IntoStatement {
    type Returning;

    // Required method
    fn into_statement(self) -> Statement<Self::Returning>;
}
Expand description

Convert a value into a Statement.

This trait bridges query builders to Statement<T>. The associated Returning type encodes what the statement produces when executed:

BuilderReturning
[Query<M>]List<M>
[Delete<M>]()
[Association<M>]List<M>
Create builders (generated)M
Tuples of builders(R1, R2, …)
Vec<Q> / [Q; N]List<Q::Returning>

Tuples, Vec, and arrays batch multiple statements into a single round-trip. Each sub-statement runs independently; the combined result is a tuple or list of individual results.

Required Associated Types§

Source

type Returning

The type this statement produces when executed.

Required Methods§

Source

fn into_statement(self) -> Statement<Self::Returning>

Consume self and produce the Statement.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8> IntoStatement for (Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8)

Source§

impl<Q1, Q2, Q3, Q4, Q5, Q6, Q7> IntoStatement for (Q1, Q2, Q3, Q4, Q5, Q6, Q7)

Source§

impl<Q1, Q2, Q3, Q4, Q5, Q6> IntoStatement for (Q1, Q2, Q3, Q4, Q5, Q6)

Source§

impl<Q1, Q2, Q3, Q4, Q5> IntoStatement for (Q1, Q2, Q3, Q4, Q5)

Source§

impl<Q1, Q2, Q3, Q4> IntoStatement for (Q1, Q2, Q3, Q4)

Source§

impl<Q1, Q2, Q3> IntoStatement for (Q1, Q2, Q3)

Source§

impl<Q1, Q2> IntoStatement for (Q1, Q2)

Source§

impl<Q, const N: usize> IntoStatement for [Q; N]
where Q: IntoStatement,

Dynamic batch via [Q; N]: fixed-size array of typed queries, returns List<Q::Output>.

Source§

impl<Q> IntoStatement for Vec<Q>
where Q: IntoStatement,

Dynamic batch via Vec<Q>: all queries have the same type, returns List<Q::Output>.

Implementors§