# Cloud Spanner V1 API - Class Google::Cloud::Spanner::V1::ResultSet (v1.19.0)

1.19.0 (latest) 1.18.0 1.17.1 1.16.0 1.15.0 1.14.0 1.13.0 1.12.1 1.11.1 1.10.1 1.9.1 1.8.0 1.7.1 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.2 0.27.0 0.26.0 0.25.0 0.24.0 0.23.0 0.22.2 0.21.0 0.20.1 0.19.0 0.18.0 0.17.0 0.16.0 0.15.1 0.14.1 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.1 0.7.4 Reference documentation and code samples for the Cloud Spanner V1 API class Google::Cloud::Spanner::V1::ResultSet.

Results from [Read](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-Spanner-Client#Google__Cloud__Spanner__V1__Spanner__Client_read_instance_ "Google::Cloud::Spanner::V1::Spanner::Client#read (method)") or
[ExecuteSql](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-Spanner-Client#Google__Cloud__Spanner__V1__Spanner__Client_execute_sql_instance_ "Google::Cloud::Spanner::V1::Spanner::Client#execute_sql (method)").

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #cache_update

    def cache_update() -> ::Google::Cloud::Spanner::V1::CacheUpdate

**Returns**

- ([::Google::Cloud::Spanner::V1::CacheUpdate](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-CacheUpdate)) --- Optional. A cache update expresses a set of changes the client should incorporate into its location cache. The client should discard the changes if they are older than the data it already has. This data can be obtained in response to requests that included a `RoutingHint` field, but may also be obtained by explicit location-fetching RPCs which may be added in the future.

### #cache_update=

    def cache_update=(value) -> ::Google::Cloud::Spanner::V1::CacheUpdate

**Parameter**

- **value** ([::Google::Cloud::Spanner::V1::CacheUpdate](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-CacheUpdate)) --- Optional. A cache update expresses a set of changes the client should incorporate into its location cache. The client should discard the changes if they are older than the data it already has. This data can be obtained in response to requests that included a `RoutingHint` field, but may also be obtained by explicit location-fetching RPCs which may be added in the future.
**Returns**

- ([::Google::Cloud::Spanner::V1::CacheUpdate](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-CacheUpdate)) --- Optional. A cache update expresses a set of changes the client should incorporate into its location cache. The client should discard the changes if they are older than the data it already has. This data can be obtained in response to requests that included a `RoutingHint` field, but may also be obtained by explicit location-fetching RPCs which may be added in the future.

### #metadata

    def metadata() -> ::Google::Cloud::Spanner::V1::ResultSetMetadata

**Returns**

- ([::Google::Cloud::Spanner::V1::ResultSetMetadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetMetadata)) --- Metadata about the result set, such as row type information.

### #metadata=

    def metadata=(value) -> ::Google::Cloud::Spanner::V1::ResultSetMetadata

**Parameter**

- **value** ([::Google::Cloud::Spanner::V1::ResultSetMetadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetMetadata)) --- Metadata about the result set, such as row type information.
**Returns**

- ([::Google::Cloud::Spanner::V1::ResultSetMetadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetMetadata)) --- Metadata about the result set, such as row type information.

### #precommit_token

    def precommit_token() -> ::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken

**Returns**

- ([::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-MultiplexedSessionPrecommitToken)) --- Optional. A precommit token is included if the read-write transaction is on a multiplexed session. Pass the precommit token with the highest sequence number from this transaction attempt to the [Commit](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-Spanner-Client#Google__Cloud__Spanner__V1__Spanner__Client_commit_instance_ "Google::Cloud::Spanner::V1::Spanner::Client#commit (method)") request for this transaction.

### #precommit_token=

    def precommit_token=(value) -> ::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken

**Parameter**

- **value** ([::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-MultiplexedSessionPrecommitToken)) --- Optional. A precommit token is included if the read-write transaction is on a multiplexed session. Pass the precommit token with the highest sequence number from this transaction attempt to the [Commit](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-Spanner-Client#Google__Cloud__Spanner__V1__Spanner__Client_commit_instance_ "Google::Cloud::Spanner::V1::Spanner::Client#commit (method)") request for this transaction.
**Returns**

- ([::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-MultiplexedSessionPrecommitToken)) --- Optional. A precommit token is included if the read-write transaction is on a multiplexed session. Pass the precommit token with the highest sequence number from this transaction attempt to the [Commit](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-Spanner-Client#Google__Cloud__Spanner__V1__Spanner__Client_commit_instance_ "Google::Cloud::Spanner::V1::Spanner::Client#commit (method)") request for this transaction.

### #rows

    def rows() -> ::Array<::Google::Protobuf::ListValue>

**Returns**

- (::Array\<[::Google::Protobuf::ListValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Protobuf-ListValue)\>) --- Each element in `rows` is a row whose format is defined by [metadata.row_type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetMetadata#Google__Cloud__Spanner__V1__ResultSetMetadata_row_type_instance_ "Google::Cloud::Spanner::V1::ResultSetMetadata#row_type (method)"). The ith element in each row matches the ith field in [metadata.row_type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetMetadata#Google__Cloud__Spanner__V1__ResultSetMetadata_row_type_instance_ "Google::Cloud::Spanner::V1::ResultSetMetadata#row_type (method)"). Elements are encoded based on type as described [here](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-TypeCode "Google::Cloud::Spanner::V1::TypeCode (module)").

### #rows=

    def rows=(value) -> ::Array<::Google::Protobuf::ListValue>

**Parameter**

- **value** (::Array\<[::Google::Protobuf::ListValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Protobuf-ListValue)\>) --- Each element in `rows` is a row whose format is defined by [metadata.row_type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetMetadata#Google__Cloud__Spanner__V1__ResultSetMetadata_row_type_instance_ "Google::Cloud::Spanner::V1::ResultSetMetadata#row_type (method)"). The ith element in each row matches the ith field in [metadata.row_type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetMetadata#Google__Cloud__Spanner__V1__ResultSetMetadata_row_type_instance_ "Google::Cloud::Spanner::V1::ResultSetMetadata#row_type (method)"). Elements are encoded based on type as described [here](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-TypeCode "Google::Cloud::Spanner::V1::TypeCode (module)").
**Returns**

- (::Array\<[::Google::Protobuf::ListValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Protobuf-ListValue)\>) --- Each element in `rows` is a row whose format is defined by [metadata.row_type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetMetadata#Google__Cloud__Spanner__V1__ResultSetMetadata_row_type_instance_ "Google::Cloud::Spanner::V1::ResultSetMetadata#row_type (method)"). The ith element in each row matches the ith field in [metadata.row_type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetMetadata#Google__Cloud__Spanner__V1__ResultSetMetadata_row_type_instance_ "Google::Cloud::Spanner::V1::ResultSetMetadata#row_type (method)"). Elements are encoded based on type as described [here](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-TypeCode "Google::Cloud::Spanner::V1::TypeCode (module)").

### #stats

    def stats() -> ::Google::Cloud::Spanner::V1::ResultSetStats

**Returns**

- ([::Google::Cloud::Spanner::V1::ResultSetStats](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetStats)) --- Query plan and execution statistics for the SQL statement that produced this result set. These can be requested by setting [ExecuteSqlRequest.query_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_query_mode_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode (method)"). DML statements always produce stats containing the number of rows modified, unless executed using the [ExecuteSqlRequest.QueryMode.PLAN](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest-QueryMode#Google__Cloud__Spanner__V1__ExecuteSqlRequest__QueryMode__PLAN "Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::PLAN (constant)") [ExecuteSqlRequest.query_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_query_mode_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode (method)"). Other fields might or might not be populated, based on the [ExecuteSqlRequest.query_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_query_mode_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode (method)").

### #stats=

    def stats=(value) -> ::Google::Cloud::Spanner::V1::ResultSetStats

**Parameter**

- **value** ([::Google::Cloud::Spanner::V1::ResultSetStats](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetStats)) --- Query plan and execution statistics for the SQL statement that produced this result set. These can be requested by setting [ExecuteSqlRequest.query_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_query_mode_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode (method)"). DML statements always produce stats containing the number of rows modified, unless executed using the [ExecuteSqlRequest.QueryMode.PLAN](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest-QueryMode#Google__Cloud__Spanner__V1__ExecuteSqlRequest__QueryMode__PLAN "Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::PLAN (constant)") [ExecuteSqlRequest.query_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_query_mode_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode (method)"). Other fields might or might not be populated, based on the [ExecuteSqlRequest.query_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_query_mode_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode (method)").
**Returns**

- ([::Google::Cloud::Spanner::V1::ResultSetStats](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetStats)) --- Query plan and execution statistics for the SQL statement that produced this result set. These can be requested by setting [ExecuteSqlRequest.query_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_query_mode_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode (method)"). DML statements always produce stats containing the number of rows modified, unless executed using the [ExecuteSqlRequest.QueryMode.PLAN](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest-QueryMode#Google__Cloud__Spanner__V1__ExecuteSqlRequest__QueryMode__PLAN "Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::PLAN (constant)") [ExecuteSqlRequest.query_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_query_mode_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode (method)"). Other fields might or might not be populated, based on the [ExecuteSqlRequest.query_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_query_mode_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode (method)").