Class: Google::Spanner::V1::ExecuteBatchDmlRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb

Overview

The request for ExecuteBatchDml

Defined Under Namespace

Classes: Statement

Instance Attribute Summary collapse

Instance Attribute Details

#seqno ⇒ Integer

Returns A per-transaction sequence number used to identify this request. This is used in the same space as the seqno in ExecuteSqlRequest. See more details in ExecuteSqlRequest.

Returns:

  • (Integer) —

    A per-transaction sequence number used to identify this request. This is used in the same space as the seqno in ExecuteSqlRequest. See more details in ExecuteSqlRequest.



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb', line 227

class ExecuteBatchDmlRequest
  # A single DML statement.
  # @!attribute [rw] sql
  #   @return [String]
  #     Required. The DML string.
  # @!attribute [rw] params
  #   @return [Google::Protobuf::Struct]
  #     The DML string can contain parameter placeholders. A parameter
  #     placeholder consists of `'@'` followed by the parameter
  #     name. Parameter names consist of any combination of letters,
  #     numbers, and underscores.
  #
  #     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 is an error to execute an SQL statement with unbound parameters.
  #
  #     Parameter values are specified using `params`, which is a JSON
  #     object whose keys are parameter names, and whose values are the
  #     corresponding parameter values.
  # @!attribute [rw] param_types
  #   @return [Hash{String => Google::Spanner::V1::Type}]
  #     It is not 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 {Google::Spanner::V1::ExecuteBatchDmlRequest::Statement#params params} as JSON strings.
  #
  #     In these cases, `param_types` can be used to specify the exact
  #     SQL type for some or all of the SQL statement parameters. See the
  #     definition of {Google::Spanner::V1::Type Type} for more information
  #     about SQL types.
  class Statement; end
end

#session ⇒ String

Returns Required. The session in which the DML statements should be performed.

Returns:

  • (String) —

    Required. The session in which the DML statements should be performed.



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb', line 227

class ExecuteBatchDmlRequest
  # A single DML statement.
  # @!attribute [rw] sql
  #   @return [String]
  #     Required. The DML string.
  # @!attribute [rw] params
  #   @return [Google::Protobuf::Struct]
  #     The DML string can contain parameter placeholders. A parameter
  #     placeholder consists of `'@'` followed by the parameter
  #     name. Parameter names consist of any combination of letters,
  #     numbers, and underscores.
  #
  #     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 is an error to execute an SQL statement with unbound parameters.
  #
  #     Parameter values are specified using `params`, which is a JSON
  #     object whose keys are parameter names, and whose values are the
  #     corresponding parameter values.
  # @!attribute [rw] param_types
  #   @return [Hash{String => Google::Spanner::V1::Type}]
  #     It is not 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 {Google::Spanner::V1::ExecuteBatchDmlRequest::Statement#params params} as JSON strings.
  #
  #     In these cases, `param_types` can be used to specify the exact
  #     SQL type for some or all of the SQL statement parameters. See the
  #     definition of {Google::Spanner::V1::Type Type} for more information
  #     about SQL types.
  class Statement; end
end

#statements ⇒ Array<Google::Spanner::V1::ExecuteBatchDmlRequest::Statement>

Returns The list of statements to execute in this batch. Statements are executed serially, such that the effects of statement i are visible to statement i+1. Each statement must be a DML statement. Execution will stop at the first failed statement; the remaining statements will not run.

REQUIRES: statements_size() > 0.

Returns:

  • (Array<Google::Spanner::V1::ExecuteBatchDmlRequest::Statement>) —

    The list of statements to execute in this batch. Statements are executed serially, such that the effects of statement i are visible to statement i+1. Each statement must be a DML statement. Execution will stop at the first failed statement; the remaining statements will not run.

    REQUIRES: statements_size() > 0.



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb', line 227

class ExecuteBatchDmlRequest
  # A single DML statement.
  # @!attribute [rw] sql
  #   @return [String]
  #     Required. The DML string.
  # @!attribute [rw] params
  #   @return [Google::Protobuf::Struct]
  #     The DML string can contain parameter placeholders. A parameter
  #     placeholder consists of `'@'` followed by the parameter
  #     name. Parameter names consist of any combination of letters,
  #     numbers, and underscores.
  #
  #     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 is an error to execute an SQL statement with unbound parameters.
  #
  #     Parameter values are specified using `params`, which is a JSON
  #     object whose keys are parameter names, and whose values are the
  #     corresponding parameter values.
  # @!attribute [rw] param_types
  #   @return [Hash{String => Google::Spanner::V1::Type}]
  #     It is not 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 {Google::Spanner::V1::ExecuteBatchDmlRequest::Statement#params params} as JSON strings.
  #
  #     In these cases, `param_types` can be used to specify the exact
  #     SQL type for some or all of the SQL statement parameters. See the
  #     definition of {Google::Spanner::V1::Type Type} for more information
  #     about SQL types.
  class Statement; end
end

#transaction ⇒ Google::Spanner::V1::TransactionSelector

Returns The transaction to use. A ReadWrite transaction is required. Single-use transactions are not supported (to avoid replay). The caller must either supply an existing transaction ID or begin a new transaction.

Returns:

  • (Google::Spanner::V1::TransactionSelector) —

    The transaction to use. A ReadWrite transaction is required. Single-use transactions are not supported (to avoid replay). The caller must either supply an existing transaction ID or begin a new transaction.



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb', line 227

class ExecuteBatchDmlRequest
  # A single DML statement.
  # @!attribute [rw] sql
  #   @return [String]
  #     Required. The DML string.
  # @!attribute [rw] params
  #   @return [Google::Protobuf::Struct]
  #     The DML string can contain parameter placeholders. A parameter
  #     placeholder consists of `'@'` followed by the parameter
  #     name. Parameter names consist of any combination of letters,
  #     numbers, and underscores.
  #
  #     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 is an error to execute an SQL statement with unbound parameters.
  #
  #     Parameter values are specified using `params`, which is a JSON
  #     object whose keys are parameter names, and whose values are the
  #     corresponding parameter values.
  # @!attribute [rw] param_types
  #   @return [Hash{String => Google::Spanner::V1::Type}]
  #     It is not 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 {Google::Spanner::V1::ExecuteBatchDmlRequest::Statement#params params} as JSON strings.
  #
  #     In these cases, `param_types` can be used to specify the exact
  #     SQL type for some or all of the SQL statement parameters. See the
  #     definition of {Google::Spanner::V1::Type Type} for more information
  #     about SQL types.
  class Statement; end
end