pub struct Rows<'inner, S> { /* private fields */ }
Expand description
Rows keeps track of all rows in the current query.
This is the base type for other query types like crate::args::Aggregate and crate::args::Query. It contains most query functionality like joining tables and doing sub-queries.
Rows mutability is only about which rows are included. Adding new columns does not require mutating Rows.
Implementations§
Source§impl<'inner, S> Rows<'inner, S>
impl<'inner, S> Rows<'inner, S>
Sourcepub fn join<T: Table<Schema = S>>(&mut self) -> Column<'inner, S, T>
pub fn join<T: Table<Schema = S>>(&mut self) -> Column<'inner, S, T>
Join a table, this is like a super simple Iterator::flat_map but for queries.
After this operation Rows has rows for the combinations of each original row with each row of the table. (Also called the “Carthesian product”)
For convenience there is also Table::join.
Sourcepub fn filter(&mut self, prop: impl IntoColumn<'inner, S, Typ = bool>)
pub fn filter(&mut self, prop: impl IntoColumn<'inner, S, Typ = bool>)
Filter rows based on a column.
Sourcepub fn filter_some<Typ>(
&mut self,
val: impl IntoColumn<'inner, S, Typ = Option<Typ>>,
) -> Column<'inner, S, Typ>
pub fn filter_some<Typ>( &mut self, val: impl IntoColumn<'inner, S, Typ = Option<Typ>>, ) -> Column<'inner, S, Typ>
Filter out rows where this column is None.
Returns a new column with the unwrapped type.
Auto Trait Implementations§
impl<'inner, S> !Freeze for Rows<'inner, S>
impl<'inner, S> !RefUnwindSafe for Rows<'inner, S>
impl<'inner, S> !Send for Rows<'inner, S>
impl<'inner, S> !Sync for Rows<'inner, S>
impl<'inner, S> Unpin for Rows<'inner, S>
impl<'inner, S> !UnwindSafe for Rows<'inner, S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more