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

Inherits:
Object
  • Object
show all
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

Instance Attribute Details

#request_options::Google::Cloud::Spanner::V1::RequestOptions

Returns Common options for this request.

Returns:



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'proto_docs/google/spanner/v1/spanner.rb', line 542

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 is 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 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::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 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.

Returns:

  • (::Integer)

    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.



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'proto_docs/google/spanner/v1/spanner.rb', line 542

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 is 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 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::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.

Returns:

  • (::String)

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



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'proto_docs/google/spanner/v1/spanner.rb', line 542

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 is 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 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::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.

Returns:

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

    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.



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'proto_docs/google/spanner/v1/spanner.rb', line 542

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 is 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 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::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.

Returns:

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

    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.



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'proto_docs/google/spanner/v1/spanner.rb', line 542

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 is 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 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::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