Skip to main content

RowQuery

Trait RowQuery 

Source
pub trait RowQuery<Idx> {
    type Output: DecodeRow;
}
Expand description

What a row-producing query renders to, and what its rows decode to: a SELECT, a RETURNING clause, an erased DynSelect, a UNION chain. LoadExt is the pair of methods over it, and the split is load-bearing — with the validity bound on the impl instead, an invalid selection makes .load(..) not exist, and the scope error the builder wanted to report is replaced by a method-resolution failure that never mentions the table.

Idx is threaded through the trait’s parameter list for the reason scope::Superset explains. Callers never see it; it’s inferred.

Required Associated Types§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<Output: DecodeRow> RowQuery<()> for DynSelect<Postgres, Output>

An erased query and a set-op chain were both rendered before their selection type was gone, leaving nothing for Idx to index — hence RowQuery<()>, the same trait with an empty proof.

Source§

type Output = Output

Source§

impl<Output: DecodeRow> RowQuery<()> for SetOp<Postgres, Output>

Source§

type Output = Output

Source§

impl<S: Statement<Dialect = Postgres>, Sel, Idx> RowQuery<Idx> for Returning<S, Sel>
where Sel: Selection<WrittenTable<S::Table>, Idx>, Sel::Output: DecodeRow,

One impl for every RETURNING: what a statement returns is decided by its selection, not by which statement it was.

Source§

impl<Scope, Sel, Idx> RowQuery<Idx> for Select<Postgres, Scope, Sel>
where Sel: Selection<Scope, Idx>, Sel::Output: DecodeRow,

Source§

type Output = <Sel as Selection<Scope, Idx>>::Output

Implementors§