Class: Google::Apis::SpannerV1::TransactionOptions

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/spanner_v1/classes.rb,
lib/google/apis/spanner_v1/representations.rb,
lib/google/apis/spanner_v1/representations.rb

Overview

Options to use for transactions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TransactionOptions

Returns a new instance of TransactionOptions.



6929
6930
6931
# File 'lib/google/apis/spanner_v1/classes.rb', line 6929

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#exclude_txn_from_change_streamsBoolean Also known as: exclude_txn_from_change_streams?

When exclude_txn_from_change_streams is set to true, it prevents read or write transactions from being tracked in change streams. * If the DDL option allow_txn_exclusion is set to true, then the updates made within this transaction aren't recorded in the change stream. * If you don't set the DDL option allow_txn_exclusion or if it's set to false, then the updates made within this transaction are recorded in the change stream. When exclude_txn_from_change_streams is set to false or not set, modifications from this transaction are recorded in all change streams that are tracking columns modified by these transactions. The exclude_txn_from_change_streams option can only be specified for read-write or partitioned DML transactions, otherwise the API returns an INVALID_ARGUMENT error. Corresponds to the JSON property excludeTxnFromChangeStreams

Returns:

  • (Boolean)


6905
6906
6907
# File 'lib/google/apis/spanner_v1/classes.rb', line 6905

def exclude_txn_from_change_streams
  @exclude_txn_from_change_streams
end

#isolation_levelString

Isolation level for the transaction. Corresponds to the JSON property isolationLevel

Returns:

  • (String)


6911
6912
6913
# File 'lib/google/apis/spanner_v1/classes.rb', line 6911

def isolation_level
  @isolation_level
end

#partitioned_dmlGoogle::Apis::SpannerV1::PartitionedDml

Message type to initiate a Partitioned DML transaction. Corresponds to the JSON property partitionedDml



6916
6917
6918
# File 'lib/google/apis/spanner_v1/classes.rb', line 6916

def partitioned_dml
  @partitioned_dml
end

#read_onlyGoogle::Apis::SpannerV1::ReadOnly

Message type to initiate a read-only transaction. Corresponds to the JSON property readOnly



6921
6922
6923
# File 'lib/google/apis/spanner_v1/classes.rb', line 6921

def read_only
  @read_only
end

#read_writeGoogle::Apis::SpannerV1::ReadWrite

Message type to initiate a read-write transaction. Currently this transaction type has no options. Corresponds to the JSON property readWrite



6927
6928
6929
# File 'lib/google/apis/spanner_v1/classes.rb', line 6927

def read_write
  @read_write
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6934
6935
6936
6937
6938
6939
6940
# File 'lib/google/apis/spanner_v1/classes.rb', line 6934

def update!(**args)
  @exclude_txn_from_change_streams = args[:exclude_txn_from_change_streams] if args.key?(:exclude_txn_from_change_streams)
  @isolation_level = args[:isolation_level] if args.key?(:isolation_level)
  @partitioned_dml = args[:partitioned_dml] if args.key?(:partitioned_dml)
  @read_only = args[:read_only] if args.key?(:read_only)
  @read_write = args[:read_write] if args.key?(:read_write)
end