pub struct InsertSelect<D, T> { /* private fields */ }Expand description
INSERT INTO t (..) SELECT ..: rows a query produces rather than rows
a caller holds. From InsertSeed::select.
The header is the target’s own writable columns, so the two sides line
up by the target’s order rather than by whatever order its
CREATE TABLE happened to use. The body is a render::Fragment,
rendered before the statement knows how many parameters precede it, for
the reason a CTE body is one.
Known limitation: no ON CONFLICT on this shape, and no column
subset. The query fills every column the target lets one write.
Trait Implementations§
Source§impl<D: Dialect, T: Table> Statement for InsertSelect<D, T>
impl<D: Dialect, T: Table> Statement for InsertSelect<D, T>
type Dialect = D
type Table = T
Source§fn to_sql(&self, _dialect: Self::Dialect) -> (String, Vec<Value>)
fn to_sql(&self, _dialect: Self::Dialect) -> (String, Vec<Value>)
The dialect is an argument for the reason
Select::to_sql’s is.Source§fn returning<Sel, Idx>(self, sel: Sel) -> Returning<Self, Sel>where
Self: Sized,
Self::Dialect: SupportsReturning,
Sel: Selection<WrittenTable<Self::Table>, Idx>,
fn returning<Sel, Idx>(self, sel: Sel) -> Returning<Self, Sel>where
Self: Sized,
Self::Dialect: SupportsReturning,
Sel: Selection<WrittenTable<Self::Table>, Idx>,
RETURNING, on whichever of the three this is. The clause is the
same clause. A distinct type rather than Self with a flag set: the
execution layer needs Sel’s concrete type to know what to decode a
returned row into, and an optional field would erase it. Read moreAuto Trait Implementations§
impl<D, T> Freeze for InsertSelect<D, T>
impl<D, T> RefUnwindSafe for InsertSelect<D, T>
impl<D, T> Send for InsertSelect<D, T>
impl<D, T> Sync for InsertSelect<D, T>
impl<D, T> Unpin for InsertSelect<D, T>
impl<D, T> UnsafeUnpin for InsertSelect<D, T>
impl<D, T> UnwindSafe for InsertSelect<D, T>
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