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.



6801
6802
6803
# File 'lib/google/apis/spanner_v1/classes.rb', line 6801

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)


6777
6778
6779
# File 'lib/google/apis/spanner_v1/classes.rb', line 6777

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)


6783
6784
6785
# File 'lib/google/apis/spanner_v1/classes.rb', line 6783

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



6788
6789
6790
# File 'lib/google/apis/spanner_v1/classes.rb', line 6788

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



6793
6794
6795
# File 'lib/google/apis/spanner_v1/classes.rb', line 6793

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



6799
6800
6801
# File 'lib/google/apis/spanner_v1/classes.rb', line 6799

def read_write
  @read_write
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6806
6807
6808
6809
6810
6811
6812
# File 'lib/google/apis/spanner_v1/classes.rb', line 6806

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