Cloud Spanner V1 Client - Class BatchWriteRequest (1.76.0)

Reference documentation and code samples for the Cloud Spanner V1 Client class BatchWriteRequest.

The request for BatchWrite.

Generated from protobuf message google.spanner.v1.BatchWriteRequest

Namespace

Google \ Cloud \ Spanner \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ session string

Required. The session in which the batch request is to be run.

↳ request_options Google\Cloud\Spanner\V1\RequestOptions

Common options for this request.

↳ mutation_groups array<Google\Cloud\Spanner\V1\BatchWriteRequest\MutationGroup>

Required. The groups of mutations to be applied.

↳ exclude_txn_from_change_streams bool

Optional. When exclude_txn_from_change_streams is set to true: * Mutations from all transactions in this batch write operation will not be recorded in change streams with DDL option allow_txn_exclusion=true that are tracking columns modified by these transactions. * Mutations from all transactions in this batch write operation will be recorded in change streams with DDL option allow_txn_exclusion=false or not set that are tracking columns modified by these transactions. When exclude_txn_from_change_streams is set to false or not set, mutations from all transactions in this batch write operation will be recorded in all change streams that are tracking columns modified by these transactions.

getSession

Required. The session in which the batch request is to be run.

Returns
TypeDescription
string

setSession

Required. The session in which the batch request is to be run.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRequestOptions

Common options for this request.

Returns
TypeDescription
Google\Cloud\Spanner\V1\RequestOptions|null

hasRequestOptions

clearRequestOptions

setRequestOptions

Common options for this request.

Parameter
NameDescription
var Google\Cloud\Spanner\V1\RequestOptions
Returns
TypeDescription
$this

getMutationGroups

Required. The groups of mutations to be applied.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setMutationGroups

Required. The groups of mutations to be applied.

Parameter
NameDescription
var array<Google\Cloud\Spanner\V1\BatchWriteRequest\MutationGroup>
Returns
TypeDescription
$this

getExcludeTxnFromChangeStreams

Optional. When exclude_txn_from_change_streams is set to true:

  • Mutations from all transactions in this batch write operation will not be recorded in change streams with DDL option allow_txn_exclusion=true that are tracking columns modified by these transactions.
  • Mutations from all transactions in this batch write operation will be recorded in change streams with DDL option allow_txn_exclusion=false or not set that are tracking columns modified by these transactions. When exclude_txn_from_change_streams is set to false or not set, mutations from all transactions in this batch write operation will be recorded in all change streams that are tracking columns modified by these transactions.
Returns
TypeDescription
bool

setExcludeTxnFromChangeStreams

Optional. When exclude_txn_from_change_streams is set to true:

  • Mutations from all transactions in this batch write operation will not be recorded in change streams with DDL option allow_txn_exclusion=true that are tracking columns modified by these transactions.
  • Mutations from all transactions in this batch write operation will be recorded in change streams with DDL option allow_txn_exclusion=false or not set that are tracking columns modified by these transactions. When exclude_txn_from_change_streams is set to false or not set, mutations from all transactions in this batch write operation will be recorded in all change streams that are tracking columns modified by these transactions.
Parameter
NameDescription
var bool
Returns
TypeDescription
$this

static::build

Parameters
NameDescription
session string

Required. The session in which the batch request is to be run. Please see Google\Cloud\Spanner\V1\SpannerClient::sessionName() for help formatting this field.

mutationGroups array<Google\Cloud\Spanner\V1\BatchWriteRequest\MutationGroup>

Required. The groups of mutations to be applied.

Returns
TypeDescription
Google\Cloud\Spanner\V1\BatchWriteRequest