pub struct Returning;
Expand description
Shorthand for constructing ReturningClause
Implementations
sourceimpl Returning
impl Returning
sourcepub fn all(&self) -> ReturningClause
pub fn all(&self) -> ReturningClause
Constructs a new ReturningClause::All
.
Examples
use sea_query::{tests_cfg::*, *};
let query = Query::delete()
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).eq(1))
.returning(Query::returning().all())
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING *"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING *"#
);
sourcepub fn column<C>(&self, col: C) -> ReturningClause where
C: IntoColumnRef,
pub fn column<C>(&self, col: C) -> ReturningClause where
C: IntoColumnRef,
Constructs a new ReturningClause::Columns
.
Examples
use sea_query::{tests_cfg::*, *};
let query = Query::delete()
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).eq(1))
.returning(Query::returning().column(Glyph::Id))
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id""#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id""#
);
sourcepub fn columns<T, I>(self, cols: I) -> ReturningClause where
T: IntoColumnRef,
I: IntoIterator<Item = T>,
pub fn columns<T, I>(self, cols: I) -> ReturningClause where
T: IntoColumnRef,
I: IntoIterator<Item = T>,
Constructs a new ReturningClause::Columns
.
Examples
use sea_query::{tests_cfg::*, *};
let query = Query::delete()
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).eq(1))
.returning(Query::returning().columns([Glyph::Id, Glyph::Image]))
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id", "image""#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id", "image""#
);
sourcepub fn expr<T>(&self, expr: T) -> ReturningClause where
T: Into<SimpleExpr>,
pub fn expr<T>(&self, expr: T) -> ReturningClause where
T: Into<SimpleExpr>,
Constructs a new ReturningClause::Exprs
.
Examples
use sea_query::{tests_cfg::*, *};
let query = Query::delete()
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).eq(1))
.returning(Query::returning().expr(Expr::col(Glyph::Id)))
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id""#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id""#
);
sourcepub fn exprs<T, I>(self, exprs: I) -> ReturningClause where
T: Into<SimpleExpr>,
I: IntoIterator<Item = T>,
pub fn exprs<T, I>(self, exprs: I) -> ReturningClause where
T: Into<SimpleExpr>,
I: IntoIterator<Item = T>,
Constructs a new ReturningClause::Exprs
.
Examples
use sea_query::{tests_cfg::*, *};
let query = Query::delete()
.from_table(Glyph::Table)
.and_where(Expr::col(Glyph::Id).eq(1))
.returning(Query::returning().exprs([Expr::col(Glyph::Id), Expr::col(Glyph::Image)]))
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id", "image""#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"DELETE FROM "glyph" WHERE "id" = 1 RETURNING "id", "image""#
);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Returning
impl Send for Returning
impl Sync for Returning
impl Unpin for Returning
impl UnwindSafe for Returning
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more