Class: Google::Apis::SpannerV1::Transaction

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

Overview

A transaction.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Transaction

Returns a new instance of Transaction



255
256
257
# File 'generated/google/apis/spanner_v1/classes.rb', line 255

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

Instance Attribute Details

#idString

id may be used to identify the transaction in subsequent Read, ExecuteSql, Commit, or Rollback calls. Single-use read-only transactions do not have IDs, because single-use transactions do not support multiple requests. Corresponds to the JSON property id NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


253
254
255
# File 'generated/google/apis/spanner_v1/classes.rb', line 253

def id
  @id
end

#read_timestampString

For snapshot read-only transactions, the read timestamp chosen for the transaction. Not returned by default: see TransactionOptions.ReadOnly.return_read_timestamp. Corresponds to the JSON property readTimestamp

Returns:

  • (String)


241
242
243
# File 'generated/google/apis/spanner_v1/classes.rb', line 241

def read_timestamp
  @read_timestamp
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



260
261
262
263
# File 'generated/google/apis/spanner_v1/classes.rb', line 260

def update!(**args)
  @read_timestamp = args[:read_timestamp] if args.key?(:read_timestamp)
  @id = args[:id] if args.key?(:id)
end