Class: Google::Spanner::V1::ExecuteBatchDmlRequest
- Inherits:
-
Object
- Object
- Google::Spanner::V1::ExecuteBatchDmlRequest
- 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
-
#seqno ⇒ Integer
Required.
-
#session ⇒ String
Required.
-
#statements ⇒ Array<Google::Spanner::V1::ExecuteBatchDmlRequest::Statement>
Required.
-
#transaction ⇒ Google::Spanner::V1::TransactionSelector
Required.
Instance Attribute Details
#seqno ⇒ Integer
Returns Required. 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 will succeed.
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 may be aborted. Replays of previously handled requests will yield the same response as the first execution.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb', line 269 class ExecuteBatchDmlRequest # A single DML statement. # @!attribute [rw] sql # @return [String] # Required. The DML string. # @!attribute [rw] params # @return [Google::Protobuf::Struct] # Parameter names and values that bind to placeholders in the DML string. # # A parameter placeholder consists of the `@` character followed by the # parameter name (for example, `@firstName`). Parameter names can contain # 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 a SQL statement with unbound parameters. # @!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.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb', line 269 class ExecuteBatchDmlRequest # A single DML statement. # @!attribute [rw] sql # @return [String] # Required. The DML string. # @!attribute [rw] params # @return [Google::Protobuf::Struct] # Parameter names and values that bind to placeholders in the DML string. # # A parameter placeholder consists of the `@` character followed by the # parameter name (for example, `@firstName`). Parameter names can contain # 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 a SQL statement with unbound parameters. # @!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 Required. 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 stops at the
first failed statement; the remaining statements are not executed.
Callers must provide at least one statement.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb', line 269 class ExecuteBatchDmlRequest # A single DML statement. # @!attribute [rw] sql # @return [String] # Required. The DML string. # @!attribute [rw] params # @return [Google::Protobuf::Struct] # Parameter names and values that bind to placeholders in the DML string. # # A parameter placeholder consists of the `@` character followed by the # parameter name (for example, `@firstName`). Parameter names can contain # 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 a SQL statement with unbound parameters. # @!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 Required. The transaction to use. Must be 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.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb', line 269 class ExecuteBatchDmlRequest # A single DML statement. # @!attribute [rw] sql # @return [String] # Required. The DML string. # @!attribute [rw] params # @return [Google::Protobuf::Struct] # Parameter names and values that bind to placeholders in the DML string. # # A parameter placeholder consists of the `@` character followed by the # parameter name (for example, `@firstName`). Parameter names can contain # 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 a SQL statement with unbound parameters. # @!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 |