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

#last_statements::Boolean

Returns Optional. If set to true, this request marks the end of the transaction. The transaction should be committed or aborted after these statements execute, and attempts to execute any other requests against this transaction (including reads and queries) will be rejected.

Setting this option may cause some error reporting to be deferred until commit time (e.g. validation of unique constraints). Given this, successful execution of statements should not be assumed until a subsequent Commit call completes successfully.

Returns:

  • (::Boolean)

    Optional. If set to true, this request marks the end of the transaction. The transaction should be committed or aborted after these statements execute, and attempts to execute any other requests against this transaction (including reads and queries) will be rejected.

    Setting this option may cause some error reporting to be deferred until commit time (e.g. validation of unique constraints). Given this, successful execution of statements should not be assumed until a subsequent Commit call completes successfully.



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'proto_docs/google/spanner/v1/spanner.rb', line 574

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

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

Returns Common options for this request.

Returns:



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'proto_docs/google/spanner/v1/spanner.rb', line 574

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.



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'proto_docs/google/spanner/v1/spanner.rb', line 574

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.



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'proto_docs/google/spanner/v1/spanner.rb', line 574

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.



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'proto_docs/google/spanner/v1/spanner.rb', line 574

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.



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'proto_docs/google/spanner/v1/spanner.rb', line 574

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