pub struct Batch { /* private fields */ }Expand description
A bounded synchronous batch; preparation is internal to Database::commit.
Implementations§
Source§impl Batch
impl Batch
Sourcepub fn at(time: Timestamp) -> Self
pub fn at(time: Timestamp) -> Self
Begin a batch with one host-captured operation time for all managed fields. The database reads no clock; this value remains fixed for the whole batch.
Sourcepub fn insert<E: Entity>(&mut self, row: &E) -> Result<(), Error>
pub fn insert<E: Entity>(&mut self, row: &E) -> Result<(), Error>
Insert a typed record. Primary-key/uniqueness admission happens at commit.
§Errors
Refuses managed-field entities (use insert_input), encoding or batch capacity.
Sourcepub fn insert_input<I: InsertInput>(
&mut self,
input: I,
) -> Result<I::Entity, Error>
pub fn insert_input<I: InsertInput>( &mut self, input: I, ) -> Result<I::Entity, Error>
Resolve a typed insert input, append it to this batch and return its full row.
This is preparation, not a commit; the returned row is not yet persistent.
Explicit None remains absence, while omitted fields select their declared
literal default or optional absence. No defaults run during replacement.
§Errors
Refuses missing required values, field/row bounds or batch capacity. A refused input appends no mutation to the batch.
Sourcepub fn replace<E: Entity>(&mut self, row: &E) -> Result<(), Error>
pub fn replace<E: Entity>(&mut self, row: &E) -> Result<(), Error>
Replace an existing typed record, retaining its primary key. Managed fields must echo the current stored values; commit sets update time only on a real change. Read the row after commit to obtain that assigned time.
§Errors
Refuses missing operation time, encoding or batch capacity before mutation.