# Cloud Spanner V1 API - Class Google::Cloud::Spanner::V1::ExecuteSqlRequest (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::ExecuteSqlRequest.

The request for [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)") and
[ExecuteStreamingSql](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_streaming_sql_instance_ "Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql (method)").

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #data_boost_enabled

    def data_boost_enabled() -> ::Boolean

**Returns**

- (::Boolean) --- If this is for a partitioned query 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.

### #data_boost_enabled=

    def data_boost_enabled=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If this is for a partitioned query 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.
**Returns**

- (::Boolean) --- If this is for a partitioned query 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.

### #directed_read_options

    def directed_read_options() -> ::Google::Cloud::Spanner::V1::DirectedReadOptions

**Returns**

- ([::Google::Cloud::Spanner::V1::DirectedReadOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-DirectedReadOptions)) --- Directed read options for this request.

### #directed_read_options=

    def directed_read_options=(value) -> ::Google::Cloud::Spanner::V1::DirectedReadOptions

**Parameter**

- **value** ([::Google::Cloud::Spanner::V1::DirectedReadOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-DirectedReadOptions)) --- Directed read options for this request.
**Returns**

- ([::Google::Cloud::Spanner::V1::DirectedReadOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-DirectedReadOptions)) --- Directed read options for this request.

### #last_statement

    def last_statement() -> ::Boolean

**Returns**

- (::Boolean) --- Optional. If set to `true`, this statement marks the end of the transaction. After this statement executes, you must commit or abort the transaction. Attempts to execute any other requests against this transaction (including reads and queries) are rejected.


  For DML statements, setting this option might cause some error reporting to
  be deferred until commit time (for example, validation of unique
  constraints). Given this, successful execution of a DML statement shouldn't
  be assumed until a subsequent `Commit` call completes successfully.

### #last_statement=

    def last_statement=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Optional. If set to `true`, this statement marks the end of the transaction. After this statement executes, you must commit or abort the transaction. Attempts to execute any other requests against this transaction (including reads and queries) are rejected.


  For DML statements, setting this option might cause some error reporting to
  be deferred until commit time (for example, validation of unique
  constraints). Given this, successful execution of a DML statement shouldn't
  be assumed until a subsequent `Commit` call completes successfully.
**Returns**

- (::Boolean) --- Optional. If set to `true`, this statement marks the end of the transaction. After this statement executes, you must commit or abort the transaction. Attempts to execute any other requests against this transaction (including reads and queries) are rejected.


  For DML statements, setting this option might cause some error reporting to
  be deferred until commit time (for example, validation of unique
  constraints). Given this, successful execution of a DML statement shouldn't
  be assumed until a subsequent `Commit` call completes successfully.

### #param_types

    def param_types() -> ::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::Google::Cloud::Spanner::V1::Type}) --- It isn't always possible for Cloud Spanner to infer the right SQL type from a JSON value. For example, values of type `BYTES` and values of type `STRING` both appear in [params](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_params_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#params (method)") as JSON strings.


  In these cases, you can use `param_types` to specify the exact
  SQL type for some or all of the SQL statement parameters. See the
  definition of [Type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-Type "Google::Cloud::Spanner::V1::Type (class)") for more information
  about SQL types.

### #param_types=

    def param_types=(value) -> ::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::Google::Cloud::Spanner::V1::Type}) --- It isn't always possible for Cloud Spanner to infer the right SQL type from a JSON value. For example, values of type `BYTES` and values of type `STRING` both appear in [params](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_params_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#params (method)") as JSON strings.


  In these cases, you can use `param_types` to specify the exact
  SQL type for some or all of the SQL statement parameters. See the
  definition of [Type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-Type "Google::Cloud::Spanner::V1::Type (class)") for more information
  about SQL types.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::Google::Cloud::Spanner::V1::Type}) --- It isn't always possible for Cloud Spanner to infer the right SQL type from a JSON value. For example, values of type `BYTES` and values of type `STRING` both appear in [params](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_params_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#params (method)") as JSON strings.


  In these cases, you can use `param_types` to specify the exact
  SQL type for some or all of the SQL statement parameters. See the
  definition of [Type](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-Type "Google::Cloud::Spanner::V1::Type (class)") for more information
  about SQL types.

### #params

    def params() -> ::Google::Protobuf::Struct

**Returns**

- ([::Google::Protobuf::Struct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Protobuf-Struct)) --- Parameter names and values that bind to placeholders in the SQL string.


  A parameter placeholder consists of the `@` character followed by the
  parameter name (for example, `@firstName`). Parameter names must conform
  to the naming requirements of identifiers as specified at
  https://cloud.google.com/spanner/docs/lexical#identifiers.

  Parameters can appear anywhere that a literal value is expected. The same
  parameter name can be used more than once, for example:

  `"WHERE id > @msg_id AND id < @msg_id + 100"`

  It's an error to execute a SQL statement with unbound parameters.

### #params=

    def params=(value) -> ::Google::Protobuf::Struct

**Parameter**

