diesel/query_builder/returning/
returning_query_source.rs1use crate::query_source::joins::ToInnerJoin;
9use crate::query_source::{AppearsInFromClause, Once};
10use core::marker::PhantomData;
11
12#[derive(#[automatically_derived]
impl ::core::fmt::Debug for InsertStmtWithoutOnConflictDoUpdate {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
"InsertStmtWithoutOnConflictDoUpdate")
}
}Debug, #[automatically_derived]
impl ::core::marker::Copy for InsertStmtWithoutOnConflictDoUpdate { }Copy, #[automatically_derived]
impl ::core::clone::Clone for InsertStmtWithoutOnConflictDoUpdate {
#[inline]
fn clone(&self) -> InsertStmtWithoutOnConflictDoUpdate { *self }
}Clone)]
14pub struct InsertStmtWithoutOnConflictDoUpdate;
15
16#[derive(#[automatically_derived]
impl ::core::fmt::Debug for UpdateStmt {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "UpdateStmt")
}
}Debug, #[automatically_derived]
impl ::core::marker::Copy for UpdateStmt { }Copy, #[automatically_derived]
impl ::core::clone::Clone for UpdateStmt {
#[inline]
fn clone(&self) -> UpdateStmt { *self }
}Clone)]
18pub struct UpdateStmt;
19
20#[derive(#[automatically_derived]
impl ::core::fmt::Debug for DeleteStmt {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "DeleteStmt")
}
}Debug, #[automatically_derived]
impl ::core::marker::Copy for DeleteStmt { }Copy, #[automatically_derived]
impl ::core::clone::Clone for DeleteStmt {
#[inline]
fn clone(&self) -> DeleteStmt { *self }
}Clone)]
22pub struct DeleteStmt;
23
24#[derive(#[automatically_derived]
impl ::core::fmt::Debug for InsertStmtWithOnConflictDoUpdate {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
"InsertStmtWithOnConflictDoUpdate")
}
}Debug, #[automatically_derived]
impl ::core::marker::Copy for InsertStmtWithOnConflictDoUpdate { }Copy, #[automatically_derived]
impl ::core::clone::Clone for InsertStmtWithOnConflictDoUpdate {
#[inline]
fn clone(&self) -> InsertStmtWithOnConflictDoUpdate { *self }
}Clone)]
26pub struct InsertStmtWithOnConflictDoUpdate;
27
28#[derive(#[automatically_derived]
impl<StmtKind: ::core::fmt::Debug, T: ::core::fmt::Debug> ::core::fmt::Debug
for ReturningQuerySource<StmtKind, T> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"ReturningQuerySource", &&self.0)
}
}Debug, #[automatically_derived]
impl<StmtKind: ::core::clone::Clone, T: ::core::clone::Clone>
::core::clone::Clone for ReturningQuerySource<StmtKind, T> {
#[inline]
fn clone(&self) -> ReturningQuerySource<StmtKind, T> {
ReturningQuerySource(::core::clone::Clone::clone(&self.0))
}
}Clone, #[automatically_derived]
impl<StmtKind: ::core::marker::Copy, T: ::core::marker::Copy>
::core::marker::Copy for ReturningQuerySource<StmtKind, T> {
}Copy)]
36pub struct ReturningQuerySource<StmtKind, T>(PhantomData<(StmtKind, T)>);
37
38impl<StmtKind, T> AppearsInFromClause<T> for ReturningQuerySource<StmtKind, T> {
39 type Count = Once;
40}
41
42impl<T> ToInnerJoin for ReturningQuerySource<UpdateStmt, T> {
45 type InnerJoin = Self;
46}
47
48impl<T> ToInnerJoin for ReturningQuerySource<DeleteStmt, T> {
49 type InnerJoin = Self;
50}
51
52impl<T> ToInnerJoin for ReturningQuerySource<InsertStmtWithoutOnConflictDoUpdate, T> {
53 type InnerJoin = Self;
54}
55
56impl<T> ToInnerJoin for ReturningQuerySource<InsertStmtWithOnConflictDoUpdate, T> {
67 type InnerJoin = ReturningQuerySource<UpdateStmt, T>;
68}
69
70pub trait InsertStmtKind {
85 type StmtKind;
90}
91
92impl<T, Tab> InsertStmtKind for crate::query_builder::ValuesClause<T, Tab> {
93 type StmtKind = InsertStmtWithoutOnConflictDoUpdate;
94}
95
96impl<V, Tab, QId, const STABLE_QUERY_ID: bool> InsertStmtKind
97 for crate::query_builder::BatchInsert<V, Tab, QId, STABLE_QUERY_ID>
98{
99 type StmtKind = InsertStmtWithoutOnConflictDoUpdate;
100}
101
102impl InsertStmtKind for crate::query_builder::insert_statement::DefaultValues {
103 type StmtKind = InsertStmtWithoutOnConflictDoUpdate;
104}
105
106impl<S, C> InsertStmtKind for crate::query_builder::insert_statement::InsertFromSelect<S, C> {
107 type StmtKind = InsertStmtWithoutOnConflictDoUpdate;
108}
109
110impl<V, Target, T, WhereClause> InsertStmtKind
111 for crate::query_builder::upsert::on_conflict_clause::OnConflictValues<
112 V,
113 Target,
114 crate::query_builder::upsert::on_conflict_actions::DoNothing<T>,
115 WhereClause,
116 >
117{
118 type StmtKind = InsertStmtWithoutOnConflictDoUpdate;
122}
123
124impl<V, Target, Changeset, Tab, WhereClause> InsertStmtKind
125 for crate::query_builder::upsert::on_conflict_clause::OnConflictValues<
126 V,
127 Target,
128 crate::query_builder::upsert::on_conflict_actions::DoUpdate<Changeset, Tab>,
129 WhereClause,
130 >
131{
132 type StmtKind = InsertStmtWithOnConflictDoUpdate;
133}