google-cloud-spanner 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/lib/google-cloud-spanner.rb +13 -0
  4. data/lib/google/cloud/spanner.rb +2 -1
  5. data/lib/google/cloud/spanner/admin/database.rb +3 -2
  6. data/lib/google/cloud/spanner/admin/database/v1.rb +3 -2
  7. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +742 -20
  8. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client_config.json +40 -0
  9. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/field_mask.rb +222 -0
  10. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/timestamp.rb +113 -0
  11. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/backup.rb +325 -0
  12. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +197 -30
  13. data/lib/google/cloud/spanner/admin/instance.rb +1 -1
  14. data/lib/google/cloud/spanner/admin/instance/v1.rb +1 -1
  15. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +6 -13
  16. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +8 -5
  17. data/lib/google/cloud/spanner/batch_client.rb +5 -3
  18. data/lib/google/cloud/spanner/batch_snapshot.rb +43 -8
  19. data/lib/google/cloud/spanner/client.rb +57 -8
  20. data/lib/google/cloud/spanner/project.rb +31 -6
  21. data/lib/google/cloud/spanner/results.rb +4 -2
  22. data/lib/google/cloud/spanner/service.rb +3 -1
  23. data/lib/google/cloud/spanner/session.rb +37 -6
  24. data/lib/google/cloud/spanner/snapshot.rb +26 -3
  25. data/lib/google/cloud/spanner/transaction.rb +49 -5
  26. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +8 -1
  27. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +91 -102
  28. data/lib/google/cloud/spanner/v1/spanner_client.rb +112 -136
  29. data/lib/google/cloud/spanner/version.rb +1 -1
  30. data/lib/google/spanner/admin/database/v1/backup_pb.rb +98 -0
  31. data/lib/google/spanner/admin/database/v1/common_pb.rb +28 -0
  32. data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +53 -0
  33. data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +82 -12
  34. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +1 -2
  35. data/lib/google/spanner/v1/spanner_pb.rb +5 -0
  36. data/lib/google/spanner/v1/spanner_services_pb.rb +31 -40
  37. metadata +7 -2
@@ -189,6 +189,9 @@ module Google
189
189
  google_api_client.freeze
190
190
 
191
191
  headers = { :"x-goog-api-client" => google_api_client }
192
+ if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
193
+ headers[:"x-goog-user-project"] = credentials.quota_project_id
194
+ end
192
195
  headers.merge!(metadata) unless metadata.nil?