- **value** ([::Google::Protobuf::Struct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Protobuf-Struct)) --- Parameter names and values that bind to placeholders in the SQL string.


  A parameter placeholder consists of the `@` character followed by the
  parameter name (for example, `@firstName`). Parameter names must conform
  to the naming requirements of identifiers as specified at
  https://cloud.google.com/spanner/docs/lexical#identifiers.

  Parameters can appear anywhere that a literal value is expected. The same
  parameter name can be used more than once, for example:

  `"WHERE id > @msg_id AND id < @msg_id + 100"`

  It's an error to execute a SQL statement with unbound parameters.
**Returns**

- ([::Google::Protobuf::Struct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Protobuf-Struct)) --- Parameter names and values that bind to placeholders in the SQL string.


  A parameter placeholder consists of the `@` character followed by the
  parameter name (for example, `@firstName`). Parameter names must conform
  to the naming requirements of identifiers as specified at
  https://cloud.google.com/spanner/docs/lexical#identifiers.

  Parameters can appear anywhere that a literal value is expected. The same
  parameter name can be used more than once, for example:

  `"WHERE id > @msg_id AND id < @msg_id + 100"`

  It's an error to execute a SQL statement with unbound parameters.

### #partition_token

    def partition_token() -> ::String

**Returns**

- (::String) --- If present, results are restricted to the specified partition previously created using `PartitionQuery`. There must be an exact match for the values of fields common to this message and the `PartitionQueryRequest` message used to create this `partition_token`.

### #partition_token=

    def partition_token=(value) -> ::String

**Parameter**

- **value** (::String) --- If present, results are restricted to the specified partition previously created using `PartitionQuery`. There must be an exact match for the values of fields common to this message and the `PartitionQueryRequest` message used to create this `partition_token`.
**Returns**

- (::String) --- If present, results are restricted to the specified partition previously created using `PartitionQuery`. There must be an exact match for the values of fields common to this message and the `PartitionQueryRequest` message used to create this `partition_token`.

### #query_mode

    def query_mode() -> ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode

**Returns**

- ([::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest-QueryMode)) --- Used to control the amount of debugging information returned in [ResultSetStats](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetStats "Google::Cloud::Spanner::V1::ResultSetStats (class)"). If [partition_token](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_partition_token_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token (method)") is set, [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)") can only be set to [QueryMode.NORMAL](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__NORMAL "Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL (constant)").

### #query_mode=

    def query_mode=(value) -> ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode

**Parameter**

- **value** ([::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest-QueryMode)) --- Used to control the amount of debugging information returned in [ResultSetStats](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetStats "Google::Cloud::Spanner::V1::ResultSetStats (class)"). If [partition_token](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_partition_token_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token (method)") is set, [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)") can only be set to [QueryMode.NORMAL](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__NORMAL "Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL (constant)").
**Returns**

