Batch API

Context manager for Cloud Spanner batched writes.



Accumulate mutations for transmission during commit().


Begin with block.

_exit_(exc_type, exc_val, exc_tb)

End with block.

commit(return_commit_stats=False, request_options=None)

Commit mutations to the database.

  • Parameters

    • return_commit_stats (bool) – If true, the response will return commit stats which can be accessed though commit_stats.

    • request_options ( – (Optional) Common options for this request. If a dict is provided, it must be of the same form as the protobuf message RequestOptions.

  • Return type


  • Returns

    timestamp of the committed changes.

commit_stats( = Non )

Timestamp at which the batch was successfully committed.