pub struct NestedWriteBuilder { /* private fields */ }Expand description
Builder for nested write SQL operations.
The SQL emitters here currently bake in crate::dialect::Postgres —
nested writes are not yet wired into a live client, and the placeholder
syntax ($N) is Postgres-shaped. When this builder lands on the live
client path the dialect should thread through from the engine.
Implementations§
Source§impl NestedWriteBuilder
impl NestedWriteBuilder
Sourcepub fn one_to_many(
parent_table: impl Into<String>,
parent_pk: Vec<String>,
related_table: impl Into<String>,
foreign_key: impl Into<String>,
) -> Self
pub fn one_to_many( parent_table: impl Into<String>, parent_pk: Vec<String>, related_table: impl Into<String>, foreign_key: impl Into<String>, ) -> Self
Create a builder for a one-to-many relation.
Sourcepub fn many_to_many(
parent_table: impl Into<String>,
parent_pk: Vec<String>,
related_table: impl Into<String>,
join_table: JoinTableInfo,
) -> Self
pub fn many_to_many( parent_table: impl Into<String>, parent_pk: Vec<String>, related_table: impl Into<String>, join_table: JoinTableInfo, ) -> Self
Create a builder for a many-to-many relation.
Sourcepub fn build_connect_sql<T: Model>(
&self,
parent_id: &FilterValue,
filters: &[Filter],
) -> Vec<(String, Vec<FilterValue>)>
pub fn build_connect_sql<T: Model>( &self, parent_id: &FilterValue, filters: &[Filter], ) -> Vec<(String, Vec<FilterValue>)>
Build SQL for connecting records.
Sourcepub fn build_disconnect_sql(
&self,
parent_id: &FilterValue,
filters: &[Filter],
) -> Vec<(String, Vec<FilterValue>)>
pub fn build_disconnect_sql( &self, parent_id: &FilterValue, filters: &[Filter], ) -> Vec<(String, Vec<FilterValue>)>
Build SQL for disconnecting records.
Sourcepub fn build_set_sql<T: Model>(
&self,
parent_id: &FilterValue,
filters: &[Filter],
) -> Vec<(String, Vec<FilterValue>)>
pub fn build_set_sql<T: Model>( &self, parent_id: &FilterValue, filters: &[Filter], ) -> Vec<(String, Vec<FilterValue>)>
Build SQL for setting the relation (disconnect all, then connect specified).
Sourcepub fn build_create_sql<T: Model>(
&self,
parent_id: &FilterValue,
creates: &[NestedCreateData<T>],
) -> Vec<(String, Vec<FilterValue>)>
pub fn build_create_sql<T: Model>( &self, parent_id: &FilterValue, creates: &[NestedCreateData<T>], ) -> Vec<(String, Vec<FilterValue>)>
Build SQL for creating nested records.
Sourcepub fn build_delete_sql(
&self,
parent_id: &FilterValue,
filters: &[Filter],
) -> Vec<(String, Vec<FilterValue>)>
pub fn build_delete_sql( &self, parent_id: &FilterValue, filters: &[Filter], ) -> Vec<(String, Vec<FilterValue>)>
Build SQL for deleting nested records.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NestedWriteBuilder
impl RefUnwindSafe for NestedWriteBuilder
impl Send for NestedWriteBuilder
impl Sync for NestedWriteBuilder
impl Unpin for NestedWriteBuilder
impl UnsafeUnpin for NestedWriteBuilder
impl UnwindSafe for NestedWriteBuilder
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