Batch API#

Context manager for Cloud Spanner batched writes.

class google.cloud.spanner.batch.Batch(session)[source]#

Bases: google.cloud.spanner.batch._BatchBase

Accumulate mutations for transmission during commit().

commit()[source]#

Commit mutations to the database.

Return type:datetime
Returns:timestamp of the committed changes.
committed = None#

Timestamp at which the batch was successfully committed.