Class: Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest
- Extended by:
- Protobuf::MessageExts::ClassMethods
- Includes:
- Protobuf::MessageExts
- Defined in:
- proto_docs/google/spanner/v1/spanner.rb
Overview
The request for ExecuteBatchDml.
Defined Under Namespace
Classes: Statement
Instance Attribute Summary collapse
-
#last_statements ⇒ ::Boolean
Optional.
-
#request_options ⇒ ::Google::Cloud::Spanner::V1::RequestOptions
Common options for this request.
-
#seqno ⇒ ::Integer
Required.
-
#session ⇒ ::String
Required.
-
#statements ⇒ ::Array<::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement>
Required.
-
#transaction ⇒ ::Google::Cloud::Spanner::V1::TransactionSelector
Required.
Instance Attribute Details
#last_statements ⇒ ::Boolean
Returns Optional. If set to true, this request marks the end of the transaction.
After these statements execute, you must commit or abort the transaction.
Attempts to execute any other requests against this transaction
(including reads and queries) are rejected.
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 statements shouldn't be assumed until a subsequent
Commit call completes successfully.
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'proto_docs/google/spanner/v1/spanner.rb', line 611 class ExecuteBatchDmlRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # 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's an error to execute a SQL statement with unbound parameters. # @!attribute [rw] param_types # @return [::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 # {::Google::Cloud::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::Cloud::Spanner::V1::Type Type} for more information # about SQL types. class Statement include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::Google::Cloud::Spanner::V1::Type] class ParamTypesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end |
#request_options ⇒ ::Google::Cloud::Spanner::V1::RequestOptions
Returns Common options for this request.
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'proto_docs/google/spanner/v1/spanner.rb', line 611 class ExecuteBatchDmlRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # 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's an error to execute a SQL statement with unbound parameters. # @!attribute [rw] param_types # @return [::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 # {::Google::Cloud::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::Cloud::Spanner::V1::Type Type} for more information # about SQL types. class Statement include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::Google::Cloud::Spanner::V1::Type] class ParamTypesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end |
#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 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 might be aborted. Replays of previously handled requests yield the same response as the first execution.
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'proto_docs/google/spanner/v1/spanner.rb', line 611 class ExecuteBatchDmlRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # 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's an error to execute a SQL statement with unbound parameters. # @!attribute [rw] param_types # @return [::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 # {::Google::Cloud::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::Cloud::Spanner::V1::Type Type} for more information # about SQL types. class Statement include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::Google::Cloud::Spanner::V1::Type] class ParamTypesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end |
#session ⇒ ::String
Returns Required. The session in which the DML statements should be performed.
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'proto_docs/google/spanner/v1/spanner.rb', line 611 class ExecuteBatchDmlRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # 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's an error to execute a SQL statement with unbound parameters. # @!attribute [rw] param_types # @return [::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 # {::Google::Cloud::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::Cloud::Spanner::V1::Type Type} for more information # about SQL types. class Statement include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::Google::Cloud::Spanner::V1::Type] class ParamTypesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end |
#statements ⇒ ::Array<::Google::Cloud::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.
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'proto_docs/google/spanner/v1/spanner.rb', line 611 class ExecuteBatchDmlRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # 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's an error to execute a SQL statement with unbound parameters. # @!attribute [rw] param_types # @return [::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 # {::Google::Cloud::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::Cloud::Spanner::V1::Type Type} for more information # about SQL types. class Statement include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::Google::Cloud::Spanner::V1::Type] class ParamTypesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end |
#transaction ⇒ ::Google::Cloud::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.
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'proto_docs/google/spanner/v1/spanner.rb', line 611 class ExecuteBatchDmlRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # 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's an error to execute a SQL statement with unbound parameters. # @!attribute [rw] param_types # @return [::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 # {::Google::Cloud::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::Cloud::Spanner::V1::Type Type} for more information # about SQL types. class Statement include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # @!attribute [rw] key # @return [::String] # @!attribute [rw] value # @return [::Google::Cloud::Spanner::V1::Type] class ParamTypesEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end |