Class: Google::Apis::SpannerV1::Write

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

Arguments to insert, update, insert_or_update, and replace operations.

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) ⇒ Write

Returns a new instance of Write



2296
2297
2298
# File 'generated/google/apis/spanner_v1/classes.rb', line 2296

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

Instance Attribute Details

#columnsArray<String>

The names of the columns in table to be written. The list of columns must contain enough columns to allow Cloud Spanner to derive values for all primary key columns in the row(s) to be modified. Corresponds to the JSON property columns

Returns:

  • (Array<String>)


2282
2283
2284
# File 'generated/google/apis/spanner_v1/classes.rb', line 2282

def columns
  @columns
end

#tableString

Required. The table whose rows will be written. Corresponds to the JSON property table

Returns:

  • (String)


2274
2275
2276
# File 'generated/google/apis/spanner_v1/classes.rb', line 2274

def table
  @table
end

#valuesArray<Array<Object>>

The values to be written. values can contain more than one list of values. If it does, then multiple rows are written, one for each entry in values. Each list in values must have exactly as many entries as there are entries in columns above. Sending multiple lists is equivalent to sending multiple Mutations, each containing one values entry and repeating table and columns. Individual values in each list are encoded as described here. Corresponds to the JSON property values

Returns:

  • (Array<Array<Object>>)


2294
2295
2296
# File 'generated/google/apis/spanner_v1/classes.rb', line 2294

def values
  @values
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2301
2302
2303
2304
2305
# File 'generated/google/apis/spanner_v1/classes.rb', line 2301

def update!(**args)
  @table = args[:table] if args.key?(:table)
  @columns = args[:columns] if args.key?(:columns)
  @values = args[:values] if args.key?(:values)
end