pub struct TypedTableMutator<'tx, R> { /* private fields */ }Expand description
The typed CRUD operations of a table in a mutator (tx.mutate.<table>
in JS), which the generated mutate module returns:
ⓘ
mutate::issue(tx).insert(&issue)?;
mutate::issue(tx).update(&IssueUpdate { closed: Some(true), ..IssueUpdate::new(id) })?;Implementations§
Source§impl<'tx, R: ZeroRow> TypedTableMutator<'tx, R>
impl<'tx, R: ZeroRow> TypedTableMutator<'tx, R>
Sourcepub fn new(tx: &'tx Transaction) -> Self
pub fn new(tx: &'tx Transaction) -> Self
For generated code.
Sourcepub fn insert(&self, row: &R) -> Result<(), Error>
pub fn insert(&self, row: &R) -> Result<(), Error>
Inserts a row unless one with its primary key exists.
Sourcepub fn upsert(&self, row: &R) -> Result<(), Error>
pub fn upsert(&self, row: &R) -> Result<(), Error>
Inserts a row, or replaces the columns of the existing one. Every
column is written, so an optional one that is None sets null; JS
keeps a column the value leaves out. Use update to set only some
columns.
Auto Trait Implementations§
impl<'tx, R> !RefUnwindSafe for TypedTableMutator<'tx, R>
impl<'tx, R> !Send for TypedTableMutator<'tx, R>
impl<'tx, R> !Sync for TypedTableMutator<'tx, R>
impl<'tx, R> !UnwindSafe for TypedTableMutator<'tx, R>
impl<'tx, R> Forget for TypedTableMutator<'tx, R>
impl<'tx, R> Freeze for TypedTableMutator<'tx, R>
impl<'tx, R> Move for TypedTableMutator<'tx, R>
impl<'tx, R> Unpin for TypedTableMutator<'tx, R>
impl<'tx, R> UnsafeUnpin for TypedTableMutator<'tx, R>
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