- ([::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest-QueryMode)) --- Used to control the amount of debugging information returned in [ResultSetStats](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ResultSetStats "Google::Cloud::Spanner::V1::ResultSetStats (class)"). If [partition_token](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest#Google__Cloud__Spanner__V1__ExecuteSqlRequest_partition_token_instance_ "Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token (method)") is set, [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)") can only be set to [QueryMode.NORMAL](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__NORMAL "Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL (constant)").

### #query_options

    def query_options() -> ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions

**Returns**

- ([::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest-QueryOptions)) --- Query optimizer configuration to use for the given query.

### #query_options=

    def query_options=(value) -> ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions

**Parameter**

- **value** ([::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest-QueryOptions)) --- Query optimizer configuration to use for the given query.
**Returns**

- ([::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-ExecuteSqlRequest-QueryOptions)) --- Query optimizer configuration to use for the given query.

### #request_options

    def request_options() -> ::Google::Cloud::Spanner::V1::RequestOptions

**Returns**

- ([::Google::Cloud::Spanner::V1::RequestOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-RequestOptions)) --- Common options for this request.

### #request_options=

    def request_options=(value) -> ::Google::Cloud::Spanner::V1::RequestOptions

**Parameter**

- **value** ([::Google::Cloud::Spanner::V1::RequestOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-RequestOptions)) --- Common options for this request.
**Returns**

- ([::Google::Cloud::Spanner::V1::RequestOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-RequestOptions)) --- Common options for this request.

### #resume_token

    def resume_token() -> ::String

**Returns**

- (::String) --- If this request is resuming a previously interrupted SQL statement execution, `resume_token` should be copied from the last [PartialResultSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-PartialResultSet "Google::Cloud::Spanner::V1::PartialResultSet (class)") yielded before the interruption. Doing this enables the new SQL statement execution to resume where the last one left off. The rest of the request parameters must exactly match the request that yielded this token.

### #resume_token=

    def resume_token=(value) -> ::String

**Parameter**

- **value** (::String) --- If this request is resuming a previously interrupted SQL statement execution, `resume_token` should be copied from the last [PartialResultSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-PartialResultSet "Google::Cloud::Spanner::V1::PartialResultSet (class)") yielded before the interruption. Doing this enables the new SQL statement execution to resume where the last one left off. The rest of the request parameters must exactly match the request that yielded this token.
**Returns**

- (::String) --- If this request is resuming a previously interrupted SQL statement execution, `resume_token` should be copied from the last [PartialResultSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-PartialResultSet "Google::Cloud::Spanner::V1::PartialResultSet (class)") yielded before the interruption. Doing this enables the new SQL statement execution to resume where the last one left off. The rest of the request parameters must exactly match the request that yielded this token.

### #routing_hint

    def routing_hint() -> ::Google::Cloud::Spanner::V1::RoutingHint

**Returns**

- ([::Google::Cloud::Spanner::V1::RoutingHint](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-RoutingHint)) --- Optional. Makes the Spanner requests location-aware if present.


  It gives the server hints that can be used to route the request
  to an appropriate server, potentially significantly decreasing latency and
  improving throughput. To achieve improved performance, most fields must be
  filled in with accurate values.

### #routing_hint=

    def routing_hint=(value) -> ::Google::Cloud::Spanner::V1::RoutingHint

**Parameter**

- **value** ([::Google::Cloud::Spanner::V1::RoutingHint](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-RoutingHint)) --- Optional. Makes the Spanner requests location-aware if present.


  It gives the server hints that can be used to route the request
  to an appropriate server, potentially significantly decreasing latency and
  improving throughput. To achieve improved performance, most fields must be
  filled in with accurate values.
**Returns**

- ([::Google::Cloud::Spanner::V1::RoutingHint](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-RoutingHint)) --- Optional. Makes the Spanner requests location-aware if present.


  It gives the server hints that can be used to route the request
  to an appropriate server, potentially significantly decreasing latency and
  improving throughput. To achieve improved performance, most fields must be
  filled in with accurate values.

### #seqno

    def seqno() -> ::Integer

**Returns**

- (::Integer) --- A per-transaction sequence number used to identify this request. This field makes each request idempotent such that if the request is received multiple times, at most one succeeds.

  The sequence number must be monotonically increasing within the
  transaction. If a request arrives for the first time with an out-of-order
  sequence number, the transaction can be aborted. Replays of previously
  handled requests yield the same response as the first execution.

  Required for DML statements. Ignored for queries.

### #seqno=

    def seqno=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- A per-transaction sequence number used to identify this request. This field makes each request idempotent such that if the request is received multiple times, at most one succeeds.


  The sequence number must be monotonically increasing within the
  transaction. If a request arrives for the first time with an out-of-order
  sequence number, the transaction can be aborted. Replays of previously
  handled requests yield the same response as the first execution.

  Required for DML statements. Ignored for queries.
**Returns**

- (::Integer) --- A per-transaction sequence number used to identify this request. This field makes each request idempotent such that if the request is received multiple times, at most one succeeds.

  The sequence number must be monotonically increasing within the
  transaction. If a request arrives for the first time with an out-of-order
  sequence number, the transaction can be aborted. Replays of previously
  handled requests yield the same response as the first execution.

  Required for DML statements. Ignored for queries.

### #session

    def session() -> ::String

**Returns**

- (::String) --- Required. The session in which the SQL query should be performed.

### #session=

    def session=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. The session in which the SQL query should be performed.
**Returns**

- (::String) --- Required. The session in which the SQL query should be performed.

### #sql

    def sql() -> ::String

**Returns**

- (::String) --- Required. The SQL string.

### #sql=

    def sql=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. The SQL string.
**Returns**

- (::String) --- Required. The SQL string.

### #transaction

    def transaction() -> ::Google::Cloud::Spanner::V1::TransactionSelector

**Returns**

- ([::Google::Cloud::Spanner::V1::TransactionSelector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-TransactionSelector)) --- The transaction to use.


  For queries, if none is provided, the default is a temporary read-only
  transaction with strong concurrency.

  Standard DML statements require a read-write transaction. To protect
  against replays, single-use transactions are not supported. The caller
  must either supply an existing transaction ID or begin a new transaction.

  Partitioned DML requires an existing Partitioned DML transaction ID.

### #transaction=

    def transaction=(value) -> ::Google::Cloud::Spanner::V1::TransactionSelector

**Parameter**

- **value** ([::Google::Cloud::Spanner::V1::TransactionSelector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-TransactionSelector)) --- The transaction to use.


  For queries, if none is provided, the default is a temporary read-only
  transaction with strong concurrency.

  Standard DML statements require a read-write transaction. To protect
  against replays, single-use transactions are not supported. The caller
  must either supply an existing transaction ID or begin a new transaction.

  Partitioned DML requires an existing Partitioned DML transaction ID.
**Returns**

- ([::Google::Cloud::Spanner::V1::TransactionSelector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest/Google-Cloud-Spanner-V1-TransactionSelector)) --- The transaction to use.


  For queries, if none is provided, the default is a temporary read-only
  transaction with strong concurrency.

  Standard DML statements require a read-write transaction. To protect
  against replays, single-use transactions are not supported. The caller
  must either supply an existing transaction ID or begin a new transaction.

  Partitioned DML requires an existing Partitioned DML transaction ID.