193
196
  client_config_file = Pathname.new(__dir__).join(
194
197
  "spanner_client_config.json"
@@ -358,7 +361,7 @@ module Google
358
361
  #
359
362
  # Active sessions use additional server resources, so it is a good idea to
360
363
  # delete idle and unneeded sessions.
361
- # Aside from explicit deletes, Cloud Spanner can delete sessions for which no
364
+ # Aside from explicit deletes, Cloud Spanner may delete sessions for which no
362
365
  # operations are sent for more than an hour. If a session is deleted,
363
366
  # requests to it return `NOT_FOUND`.
364
367
  #
@@ -411,8 +414,7 @@ module Google
411
414
  # The API may return fewer than the requested number of sessions. If a
412
415
  # specific number of sessions are desired, the client can make additional
413
416
  # calls to BatchCreateSessions (adjusting
414
- # {Google::Spanner::V1::BatchCreateSessionsRequest#session_count session_count}
415
- # as necessary).
417
+ # {Google::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} as necessary).
416
418
  # @param session_template [Google::Spanner::V1::Session | Hash]
417
419
  # Parameters to be applied to each created session.
418
420
  # A hash of the same form as `Google::Spanner::V1::Session`
@@ -588,12 +590,10 @@ module Google
588
590
  #
589
591
  # Operations inside read-write transactions might return `ABORTED`. If
590
592
  # this occurs, the application should restart the transaction from
591
- # the beginning. See {Google::Spanner::V1::Transaction Transaction} for more
592
- # details.
593
+ # the beginning. See {Google::Spanner::V1::Transaction Transaction} for more details.
593
594
  #
594
595
  # Larger result sets can be fetched in streaming fashion by calling
595
- # {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql}
596
- # instead.
596
+ # {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql} instead.
597
597
  #
598
598
  # @param session [String]
599
599
  # Required. The session in which the SQL query should be performed.
@@ -630,8 +630,7 @@ module Google
630
630
  # @param param_types [Hash{String => Google::Spanner::V1::Type | Hash}]
631
631
  # It is not always possible for Cloud Spanner to infer the right SQL type
632
632
  # from a JSON value. For example, values of type `BYTES` and values
633
- # of type `STRING` both appear in
634
- # {Google::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings.
633
+ # of type `STRING` both appear in {Google::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings.
635
634
  #
636
635
  # In these cases, `param_types` can be used to specify the exact
637
636
  # SQL type for some or all of the SQL statement parameters. See the
@@ -642,17 +641,14 @@ module Google
642
641
  # @param resume_token [String]
643
642
  # If this request is resuming a previously interrupted SQL statement
644
643
  # execution, `resume_token` should be copied from the last
645
- # {Google::Spanner::V1::PartialResultSet PartialResultSet} yielded before the
646
- # interruption. Doing this enables the new SQL statement execution to resume
647
- # where the last one left off. The rest of the request parameters must
648
- # exactly match the request that yielded this token.
644
+ # {Google::Spanner::V1::PartialResultSet PartialResultSet} yielded before the interruption. Doing this
645
+ # enables the new SQL statement execution to resume where the last one left
646
+ # off. The rest of the request parameters must exactly match the
647
+ # request that yielded this token.
649
648
  # @param query_mode [Google::Spanner::V1::ExecuteSqlRequest::QueryMode]
650
649
  # Used to control the amount of debugging information returned in
651
- # {Google::Spanner::V1::ResultSetStats ResultSetStats}. If
652
- # {Google::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is
653
- # set, {Google::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only
654
- # be set to
655
- # {Google::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode::NORMAL}.
650
+ # {Google::Spanner::V1::ResultSetStats ResultSetStats}. If {Google::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is set, {Google::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only
651
+ # be set to {Google::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode::NORMAL}.
656
652
  # @param partition_token [String]
657
653
  # If present, results will be restricted to the specified partition
658
654
  # previously created using PartitionQuery(). There must be an exact
@@ -669,6 +665,10 @@ module Google
669
665
  # handled requests will yield the same response as the first execution.
670
666
  #
671
667
  # Required for DML statements. Ignored for queries.
668
+ # @param query_options [Google::Spanner::V1::ExecuteSqlRequest::QueryOptions | Hash]
669
+ # Query optimizer configuration to use for the given query.
670
+ # A hash of the same form as `Google::Spanner::V1::ExecuteSqlRequest::QueryOptions`
671
+ # can also be provided.
672
672
  # @param options [Google::Gax::CallOptions]
673
673
  # Overrides the default settings for this call, e.g, timeout,
674
674
  # retries, etc.
@@ -697,6 +697,7 @@ module Google
697
697
  query_mode: nil,
698
698
  partition_token: nil,
699
699
  seqno: nil,
700
+ query_options: nil,
700
701
  options: nil,
701
702
  &block
702
703
  req = {
@@ -708,17 +709,18 @@ module Google
708
709
  resume_token: resume_token,
709
710
  query_mode: query_mode,
710
711
  partition_token: partition_token,
711
- seqno: seqno
712
+ seqno: seqno,
713
+ query_options: query_options
712
714
  }.delete_if { |_, v| v.nil? }
713
715
  req = Google::Gax::to_proto(req, Google::Spanner::V1::ExecuteSqlRequest)
714
716
  @execute_sql.call(req, options, &block)
715
717
  end
716
718
 
717
- # Like {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}, except returns the
718
- # result set as a stream. Unlike
719
- # {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}, there is no limit on
720
- # the size of the returned result set. However, no individual row in the
721
- # result set can exceed 100 MiB, and no column value can exceed 10 MiB.
719
+ # Like {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}, except returns the result
720
+ # set as a stream. Unlike {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}, there
721
+ # is no limit on the size of the returned result set. However, no
722
+ # individual row in the result set can exceed 100 MiB, and no
723
+ # column value can exceed 10 MiB.
722
724
  #
723
725
  # @param session [String]
724
726
  # Required. The session in which the SQL query should be performed.
@@ -755,8 +757,7 @@ module Google
755
757
  # @param param_types [Hash{String => Google::Spanner::V1::Type | Hash}]
756
758
  # It is not always possible for Cloud Spanner to infer the right SQL type
757
759
  # from a JSON value. For example, values of type `BYTES` and values
758
- # of type `STRING` both appear in
759
- # {Google::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings.
760
+ # of type `STRING` both appear in {Google::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings.
760
761
  #
761
762
  # In these cases, `param_types` can be used to specify the exact
762
763
  # SQL type for some or all of the SQL statement parameters. See the
@@ -767,17 +768,14 @@ module Google
767
768
  # @param resume_token [String]
768
769
  # If this request is resuming a previously interrupted SQL statement
769
770
  # execution, `resume_token` should be copied from the last
770
- # {Google::Spanner::V1::PartialResultSet PartialResultSet} yielded before the
771
- # interruption. Doing this enables the new SQL statement execution to resume
772
- # where the last one left off. The rest of the request parameters must
773
- # exactly match the request that yielded this token.
771
+ # {Google::Spanner::V1::PartialResultSet PartialResultSet} yielded before the interruption. Doing this
772
+ # enables the new SQL statement execution to resume where the last one left
773
+ # off. The rest of the request parameters must exactly match the
774
+ # request that yielded this token.
774
775
  # @param query_mode [Google::Spanner::V1::ExecuteSqlRequest::QueryMode]
775
776
  # Used to control the amount of debugging information returned in
776
- # {Google::Spanner::V1::ResultSetStats ResultSetStats}. If
777
- # {Google::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is
778
- # set, {Google::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only
779
- # be set to
780
- # {Google::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode::NORMAL}.
777
+ # {Google::Spanner::V1::ResultSetStats ResultSetStats}. If {Google::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is set, {Google::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only
778
+ # be set to {Google::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode::NORMAL}.
781
779
  # @param partition_token [String]
782
780
  # If present, results will be restricted to the specified partition
783
781
  # previously created using PartitionQuery(). There must be an exact
@@ -794,6 +792,10 @@ module Google
794
792
  # handled requests will yield the same response as the first execution.
795
793
  #
796
794
  # Required for DML statements. Ignored for queries.
795
+ # @param query_options [Google::Spanner::V1::ExecuteSqlRequest::QueryOptions | Hash]
796
+ # Query optimizer configuration to use for the given query.
797
+ # A hash of the same form as `Google::Spanner::V1::ExecuteSqlRequest::QueryOptions`
798
+ # can also be provided.
797
799
  # @param options [Google::Gax::CallOptions]
798
800
  # Overrides the default settings for this call, e.g, timeout,
799
801
  # retries, etc.
@@ -823,6 +825,7 @@ module Google
823
825
  query_mode: nil,
824
826
  partition_token: nil,
825
827
  seqno: nil,
828
+ query_options: nil,
826
829
  options: nil
827
830
  req = {
828
831
  session: session,
@@ -833,7 +836,8 @@ module Google
833
836
  resume_token: resume_token,
834
837
  query_mode: query_mode,
835
838
  partition_token: partition_token,
836
- seqno: seqno
839
+ seqno: seqno,
840
+ query_options: query_options
837
841
  }.delete_if { |_, v| v.nil? }
838
842
  req = Google::Gax::to_proto(req, Google::Spanner::V1::ExecuteSqlRequest)
839
843
  @execute_streaming_sql.call(req, options)
@@ -844,10 +848,9 @@ module Google
844
848
  # {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}.
845
849
  #
846
850
  # Statements are executed in sequential order. A request can succeed even if
847
- # a statement fails. The
848
- # {Google::Spanner::V1::ExecuteBatchDmlResponse#status ExecuteBatchDmlResponse#status}
849
- # field in the response provides information about the statement that failed.
850
- # Clients must inspect this field to determine whether an error occurred.
851
+ # a statement fails. The {Google::Spanner::V1::ExecuteBatchDmlResponse#status ExecuteBatchDmlResponse#status} field in the
852
+ # response provides information about the statement that failed. Clients must
853
+ # inspect this field to determine whether an error occurred.
851
854
  #
852
855
  # Execution stops after the first failed statement; the remaining statements
853
856
  # are not executed.
@@ -863,18 +866,18 @@ module Google
863
866
  # A hash of the same form as `Google::Spanner::V1::TransactionSelector`
864
867
  # can also be provided.
865
868
  # @param statements [Array<Google::Spanner::V1::ExecuteBatchDmlRequest::Statement | Hash>]
866
- # Required. The list of statements to execute in this batch. Statements are
867
- # executed serially, such that the effects of statement `i` are visible to
868
- # statement `i+1`. Each statement must be a DML statement. Execution stops at
869
- # the first failed statement; the remaining statements are not executed.
869
+ # Required. The list of statements to execute in this batch. Statements are executed
870
+ # serially, such that the effects of statement `i` are visible to statement
871
+ # `i+1`. Each statement must be a DML statement. Execution stops at the
872
+ # first failed statement; the remaining statements are not executed.
870
873
  #
871
874
  # Callers must provide at least one statement.
872
875
  # A hash of the same form as `Google::Spanner::V1::ExecuteBatchDmlRequest::Statement`
873
876
  # can also be provided.
874
877
  # @param seqno [Integer]
875
- # Required. A per-transaction sequence number used to identify this request.
876
- # This field makes each request idempotent such that if the request is
877
- # received multiple times, at most one will succeed.
878
+ # Required. A per-transaction sequence number used to identify this request. This field
879
+ # makes each request idempotent such that if the request is received multiple
880
+ # times, at most one will succeed.
878
881
  #
879
882
  # The sequence number must be monotonically increasing within the
880
883
  # transaction. If a request arrives for the first time with an out-of-order
@@ -923,15 +926,14 @@ module Google
923
926
 
924
927
  # Reads rows from the database using key lookups and scans, as a
925
928
  # simple key/value style alternative to
926
- # {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}. This method cannot be
927
- # used to return a result set larger than 10 MiB; if the read matches more
929
+ # {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql}. This method cannot be used to
930
+ # return a result set larger than 10 MiB; if the read matches more
928
931
  # data than that, the read fails with a `FAILED_PRECONDITION`
929
932
  # error.
930
933
  #
931
934
  # Reads inside read-write transactions might return `ABORTED`. If
932
935
  # this occurs, the application should restart the transaction from
933
- # the beginning. See {Google::Spanner::V1::Transaction Transaction} for more
934
- # details.
936
+ # the beginning. See {Google::Spanner::V1::Transaction Transaction} for more details.
935
937
  #
936
938
  # Larger result sets can be yielded in streaming fashion by calling
937
939
  # {Google::Spanner::V1::Spanner::StreamingRead StreamingRead} instead.
@@ -941,22 +943,18 @@ module Google
941
943
  # @param table [String]
942
944
  # Required. The name of the table in the database to be read.
943
945
  # @param columns [Array<String>]
944
- # Required. The columns of {Google::Spanner::V1::ReadRequest#table table} to be
945
- # returned for each row matching this request.
946
+ # Required. The columns of {Google::Spanner::V1::ReadRequest#table table} to be returned for each row matching
947
+ # this request.
946
948
  # @param key_set [Google::Spanner::V1::KeySet | Hash]
947
949
  # Required. `key_set` identifies the rows to be yielded. `key_set` names the
948
- # primary keys of the rows in {Google::Spanner::V1::ReadRequest#table table} to
949
- # be yielded, unless {Google::Spanner::V1::ReadRequest#index index} is present.
950
- # If {Google::Spanner::V1::ReadRequest#index index} is present, then
951
- # {Google::Spanner::V1::ReadRequest#key_set key_set} instead names index keys
952
- # in {Google::Spanner::V1::ReadRequest#index index}.
953
- #
954
- # If the {Google::Spanner::V1::ReadRequest#partition_token partition_token}
955
- # field is empty, rows are yielded in table primary key order (if
956
- # {Google::Spanner::V1::ReadRequest#index index} is empty) or index key order
957
- # (if {Google::Spanner::V1::ReadRequest#index index} is non-empty). If the
958
- # {Google::Spanner::V1::ReadRequest#partition_token partition_token} field is
959
- # not empty, rows will be yielded in an unspecified order.
950
+ # primary keys of the rows in {Google::Spanner::V1::ReadRequest#table table} to be yielded, unless {Google::Spanner::V1::ReadRequest#index index}
951
+ # is present. If {Google::Spanner::V1::ReadRequest#index index} is present, then {Google::Spanner::V1::ReadRequest#key_set key_set} instead names
952
+ # index keys in {Google::Spanner::V1::ReadRequest#index index}.
953
+ #
954
+ # If the {Google::Spanner::V1::ReadRequest#partition_token partition_token} field is empty, rows are yielded
955
+ # in table primary key order (if {Google::Spanner::V1::ReadRequest#index index} is empty) or index key order
956
+ # (if {Google::Spanner::V1::ReadRequest#index index} is non-empty). If the {Google::Spanner::V1::ReadRequest#partition_token partition_token} field is not
957
+ # empty, rows will be yielded in an unspecified order.
960
958
  #
961
959
  # It is not an error for the `key_set` to name rows that do not
962
960
  # exist in the database. Read yields nothing for nonexistent rows.
@@ -968,12 +966,9 @@ module Google
968
966
  # A hash of the same form as `Google::Spanner::V1::TransactionSelector`
969
967
  # can also be provided.
970
968
  # @param index [String]
971
- # If non-empty, the name of an index on
972
- # {Google::Spanner::V1::ReadRequest#table table}. This index is used instead of
973
- # the table primary key when interpreting
974
- # {Google::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows.
975
- # See {Google::Spanner::V1::ReadRequest#key_set key_set} for further
976
- # information.
969
+ # If non-empty, the name of an index on {Google::Spanner::V1::ReadRequest#table table}. This index is
970
+ # used instead of the table primary key when interpreting {Google::Spanner::V1::ReadRequest#key_set key_set}
971
+ # and sorting result rows. See {Google::Spanner::V1::ReadRequest#key_set key_set} for further information.
977
972
  # @param limit [Integer]
978
973
  # If greater than zero, only the first `limit` rows are yielded. If `limit`
979
974
  # is zero, the default is no limit. A limit cannot be specified if
@@ -981,9 +976,9 @@ module Google
981
976
  # @param resume_token [String]
982
977
  # If this request is resuming a previously interrupted read,
983
978
  # `resume_token` should be copied from the last
984
- # {Google::Spanner::V1::PartialResultSet PartialResultSet} yielded before the
985
- # interruption. Doing this enables the new read to resume where the last read
986
- # left off. The rest of the request parameters must exactly match the request
979
+ # {Google::Spanner::V1::PartialResultSet PartialResultSet} yielded before the interruption. Doing this
980
+ # enables the new read to resume where the last read left off. The
981
+ # rest of the request parameters must exactly match the request
987
982
  # that yielded this token.
988
983
  # @param partition_token [String]
989
984
  # If present, results will be restricted to the specified partition
@@ -1041,9 +1036,9 @@ module Google
1041
1036
  @read.call(req, options, &block)
1042
1037
  end
1043
1038
 
1044
- # Like {Google::Spanner::V1::Spanner::Read Read}, except returns the result set
1045
- # as a stream. Unlike {Google::Spanner::V1::Spanner::Read Read}, there is no
1046
- # limit on the size of the returned result set. However, no individual row in
1039
+ # Like {Google::Spanner::V1::Spanner::Read Read}, except returns the result set as a
1040
+ # stream. Unlike {Google::Spanner::V1::Spanner::Read Read}, there is no limit on the
1041
+ # size of the returned result set. However, no individual row in
1047
1042
  # the result set can exceed 100 MiB, and no column value can exceed
1048
1043
  # 10 MiB.
1049
1044
  #
@@ -1052,22 +1047,18 @@ module Google
1052
1047
  # @param table [String]
1053
1048
  # Required. The name of the table in the database to be read.
1054
1049
  # @param columns [Array<String>]
1055
- # Required. The columns of {Google::Spanner::V1::ReadRequest#table table} to be
1056
- # returned for each row matching this request.
1050
+ # Required. The columns of {Google::Spanner::V1::ReadRequest#table table} to be returned for each row matching
1051
+ # this request.
1057
1052
  # @param key_set [Google::Spanner::V1::KeySet | Hash]
1058
1053
  # Required. `key_set` identifies the rows to be yielded. `key_set` names the
1059
- # primary keys of the rows in {Google::Spanner::V1::ReadRequest#table table} to
1060
- # be yielded, unless {Google::Spanner::V1::ReadRequest#index index} is present.
1061
- # If {Google::Spanner::V1::ReadRequest#index index} is present, then
1062
- # {Google::Spanner::V1::ReadRequest#key_set key_set} instead names index keys
1063
- # in {Google::Spanner::V1::ReadRequest#index index}.
1064
- #
1065
- # If the {Google::Spanner::V1::ReadRequest#partition_token partition_token}
1066
- # field is empty, rows are yielded in table primary key order (if
1067
- # {Google::Spanner::V1::ReadRequest#index index} is empty) or index key order
1068
- # (if {Google::Spanner::V1::ReadRequest#index index} is non-empty). If the
1069
- # {Google::Spanner::V1::ReadRequest#partition_token partition_token} field is
1070
- # not empty, rows will be yielded in an unspecified order.
1054
+ # primary keys of the rows in {Google::Spanner::V1::ReadRequest#table table} to be yielded, unless {Google::Spanner::V1::ReadRequest#index index}
1055
+ # is present. If {Google::Spanner::V1::ReadRequest#index index} is present, then {Google::Spanner::V1::ReadRequest#key_set key_set} instead names
1056
+ # index keys in {Google::Spanner::V1::ReadRequest#index index}.
1057
+ #
1058
+ # If the {Google::Spanner::V1::ReadRequest#partition_token partition_token} field is empty, rows are yielded
1059
+ # in table primary key order (if {Google::Spanner::V1::ReadRequest#index index} is empty) or index key order
1060
+ # (if {Google::Spanner::V1::ReadRequest#index index} is non-empty). If the {Google::Spanner::V1::ReadRequest#partition_token partition_token} field is not
1061
+ # empty, rows will be yielded in an unspecified order.
1071
1062
  #
1072
1063
  # It is not an error for the `key_set` to name rows that do not
1073
1064
  # exist in the database. Read yields nothing for nonexistent rows.
@@ -1079,12 +1070,9 @@ module Google
1079
1070
  # A hash of the same form as `Google::Spanner::V1::TransactionSelector`
1080
1071
  # can also be provided.
1081
1072
  # @param index [String]
1082
- # If non-empty, the name of an index on
1083
- # {Google::Spanner::V1::ReadRequest#table table}. This index is used instead of
1084
- # the table primary key when interpreting
1085
- # {Google::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows.
1086
- # See {Google::Spanner::V1::ReadRequest#key_set key_set} for further
1087
- # information.
1073
+ # If non-empty, the name of an index on {Google::Spanner::V1::ReadRequest#table table}. This index is
1074
+ # used instead of the table primary key when interpreting {Google::Spanner::V1::ReadRequest#key_set key_set}
1075
+ # and sorting result rows. See {Google::Spanner::V1::ReadRequest#key_set key_set} for further information.
1088
1076
  # @param limit [Integer]
1089
1077
  # If greater than zero, only the first `limit` rows are yielded. If `limit`
1090
1078
  # is zero, the default is no limit. A limit cannot be specified if
@@ -1092,9 +1080,9 @@ module Google
1092
1080
  # @param resume_token [String]
1093
1081
  # If this request is resuming a previously interrupted read,
1094
1082
  # `resume_token` should be copied from the last
1095
- # {Google::Spanner::V1::PartialResultSet PartialResultSet} yielded before the
1096
- # interruption. Doing this enables the new read to resume where the last read
1097
- # left off. The rest of the request parameters must exactly match the request
1083
+ # {Google::Spanner::V1::PartialResultSet PartialResultSet} yielded before the interruption. Doing this
1084
+ # enables the new read to resume where the last read left off. The
1085
+ # rest of the request parameters must exactly match the request
1098
1086
  # that yielded this token.
1099
1087
  # @param partition_token [String]
1100
1088
  # If present, results will be restricted to the specified partition
@@ -1153,8 +1141,7 @@ module Google
1153
1141
  end
1154
1142
 
1155
1143
  # Begins a new transaction. This step can often be skipped:
1156
- # {Google::Spanner::V1::Spanner::Read Read},
1157
- # {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql} and
1144
+ # {Google::Spanner::V1::Spanner::Read Read}, {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql} and
1158
1145
  # {Google::Spanner::V1::Spanner::Commit Commit} can begin a new transaction as a
1159
1146
  # side-effect.
1160
1147
  #
@@ -1263,9 +1250,8 @@ module Google
1263
1250
 
1264
1251
  # Rolls back a transaction, releasing any locks it holds. It is a good
1265
1252
  # idea to call this for any transaction that includes one or more
1266
- # {Google::Spanner::V1::Spanner::Read Read} or
1267
- # {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql} requests and ultimately
1268
- # decides not to commit.
1253
+ # {Google::Spanner::V1::Spanner::Read Read} or {Google::Spanner::V1::Spanner::ExecuteSql ExecuteSql} requests and
1254
+ # ultimately decides not to commit.
1269
1255
  #
1270
1256
  # `Rollback` returns `OK` if it successfully aborts the transaction, the
1271
1257
  # transaction was already aborted, or the transaction is not
@@ -1308,11 +1294,10 @@ module Google
1308
1294
 
1309
1295
  # Creates a set of partition tokens that can be used to execute a query
1310
1296
  # operation in parallel. Each of the returned partition tokens can be used
1311
- # by {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql} to
1312
- # specify a subset of the query result to read. The same session and
1313
- # read-only transaction must be used by the PartitionQueryRequest used to
1314
- # create the partition tokens and the ExecuteSqlRequests that use the
1315
- # partition tokens.
1297
+ # by {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql} to specify a subset
1298
+ # of the query result to read. The same session and read-only transaction
1299
+ # must be used by the PartitionQueryRequest used to create the
1300
+ # partition tokens and the ExecuteSqlRequests that use the partition tokens.
1316
1301
  #
1317
1302
  # Partition tokens become invalid when the session used to create them
1318
1303
  # is deleted, is idle for too long, begins a new transaction, or becomes too
@@ -1322,16 +1307,15 @@ module Google
1322
1307
  # @param session [String]
1323
1308
  # Required. The session used to create the partitions.
1324
1309
  # @param sql [String]
1325
- # Required. The query request to generate partitions for. The request will
1326
- # fail if the query is not root partitionable. The query plan of a root
1310
+ # Required. The query request to generate partitions for. The request will fail if
1311
+ # the query is not root partitionable. The query plan of a root
1327
1312
  # partitionable query has a single distributed union operator. A distributed
1328
1313
  # union operator conceptually divides one or more tables into multiple
1329
1314
  # splits, remotely evaluates a subquery independently on each split, and
1330
1315
  # then unions all results.
1331
1316
  #
1332
1317
  # This must not contain DML commands, such as INSERT, UPDATE, or
1333
- # DELETE. Use
1334
- # {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql} with a
1318
+ # DELETE. Use {Google::Spanner::V1::Spanner::ExecuteStreamingSql ExecuteStreamingSql} with a
1335
1319
  # PartitionedDml transaction for large, partition-friendly DML operations.
1336
1320
  # @param transaction [Google::Spanner::V1::TransactionSelector | Hash]
1337
1321
  # Read only snapshot transactions are supported, read/write and single use
@@ -1356,8 +1340,7 @@ module Google
1356
1340
  # @param param_types [Hash{String => Google::Spanner::V1::Type | Hash}]
1357
1341
  # It is not always possible for Cloud Spanner to infer the right SQL type
1358
1342
  # from a JSON value. For example, values of type `BYTES` and values
1359
- # of type `STRING` both appear in
1360
- # {Google::Spanner::V1::PartitionQueryRequest#params params} as JSON strings.
1343
+ # of type `STRING` both appear in {Google::Spanner::V1::PartitionQueryRequest#params params} as JSON strings.
1361
1344
  #
1362
1345
  # In these cases, `param_types` can be used to specify the exact
1363
1346
  # SQL type for some or all of the SQL query parameters. See the
@@ -1410,13 +1393,12 @@ module Google
1410
1393
 
1411
1394
  # Creates a set of partition tokens that can be used to execute a read
1412
1395
  # operation in parallel. Each of the returned partition tokens can be used
1413
- # by {Google::Spanner::V1::Spanner::StreamingRead StreamingRead} to specify a
1414
- # subset of the read result to read. The same session and read-only
1415
- # transaction must be used by the PartitionReadRequest used to create the
1416
- # partition tokens and the ReadRequests that use the partition tokens. There
1417
- # are no ordering guarantees on rows returned among the returned partition
1418
- # tokens, or even within each individual StreamingRead call issued with a
1419
- # partition_token.
1396
+ # by {Google::Spanner::V1::Spanner::StreamingRead StreamingRead} to specify a subset of the read
1397
+ # result to read. The same session and read-only transaction must be used by
1398
+ # the PartitionReadRequest used to create the partition tokens and the
1399
+ # ReadRequests that use the partition tokens. There are no ordering
1400
+ # guarantees on rows returned among the returned partition tokens, or even
1401
+ # within each individual StreamingRead call issued with a partition_token.
1420
1402
  #
1421
1403
  # Partition tokens become invalid when the session used to create them
1422
1404
  # is deleted, is idle for too long, begins a new transaction, or becomes too
@@ -1429,11 +1411,8 @@ module Google
1429
1411
  # Required. The name of the table in the database to be read.
1430
1412
  # @param key_set [Google::Spanner::V1::KeySet | Hash]
1431
1413
  # Required. `key_set` identifies the rows to be yielded. `key_set` names the
1432
- # primary keys of the rows in
1433
- # {Google::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless
1434
- # {Google::Spanner::V1::PartitionReadRequest#index index} is present. If
1435
- # {Google::Spanner::V1::PartitionReadRequest#index index} is present, then
1436
- # {Google::Spanner::V1::PartitionReadRequest#key_set key_set} instead names
1414
+ # primary keys of the rows in {Google::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless {Google::Spanner::V1::PartitionReadRequest#index index}
1415
+ # is present. If {Google::Spanner::V1::PartitionReadRequest#index index} is present, then {Google::Spanner::V1::PartitionReadRequest#key_set key_set} instead names
1437
1416
  # index keys in {Google::Spanner::V1::PartitionReadRequest#index index}.
1438
1417
  #
1439
1418
  # It is not an error for the `key_set` to name rows that do not
@@ -1446,15 +1425,12 @@ module Google
1446
1425
  # A hash of the same form as `Google::Spanner::V1::TransactionSelector`
1447
1426
  # can also be provided.
1448
1427
  # @param index [String]
1449
- # If non-empty, the name of an index on
1450
- # {Google::Spanner::V1::PartitionReadRequest#table table}. This index is used
1451
- # instead of the table primary key when interpreting
1452
- # {Google::Spanner::V1::PartitionReadRequest#key_set key_set} and sorting
1453
- # result rows. See {Google::Spanner::V1::PartitionReadRequest#key_set key_set}
1454
- # for further information.
1428
+ # If non-empty, the name of an index on {Google::Spanner::V1::PartitionReadRequest#table table}. This index is
1429
+ # used instead of the table primary key when interpreting {Google::Spanner::V1::PartitionReadRequest#key_set key_set}
1430
+ # and sorting result rows. See {Google::Spanner::V1::PartitionReadRequest#key_set key_set} for further information.
1455
1431
  # @param columns [Array<String>]
1456
- # The columns of {Google::Spanner::V1::PartitionReadRequest#table table} to be
1457
- # returned for each row matching this request.
1432
+ # The columns of {Google::Spanner::V1::PartitionReadRequest#table table} to be returned for each row matching
1433
+ # this request.
1458
1434
  # @param partition_options [Google::Spanner::V1::PartitionOptions | Hash]
1459
1435
  # Additional options that affect how many partitions are created.
1460
1436
  # A hash of the same form as `Google::Spanner::V1::PartitionOptions`