Class: Google::Apis::SpannerV1::ReadRequest

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

The request for Read and StreamingRead.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ReadRequest

Returns a new instance of ReadRequest.



5976
5977
5978
# File 'lib/google/apis/spanner_v1/classes.rb', line 5976

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

Instance Attribute Details

#columnsArray<String>

Required. The columns of table to be returned for each row matching this request. Corresponds to the JSON property columns

Returns:

  • (Array<String>)


5883
5884
5885
# File 'lib/google/apis/spanner_v1/classes.rb', line 5883

def columns
  @columns
end

#data_boost_enabledBoolean Also known as: data_boost_enabled?

If this is for a partitioned read and this field is set to true, the request is executed with Spanner Data Boost independent compute resources. If the field is set to true but the request doesn't set partition_token, the API returns an INVALID_ARGUMENT error. Corresponds to the JSON property dataBoostEnabled

Returns:

  • (Boolean)


5891
5892
5893
# File 'lib/google/apis/spanner_v1/classes.rb', line 5891

def data_boost_enabled
  @data_boost_enabled
end

#directed_read_optionsGoogle::Apis::SpannerV1::DirectedReadOptions

The DirectedReadOptions can be used to indicate which replicas or regions should be used for non-transactional reads or queries. DirectedReadOptions can only be specified for a read-only transaction, otherwise the API returns an INVALID_ARGUMENT error. Corresponds to the JSON property directedReadOptions



5900
5901
5902
# File 'lib/google/apis/spanner_v1/classes.rb', line 5900

def directed_read_options
  @directed_read_options
end

#indexString

If non-empty, the name of an index on table. This index is used instead of the table primary key when interpreting key_set and sorting result rows. See key_set for further information. Corresponds to the JSON property index

Returns:

  • (String)


5907
5908
5909
# File 'lib/google/apis/spanner_v1/classes.rb', line 5907

def index
  @index
end

#key_setGoogle::Apis::SpannerV1::KeySet

KeySet defines a collection of Cloud Spanner keys and/or key ranges. All the keys are expected to be in the same table or index. The keys need not be sorted in any particular way. If the same key is specified multiple times in the set (for example if two ranges, two keys, or a key and a range overlap), Cloud Spanner behaves as if the key were only specified once. Corresponds to the JSON property keySet



5916
5917
5918
# File 'lib/google/apis/spanner_v1/classes.rb', line 5916

def key_set
  @key_set
end

#limitFixnum

If greater than zero, only the first limit rows are yielded. If limit is zero, the default is no limit. A limit can't be specified if partition_token is set. Corresponds to the JSON property limit

Returns:

  • (Fixnum)


5923
5924
5925
# File 'lib/google/apis/spanner_v1/classes.rb', line 5923

def limit
  @limit
end

#lock_hintString

Optional. Lock Hint for the request, it can only be used with read-write transactions. Corresponds to the JSON property lockHint

Returns:

  • (String)


5929
5930
5931
# File 'lib/google/apis/spanner_v1/classes.rb', line 5929

def lock_hint
  @lock_hint
end

#order_byString

Optional. Order for the returned rows. By default, Spanner returns result rows in primary key order except for PartitionRead requests. For applications that don't require rows to be returned in primary key (ORDER_BY_PRIMARY_KEY) order, setting ORDER_BY_NO_ORDER option allows Spanner to optimize row retrieval, resulting in lower latencies in certain cases (for example, bulk point lookups). Corresponds to the JSON property orderBy

Returns:

  • (String)


5939
5940
5941
# File 'lib/google/apis/spanner_v1/classes.rb', line 5939

def order_by
  @order_by
end

#partition_tokenString

If present, results are restricted to the specified partition previously created using PartitionRead. There must be an exact match for the values of fields common to this message and the PartitionReadRequest message used to create this partition_token. Corresponds to the JSON property partitionToken NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


5948
5949
5950
# File 'lib/google/apis/spanner_v1/classes.rb', line 5948

def partition_token
  @partition_token
end

#request_optionsGoogle::Apis::SpannerV1::RequestOptions

Common request options for various APIs. Corresponds to the JSON property requestOptions



5953
5954
5955
# File 'lib/google/apis/spanner_v1/classes.rb', line 5953

def request_options
  @request_options
end

#resume_tokenString

If this request is resuming a previously interrupted read, resume_token should be copied from the last PartialResultSet yielded before the interruption. Doing this enables the new read to resume where the last read left off. The rest of the request parameters must exactly match the request that yielded this token. Corresponds to the JSON property resumeToken NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


5963
5964
5965
# File 'lib/google/apis/spanner_v1/classes.rb', line 5963

def resume_token
  @resume_token
end

#tableString

Required. The name of the table in the database to be read. Corresponds to the JSON property table

Returns:

  • (String)


5968
5969
5970
# File 'lib/google/apis/spanner_v1/classes.rb', line 5968

def table
  @table
end

#transactionGoogle::Apis::SpannerV1::TransactionSelector

This message is used to select the transaction in which a Read or ExecuteSql call runs. See TransactionOptions for more information about transactions. Corresponds to the JSON property transaction



5974
5975
5976
# File 'lib/google/apis/spanner_v1/classes.rb', line 5974

def transaction
  @transaction
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
# File 'lib/google/apis/spanner_v1/classes.rb', line 5981

def update!(**args)
  @columns = args[:columns] if args.key?(:columns)
  @data_boost_enabled = args[:data_boost_enabled] if args.key?(:data_boost_enabled)
  @directed_read_options = args[:directed_read_options] if args.key?(:directed_read_options)
  @index = args[:index] if args.key?(:index)
  @key_set = args[:key_set] if args.key?(:key_set)
  @limit = args[:limit] if args.key?(:limit)
  @lock_hint = args[:lock_hint] if args.key?(:lock_hint)
  @order_by = args[:order_by] if args.key?(:order_by)
  @partition_token = args[:partition_token] if args.key?(:partition_token)
  @request_options = args[:request_options] if args.key?(:request_options)
  @resume_token = args[:resume_token] if args.key?(:resume_token)
  @table = args[:table] if args.key?(:table)
  @transaction = args[:transaction] if args.key?(:transaction)
end