google-cloud-spanner-v1 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a274c4e1d09a3122c37193aca7a73d498e2e8a7493583b880dc327c4a8561abd
4
- data.tar.gz: c5bec182d4e02eb05dc64d2042030ff2e0b282557fe62eb464b4f83a01ae4be8
3
+ metadata.gz: bb64f1bfd5d93cb49f610834908694139c4540d7aa6b012f06b609524aec2a90
4
+ data.tar.gz: '029130cb8fb140fee2322db3e98ac213c60d675910911f076d83dfb5fbc45b7e'
5
5
  SHA512:
6
- metadata.gz: e698b60a077b905df8d71fc9e0add9efcf5039d186780c5ff5f645bb23f873a62d7f21cfc9b243ce48255089bc3120d3b4c83d687a84252c9c50f2bc60404b7c
7
- data.tar.gz: 806caae37da3d1d7f556567b5f2fab0dcfe0c4c699b2a1d9364816589aed039168c0c73845c96b2c475abd806d7975a57866e8df67e14c30299c0386110ea345
6
+ metadata.gz: 5a2326c249ef795ee99a06efe95142203c3cbadd446828b0242f803cd4760f9d347c17059e416a5547e04b441da70d7260e455231ecd1950a81ad4bb479a2166
7
+ data.tar.gz: bc1af7e8c96a743d38ce177adc96cffc1940d55bd90b3a4ef632388285425ba23d39a7f4d5cc2d8c5e78626f3cb8c5c3cbd48911019960ec8a9bc736822150ad
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Cloud Spanner V1 API
2
+ --title="Cloud Spanner V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::Spanner::V1::CreateSessionRequest.new # (request fiel
37
37
  response = client.create_session request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-spanner-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/spanner)
@@ -265,6 +265,21 @@ module Google
265
265
  #
266
266
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
267
267
  #
268
+ # @example Basic example
269
+ # require "google/cloud/spanner/v1"
270
+ #
271
+ # # Create a client object. The client can be reused for multiple calls.
272
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
273
+ #
274
+ # # Create a request. To set request fields, pass in keyword arguments.
275
+ # request = Google::Cloud::Spanner::V1::CreateSessionRequest.new
276
+ #
277
+ # # Call the create_session method.
278
+ # result = client.create_session request
279
+ #
280
+ # # The returned object is of type Google::Cloud::Spanner::V1::Session.
281
+ # p result
282
+ #
268
283
  def create_session request, options = nil
269
284
  raise ::ArgumentError, "request must be provided" if request.nil?
270
285
 
@@ -282,9 +297,11 @@ module Google
282
297
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
283
298
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
284
299
 
285
- header_params = {
286
- "database" => request.database
287
- }
300
+ header_params = {}
301
+ if request.database
302
+ header_params["database"] = request.database
303
+ end
304
+
288
305
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
289
306
  metadata[:"x-goog-request-params"] ||= request_params_header
290
307
 
@@ -344,6 +361,21 @@ module Google
344
361
  #
345
362
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
346
363
  #
364
+ # @example Basic example
365
+ # require "google/cloud/spanner/v1"
366
+ #
367
+ # # Create a client object. The client can be reused for multiple calls.
368
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
369
+ #
370
+ # # Create a request. To set request fields, pass in keyword arguments.
371
+ # request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new
372
+ #
373
+ # # Call the batch_create_sessions method.
374
+ # result = client.batch_create_sessions request
375
+ #
376
+ # # The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.
377
+ # p result
378
+ #
347
379
  def batch_create_sessions request, options = nil
348
380
  raise ::ArgumentError, "request must be provided" if request.nil?
349
381
 
@@ -361,9 +393,11 @@ module Google
361
393
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
362
394
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
363
395
 
364
- header_params = {
365
- "database" => request.database
366
- }
396
+ header_params = {}
397
+ if request.database
398
+ header_params["database"] = request.database
399
+ end
400
+
367
401
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
368
402
  metadata[:"x-goog-request-params"] ||= request_params_header
369
403
 
@@ -414,6 +448,21 @@ module Google
414
448
  #
415
449
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
416
450
  #
451
+ # @example Basic example
452
+ # require "google/cloud/spanner/v1"
453
+ #
454
+ # # Create a client object. The client can be reused for multiple calls.
455
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
456
+ #
457
+ # # Create a request. To set request fields, pass in keyword arguments.
458
+ # request = Google::Cloud::Spanner::V1::GetSessionRequest.new
459
+ #
460
+ # # Call the get_session method.
461
+ # result = client.get_session request
462
+ #
463
+ # # The returned object is of type Google::Cloud::Spanner::V1::Session.
464
+ # p result
465
+ #
417
466
  def get_session request, options = nil
418
467
  raise ::ArgumentError, "request must be provided" if request.nil?
419
468
 
@@ -431,9 +480,11 @@ module Google
431
480
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
432
481
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
433
482
 
434
- header_params = {
435
- "name" => request.name
436
- }
483
+ header_params = {}
484
+ if request.name
485
+ header_params["name"] = request.name
486
+ end
487
+
437
488
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
438
489
  metadata[:"x-goog-request-params"] ||= request_params_header
439
490
 
@@ -500,6 +551,27 @@ module Google
500
551
  #
501
552
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
502
553
  #
554
+ # @example Basic example
555
+ # require "google/cloud/spanner/v1"
556
+ #
557
+ # # Create a client object. The client can be reused for multiple calls.
558
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
559
+ #
560
+ # # Create a request. To set request fields, pass in keyword arguments.
561
+ # request = Google::Cloud::Spanner::V1::ListSessionsRequest.new
562
+ #
563
+ # # Call the list_sessions method.
564
+ # result = client.list_sessions request
565
+ #
566
+ # # The returned object is of type Gapic::PagedEnumerable. You can
567
+ # # iterate over all elements by calling #each, and the enumerable
568
+ # # will lazily make API calls to fetch subsequent pages. Other
569
+ # # methods are also available for managing paging directly.
570
+ # result.each do |response|
571
+ # # Each element is of type ::Google::Cloud::Spanner::V1::Session.
572
+ # p response
573
+ # end
574
+ #
503
575
  def list_sessions request, options = nil
504
576
  raise ::ArgumentError, "request must be provided" if request.nil?
505
577
 
@@ -517,9 +589,11 @@ module Google
517
589
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
518
590
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
519
591
 
520
- header_params = {
521
- "database" => request.database
522
- }
592
+ header_params = {}
593
+ if request.database
594
+ header_params["database"] = request.database
595
+ end
596
+
523
597
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
524
598
  metadata[:"x-goog-request-params"] ||= request_params_header
525
599
 
@@ -571,6 +645,21 @@ module Google
571
645
  #
572
646
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
573
647
  #
648
+ # @example Basic example
649
+ # require "google/cloud/spanner/v1"
650
+ #
651
+ # # Create a client object. The client can be reused for multiple calls.
652
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
653
+ #
654
+ # # Create a request. To set request fields, pass in keyword arguments.
655
+ # request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new
656
+ #
657
+ # # Call the delete_session method.
658
+ # result = client.delete_session request
659
+ #
660
+ # # The returned object is of type Google::Protobuf::Empty.
661
+ # p result
662
+ #
574
663
  def delete_session request, options = nil
575
664
  raise ::ArgumentError, "request must be provided" if request.nil?
576
665
 
@@ -588,9 +677,11 @@ module Google
588
677
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
589
678
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
590
679
 
591
- header_params = {
592
- "name" => request.name
593
- }
680
+ header_params = {}
681
+ if request.name
682
+ header_params["name"] = request.name
683
+ end
684
+
594
685
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
595
686
  metadata[:"x-goog-request-params"] ||= request_params_header
596
687
 
@@ -716,6 +807,21 @@ module Google
716
807
  #
717
808
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
718
809
  #
810
+ # @example Basic example
811
+ # require "google/cloud/spanner/v1"
812
+ #
813
+ # # Create a client object. The client can be reused for multiple calls.
814
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
815
+ #
816
+ # # Create a request. To set request fields, pass in keyword arguments.
817
+ # request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new
818
+ #
819
+ # # Call the execute_sql method.
820
+ # result = client.execute_sql request
821
+ #
822
+ # # The returned object is of type Google::Cloud::Spanner::V1::ResultSet.
823
+ # p result
824
+ #
719
825
  def execute_sql request, options = nil
720
826
  raise ::ArgumentError, "request must be provided" if request.nil?
721
827
 
@@ -733,9 +839,11 @@ module Google
733
839
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
734
840
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
735
841
 
736
- header_params = {
737
- "session" => request.session
738
- }
842
+ header_params = {}
843
+ if request.session
844
+ header_params["session"] = request.session
845
+ end
846
+
739
847
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
740
848
  metadata[:"x-goog-request-params"] ||= request_params_header
741
849
 
@@ -855,6 +963,24 @@ module Google
855
963
  #
856
964
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
857
965
  #
966
+ # @example Basic example
967
+ # require "google/cloud/spanner/v1"
968
+ #
969
+ # # Create a client object. The client can be reused for multiple calls.
970
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
971
+ #
972
+ # # Create a request. To set request fields, pass in keyword arguments.
973
+ # request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new
974
+ #
975
+ # # Call the execute_streaming_sql method.
976
+ # result = client.execute_streaming_sql request
977
+ #
978
+ # # The returned object is a streamed enumerable yielding elements of
979
+ # # type ::Google::Cloud::Spanner::V1::PartialResultSet.
980
+ # result.each do |response|
981
+ # p response
982
+ # end
983
+ #
858
984
  def execute_streaming_sql request, options = nil
859
985
  raise ::ArgumentError, "request must be provided" if request.nil?
860
986
 
@@ -872,9 +998,11 @@ module Google
872
998
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
873
999
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
874
1000
 
875
- header_params = {
876
- "session" => request.session
877
- }
1001
+ header_params = {}
1002
+ if request.session
1003
+ header_params["session"] = request.session
1004
+ end
1005
+
878
1006
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
879
1007
  metadata[:"x-goog-request-params"] ||= request_params_header
880
1008
 
@@ -957,6 +1085,21 @@ module Google
957
1085
  #
958
1086
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
959
1087
  #
1088
+ # @example Basic example
1089
+ # require "google/cloud/spanner/v1"
1090
+ #
1091
+ # # Create a client object. The client can be reused for multiple calls.
1092
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
1093
+ #
1094
+ # # Create a request. To set request fields, pass in keyword arguments.
1095
+ # request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new
1096
+ #
1097
+ # # Call the execute_batch_dml method.
1098
+ # result = client.execute_batch_dml request
1099
+ #
1100
+ # # The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse.
1101
+ # p result
1102
+ #
960
1103
  def execute_batch_dml request, options = nil
961
1104
  raise ::ArgumentError, "request must be provided" if request.nil?
962
1105
 
@@ -974,9 +1117,11 @@ module Google
974
1117
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
975
1118
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
976
1119
 
977
- header_params = {
978
- "session" => request.session
979
- }
1120
+ header_params = {}
1121
+ if request.session
1122
+ header_params["session"] = request.session
1123
+ end
1124
+
980
1125
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
981
1126
  metadata[:"x-goog-request-params"] ||= request_params_header
982
1127
 
@@ -1080,6 +1225,21 @@ module Google
1080
1225
  #
1081
1226
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1082
1227
  #
1228
+ # @example Basic example
1229
+ # require "google/cloud/spanner/v1"
1230
+ #
1231
+ # # Create a client object. The client can be reused for multiple calls.
1232
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
1233
+ #
1234
+ # # Create a request. To set request fields, pass in keyword arguments.
1235
+ # request = Google::Cloud::Spanner::V1::ReadRequest.new
1236
+ #
1237
+ # # Call the read method.
1238
+ # result = client.read request
1239
+ #
1240
+ # # The returned object is of type Google::Cloud::Spanner::V1::ResultSet.
1241
+ # p result
1242
+ #
1083
1243
  def read request, options = nil
1084
1244
  raise ::ArgumentError, "request must be provided" if request.nil?
1085
1245
 
@@ -1097,9 +1257,11 @@ module Google
1097
1257
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
1098
1258
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1099
1259
 
1100
- header_params = {
1101
- "session" => request.session
1102
- }
1260
+ header_params = {}
1261
+ if request.session
1262
+ header_params["session"] = request.session
1263
+ end
1264
+
1103
1265
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1104
1266
  metadata[:"x-goog-request-params"] ||= request_params_header
1105
1267
 
@@ -1195,6 +1357,24 @@ module Google
1195
1357
  #
1196
1358
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1197
1359
  #
1360
+ # @example Basic example
1361
+ # require "google/cloud/spanner/v1"
1362
+ #
1363
+ # # Create a client object. The client can be reused for multiple calls.
1364
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
1365
+ #
1366
+ # # Create a request. To set request fields, pass in keyword arguments.
1367
+ # request = Google::Cloud::Spanner::V1::ReadRequest.new
1368
+ #
1369
+ # # Call the streaming_read method.
1370
+ # result = client.streaming_read request
1371
+ #
1372
+ # # The returned object is a streamed enumerable yielding elements of
1373
+ # # type ::Google::Cloud::Spanner::V1::PartialResultSet.
1374
+ # result.each do |response|
1375
+ # p response
1376
+ # end
1377
+ #
1198
1378
  def streaming_read request, options = nil
1199
1379
  raise ::ArgumentError, "request must be provided" if request.nil?
1200
1380
 
@@ -1212,9 +1392,11 @@ module Google
1212
1392
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
1213
1393
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1214
1394
 
1215
- header_params = {
1216
- "session" => request.session
1217
- }
1395
+ header_params = {}
1396
+ if request.session
1397
+ header_params["session"] = request.session
1398
+ end
1399
+
1218
1400
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1219
1401
  metadata[:"x-goog-request-params"] ||= request_params_header
1220
1402
 
@@ -1274,6 +1456,21 @@ module Google
1274
1456
  #
1275
1457
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1276
1458
  #
1459
+ # @example Basic example
1460
+ # require "google/cloud/spanner/v1"
1461
+ #
1462
+ # # Create a client object. The client can be reused for multiple calls.
1463
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
1464
+ #
1465
+ # # Create a request. To set request fields, pass in keyword arguments.
1466
+ # request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new
1467
+ #
1468
+ # # Call the begin_transaction method.
1469
+ # result = client.begin_transaction request
1470
+ #
1471
+ # # The returned object is of type Google::Cloud::Spanner::V1::Transaction.
1472
+ # p result
1473
+ #
1277
1474
  def begin_transaction request, options = nil
1278
1475
  raise ::ArgumentError, "request must be provided" if request.nil?
1279
1476
 
@@ -1291,9 +1488,11 @@ module Google
1291
1488
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
1292
1489
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1293
1490
 
1294
- header_params = {
1295
- "session" => request.session
1296
- }
1491
+ header_params = {}
1492
+ if request.session
1493
+ header_params["session"] = request.session
1494
+ end
1495
+
1297
1496
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1298
1497
  metadata[:"x-goog-request-params"] ||= request_params_header
1299
1498
 
@@ -1377,6 +1576,21 @@ module Google
1377
1576
  #
1378
1577
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1379
1578
  #
1579
+ # @example Basic example
1580
+ # require "google/cloud/spanner/v1"
1581
+ #
1582
+ # # Create a client object. The client can be reused for multiple calls.
1583
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
1584
+ #
1585
+ # # Create a request. To set request fields, pass in keyword arguments.
1586
+ # request = Google::Cloud::Spanner::V1::CommitRequest.new
1587
+ #
1588
+ # # Call the commit method.
1589
+ # result = client.commit request
1590
+ #
1591
+ # # The returned object is of type Google::Cloud::Spanner::V1::CommitResponse.
1592
+ # p result
1593
+ #
1380
1594
  def commit request, options = nil
1381
1595
  raise ::ArgumentError, "request must be provided" if request.nil?
1382
1596
 
@@ -1394,9 +1608,11 @@ module Google
1394
1608
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
1395
1609
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1396
1610
 
1397
- header_params = {
1398
- "session" => request.session
1399
- }
1611
+ header_params = {}
1612
+ if request.session
1613
+ header_params["session"] = request.session
1614
+ end
1615
+
1400
1616
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1401
1617
  metadata[:"x-goog-request-params"] ||= request_params_header
1402
1618
 
@@ -1454,6 +1670,21 @@ module Google
1454
1670
  #
1455
1671
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1456
1672
  #
1673
+ # @example Basic example
1674
+ # require "google/cloud/spanner/v1"
1675
+ #
1676
+ # # Create a client object. The client can be reused for multiple calls.
1677
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
1678
+ #
1679
+ # # Create a request. To set request fields, pass in keyword arguments.
1680
+ # request = Google::Cloud::Spanner::V1::RollbackRequest.new
1681
+ #
1682
+ # # Call the rollback method.
1683
+ # result = client.rollback request
1684
+ #
1685
+ # # The returned object is of type Google::Protobuf::Empty.
1686
+ # p result
1687
+ #
1457
1688
  def rollback request, options = nil
1458
1689
  raise ::ArgumentError, "request must be provided" if request.nil?
1459
1690
 
@@ -1471,9 +1702,11 @@ module Google
1471
1702
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
1472
1703
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1473
1704
 
1474
- header_params = {
1475
- "session" => request.session
1476
- }
1705
+ header_params = {}
1706
+ if request.session
1707
+ header_params["session"] = request.session
1708
+ end
1709
+
1477
1710
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1478
1711
  metadata[:"x-goog-request-params"] ||= request_params_header
1479
1712
 
@@ -1570,6 +1803,21 @@ module Google
1570
1803
  #
1571
1804
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1572
1805
  #
1806
+ # @example Basic example
1807
+ # require "google/cloud/spanner/v1"
1808
+ #
1809
+ # # Create a client object. The client can be reused for multiple calls.
1810
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
1811
+ #
1812
+ # # Create a request. To set request fields, pass in keyword arguments.
1813
+ # request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new
1814
+ #
1815
+ # # Call the partition_query method.
1816
+ # result = client.partition_query request
1817
+ #
1818
+ # # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse.
1819
+ # p result
1820
+ #
1573
1821
  def partition_query request, options = nil
1574
1822
  raise ::ArgumentError, "request must be provided" if request.nil?
1575
1823
 
@@ -1587,9 +1835,11 @@ module Google
1587
1835
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
1588
1836
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1589
1837
 
1590
- header_params = {
1591
- "session" => request.session
1592
- }
1838
+ header_params = {}
1839
+ if request.session
1840
+ header_params["session"] = request.session
1841
+ end
1842
+
1593
1843
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1594
1844
  metadata[:"x-goog-request-params"] ||= request_params_header
1595
1845
 
@@ -1672,6 +1922,21 @@ module Google
1672
1922
  #
1673
1923
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1674
1924
  #
1925
+ # @example Basic example
1926
+ # require "google/cloud/spanner/v1"
1927
+ #
1928
+ # # Create a client object. The client can be reused for multiple calls.
1929
+ # client = Google::Cloud::Spanner::V1::Spanner::Client.new
1930
+ #
1931
+ # # Create a request. To set request fields, pass in keyword arguments.
1932
+ # request = Google::Cloud::Spanner::V1::PartitionReadRequest.new
1933
+ #
1934
+ # # Call the partition_read method.
1935
+ # result = client.partition_read request
1936
+ #
1937
+ # # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse.
1938
+ # p result
1939
+ #
1675
1940
  def partition_read request, options = nil
1676
1941
  raise ::ArgumentError, "request must be provided" if request.nil?
1677
1942
 
@@ -1689,9 +1954,11 @@ module Google
1689
1954
  gapic_version: ::Google::Cloud::Spanner::V1::VERSION
1690
1955
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1691
1956
 
1692
- header_params = {
1693
- "session" => request.session
1694
- }
1957
+ header_params = {}
1958
+ if request.session
1959
+ header_params["session"] = request.session
1960
+ end
1961
+
1695
1962
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1696
1963
  metadata[:"x-goog-request-params"] ||= request_params_header
1697
1964
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Spanner
23
23
  module V1
24
- VERSION = "0.7.2"
24
+ VERSION = "0.8.0"
25
25
  end
26
26
  end
27
27
  end
@@ -1,11 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/commit_response.proto
3
3
 
4
- require 'google/protobuf'
5
-
4
+ require 'google/api/annotations_pb'
6
5
  require 'google/protobuf/duration_pb'
7
6
  require 'google/protobuf/timestamp_pb'
8
- require 'google/api/annotations_pb'
7
+ require 'google/protobuf'
8
+
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/spanner/v1/commit_response.proto", :syntax => :proto3) do
11
11
  add_message "google.spanner.v1.CommitResponse" do
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/keys.proto
3
3
 
4
+ require 'google/api/annotations_pb'
5
+ require 'google/protobuf/struct_pb'
4
6
  require 'google/protobuf'
5
7
 
6
- require 'google/protobuf/struct_pb'
7
- require 'google/api/annotations_pb'
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/spanner/v1/keys.proto", :syntax => :proto3) do
10
10
  add_message "google.spanner.v1.KeyRange" do
@@ -1,11 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/mutation.proto
3
3
 
4
- require 'google/protobuf'
5
-
4
+ require 'google/api/annotations_pb'
6
5
  require 'google/protobuf/struct_pb'
7
6
  require 'google/spanner/v1/keys_pb'
8
- require 'google/api/annotations_pb'
7
+ require 'google/protobuf'
8
+
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/spanner/v1/mutation.proto", :syntax => :proto3) do
11
11
  add_message "google.spanner.v1.Mutation" do
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/query_plan.proto
3
3
 
4
+ require 'google/api/annotations_pb'
5
+ require 'google/protobuf/struct_pb'
4
6
  require 'google/protobuf'
5
7
 
6
- require 'google/protobuf/struct_pb'
7
- require 'google/api/annotations_pb'
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/spanner/v1/query_plan.proto", :syntax => :proto3) do
10
10
  add_message "google.spanner.v1.PlanNode" do
@@ -1,13 +1,14 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/result_set.proto
3
3
 
4
- require 'google/protobuf'
5
-
4
+ require 'google/api/annotations_pb'
6
5
  require 'google/protobuf/struct_pb'
6
+ require 'google/spanner/v1/commit_response_pb'
7
7
  require 'google/spanner/v1/query_plan_pb'
8
8
  require 'google/spanner/v1/transaction_pb'
9
9
  require 'google/spanner/v1/type_pb'
10
- require 'google/api/annotations_pb'
10
+ require 'google/protobuf'
11
+
11
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
13
  add_file("google/spanner/v1/result_set.proto", :syntax => :proto3) do
13
14
  add_message "google.spanner.v1.ResultSet" do
@@ -1,9 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/spanner.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
- require 'google/spanner/v1/commit_response_pb'
7
4
  require 'google/api/annotations_pb'
8
5
  require 'google/api/client_pb'
9
6
  require 'google/api/field_behavior_pb'
@@ -12,11 +9,14 @@ require 'google/protobuf/empty_pb'
12
9
  require 'google/protobuf/struct_pb'
13
10
  require 'google/protobuf/timestamp_pb'
14
11
  require 'google/rpc/status_pb'
12
+ require 'google/spanner/v1/commit_response_pb'
15
13
  require 'google/spanner/v1/keys_pb'
16
14
  require 'google/spanner/v1/mutation_pb'
17
15
  require 'google/spanner/v1/result_set_pb'
18
16
  require 'google/spanner/v1/transaction_pb'
19
17
  require 'google/spanner/v1/type_pb'
18
+ require 'google/protobuf'
19
+
20
20
  Google::Protobuf::DescriptorPool.generated_pool.build do
21
21
  add_file("google/spanner/v1/spanner.proto", :syntax => :proto3) do
22
22
  add_message "google.spanner.v1.CreateSessionRequest" do
@@ -30,7 +30,7 @@ module Google
30
30
  # transactions on data stored in Cloud Spanner databases.
31
31
  class Service
32
32
 
33
- include GRPC::GenericService
33
+ include ::GRPC::GenericService
34
34
 
35
35
  self.marshal_class_method = :encode
36
36
  self.unmarshal_class_method = :decode
@@ -1,11 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/transaction.proto
3
3
 
4
- require 'google/protobuf'
5
-
4
+ require 'google/api/annotations_pb'
6
5
  require 'google/protobuf/duration_pb'
7
6
  require 'google/protobuf/timestamp_pb'
8
- require 'google/api/annotations_pb'
7
+ require 'google/protobuf'
8
+
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/spanner/v1/transaction.proto", :syntax => :proto3) do
11
11
  add_message "google.spanner.v1.TransactionOptions" do
@@ -1,16 +1,17 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/spanner/v1/type.proto
3
3
 
4
+ require 'google/api/annotations_pb'
5
+ require 'google/api/field_behavior_pb'
4
6
  require 'google/protobuf'
5
7
 
6
- require 'google/api/field_behavior_pb'
7
- require 'google/api/annotations_pb'
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/spanner/v1/type.proto", :syntax => :proto3) do
10
10
  add_message "google.spanner.v1.Type" do
11
11
  optional :code, :enum, 1, "google.spanner.v1.TypeCode"
12
12
  optional :array_element_type, :message, 2, "google.spanner.v1.Type"
13
13
  optional :struct_type, :message, 3, "google.spanner.v1.StructType"
14
+ optional :type_annotation, :enum, 4, "google.spanner.v1.TypeAnnotationCode"
14
15
  end
15
16
  add_message "google.spanner.v1.StructType" do
16
17
  repeated :fields, :message, 1, "google.spanner.v1.StructType.Field"
@@ -33,6 +34,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
33
34
  value :NUMERIC, 10
34
35
  value :JSON, 11
35
36
  end
37
+ add_enum "google.spanner.v1.TypeAnnotationCode" do
38
+ value :TYPE_ANNOTATION_CODE_UNSPECIFIED, 0
39
+ value :PG_NUMERIC, 2
40
+ end
36
41
  end
37
42
  end
38
43
 
@@ -44,6 +49,7 @@ module Google
44
49
  StructType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType").msgclass
45
50
  StructType::Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType.Field").msgclass
46
51
  TypeCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeCode").enummodule
52
+ TypeAnnotationCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeAnnotationCode").enummodule
47
53
  end
48
54
  end
49
55
  end
@@ -33,11 +33,7 @@ module Google
33
33
  # // For Kubernetes resources, the format is {api group}/{kind}.
34
34
  # option (google.api.resource) = {
35
35
  # type: "pubsub.googleapis.com/Topic"
36
- # name_descriptor: {
37
- # pattern: "projects/{project}/topics/{topic}"
38
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
- # parent_name_extractor: "projects/{project}"
40
- # }
36
+ # pattern: "projects/{project}/topics/{topic}"
41
37
  # };
42
38
  # }
43
39
  #
@@ -45,10 +41,7 @@ module Google
45
41
  #
46
42
  # resources:
47
43
  # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/{project}/topics/{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/{project}"
44
+ # pattern: "projects/{project}/topics/{topic}"
52
45
  #
53
46
  # Sometimes, resources have multiple patterns, typically because they can
54
47
  # live under multiple parents.
@@ -58,26 +51,10 @@ module Google
58
51
  # message LogEntry {
59
52
  # option (google.api.resource) = {
60
53
  # type: "logging.googleapis.com/LogEntry"
61
- # name_descriptor: {
62
- # pattern: "projects/{project}/logs/{log}"
63
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
- # parent_name_extractor: "projects/{project}"
65
- # }
66
- # name_descriptor: {
67
- # pattern: "folders/{folder}/logs/{log}"
68
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
- # parent_name_extractor: "folders/{folder}"
70
- # }
71
- # name_descriptor: {
72
- # pattern: "organizations/{organization}/logs/{log}"
73
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
- # parent_name_extractor: "organizations/{organization}"
75
- # }
76
- # name_descriptor: {
77
- # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
- # parent_type: "billing.googleapis.com/BillingAccount"
79
- # parent_name_extractor: "billingAccounts/{billing_account}"
80
- # }
54
+ # pattern: "projects/{project}/logs/{log}"
55
+ # pattern: "folders/{folder}/logs/{log}"
56
+ # pattern: "organizations/{organization}/logs/{log}"
57
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
81
58
  # };
82
59
  # }
83
60
  #
@@ -85,48 +62,10 @@ module Google
85
62
  #
86
63
  # resources:
87
64
  # - type: 'logging.googleapis.com/LogEntry'
88
- # name_descriptor:
89
- # - pattern: "projects/{project}/logs/{log}"
90
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
- # parent_name_extractor: "projects/{project}"
92
- # - pattern: "folders/{folder}/logs/{log}"
93
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
- # parent_name_extractor: "folders/{folder}"
95
- # - pattern: "organizations/{organization}/logs/{log}"
96
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
- # parent_name_extractor: "organizations/{organization}"
98
- # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
- # parent_type: "billing.googleapis.com/BillingAccount"
100
- # parent_name_extractor: "billingAccounts/{billing_account}"
101
- #
102
- # For flexible resources, the resource name doesn't contain parent names, but
103
- # the resource itself has parents for policy evaluation.
104
- #
105
- # Example:
106
- #
107
- # message Shelf {
108
- # option (google.api.resource) = {
109
- # type: "library.googleapis.com/Shelf"
110
- # name_descriptor: {
111
- # pattern: "shelves/{shelf}"
112
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
- # }
114
- # name_descriptor: {
115
- # pattern: "shelves/{shelf}"
116
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
- # }
118
- # };
119
- # }
120
- #
121
- # The ResourceDescriptor Yaml config will look like:
122
- #
123
- # resources:
124
- # - type: 'library.googleapis.com/Shelf'
125
- # name_descriptor:
126
- # - pattern: "shelves/{shelf}"
127
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
- # - pattern: "shelves/{shelf}"
129
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
65
+ # pattern: "projects/{project}/logs/{log}"
66
+ # pattern: "folders/{folder}/logs/{log}"
67
+ # pattern: "organizations/{organization}/logs/{log}"
68
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
130
69
  # @!attribute [rw] type
131
70
  # @return [::String]
132
71
  # The resource type. It must be in the format of
@@ -41,9 +41,9 @@ module Google
41
41
  # `mutation_count` value can help you maximize the number of mutations
42
42
  # in a transaction and minimize the number of API round trips. You can
43
43
  # also monitor this value to prevent transactions from exceeding the system
44
- # [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
44
+ # [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
45
45
  # If the number of mutations exceeds the limit, the server returns
46
- # [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
46
+ # [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
47
47
  class CommitStats
48
48
  include ::Google::Protobuf::MessageExts
49
49
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -174,6 +174,7 @@ module Google
174
174
  # Legal characters for `request_tag` values are all printable characters
175
175
  # (ASCII 32 - 126) and the length of a request_tag is limited to 50
176
176
  # characters. Values that exceed this limit are truncated.
177
+ # Any leading underscore (_) characters will be removed from the string.
177
178
  # @!attribute [rw] transaction_tag
178
179
  # @return [::String]
179
180
  # A tag used for statistics collection about this transaction.
@@ -181,11 +182,12 @@ module Google
181
182
  # that belongs to a transaction.
182
183
  # The value of transaction_tag should be the same for all requests belonging
183
184
  # to the same transaction.
184
- # If this request doesnt belong to any transaction, transaction_tag will be
185
+ # If this request doesn't belong to any transaction, transaction_tag will be
185
186
  # ignored.
186
187
  # Legal characters for `transaction_tag` values are all printable characters
187
188
  # (ASCII 32 - 126) and the length of a transaction_tag is limited to 50
188
189
  # characters. Values that exceed this limit are truncated.
190
+ # Any leading underscore (_) characters will be removed from the string.
189
191
  class RequestOptions
190
192
  include ::Google::Protobuf::MessageExts
191
193
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -21,8 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Spanner
23
23
  module V1
24
- # # Transactions
25
- #
24
+ # Transactions:
26
25
  #
27
26
  # Each session can have at most one active transaction at a time (note that
28
27
  # standalone reads and queries use a transaction internally and do count
@@ -30,8 +29,7 @@ module Google
30
29
  # completed, the session can immediately be re-used for the next transaction.
31
30
  # It is not necessary to create a new session for each transaction.
32
31
  #
33
- # # Transaction Modes
34
- #
32
+ # Transaction Modes:
35
33
  # Cloud Spanner supports three transaction modes:
36
34
  #
37
35
  # 1. Locking read-write. This type of transaction is the only way
@@ -63,8 +61,7 @@ module Google
63
61
  # may, however, read/write data in different tables within that
64
62
  # database.
65
63
  #
66
- # ## Locking Read-Write Transactions
67
- #
64
+ # Locking Read-Write Transactions:
68
65
  # Locking transactions may be used to atomically read-modify-write
69
66
  # data anywhere in a database. This type of transaction is externally
70
67
  # consistent.
@@ -86,8 +83,7 @@ module Google
86
83
  # {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback} request to abort the
87
84
  # transaction.
88
85
  #
89
- # ## Semantics
90
- #
86
+ # Semantics:
91
87
  # Cloud Spanner can commit the transaction if all read locks it acquired
92
88
  # are still valid at commit time, and it is able to acquire write
93
89
  # locks for all writes. Cloud Spanner can abort the transaction for any
@@ -99,8 +95,7 @@ module Google
99
95
  # use Cloud Spanner locks for any sort of mutual exclusion other than
100
96
  # between Cloud Spanner transactions themselves.
101
97
  #
102
- # ## Retrying Aborted Transactions
103
- #
98
+ # Retrying Aborted Transactions:
104
99
  # When a transaction aborts, the application can choose to retry the
105
100
  # whole transaction again. To maximize the chances of successfully
106
101
  # committing the retry, the client should execute the retry in the
@@ -108,27 +103,25 @@ module Google
108
103
  # priority increases with each consecutive abort, meaning that each
109
104
  # attempt has a slightly better chance of success than the previous.
110
105
  #
111
- # Under some circumstances (e.g., many transactions attempting to
106
+ # Under some circumstances (for example, many transactions attempting to
112
107
  # modify the same row(s)), a transaction can abort many times in a
113
108
  # short period before successfully committing. Thus, it is not a good
114
109
  # idea to cap the number of retries a transaction can attempt;
115
- # instead, it is better to limit the total amount of wall time spent
110
+ # instead, it is better to limit the total amount of time spent
116
111
  # retrying.
117
112
  #
118
- # ## Idle Transactions
119
- #
113
+ # Idle Transactions:
120
114
  # A transaction is considered idle if it has no outstanding reads or
121
115
  # SQL queries and has not started a read or SQL query within the last 10
122
116
  # seconds. Idle transactions can be aborted by Cloud Spanner so that they
123
- # don't hold on to locks indefinitely. In that case, the commit will
124
- # fail with error `ABORTED`.
117
+ # don't hold on to locks indefinitely. If an idle transaction is aborted, the
118
+ # commit will fail with error `ABORTED`.
125
119
  #
126
120
  # If this behavior is undesirable, periodically executing a simple
127
- # SQL query in the transaction (e.g., `SELECT 1`) prevents the
121
+ # SQL query in the transaction (for example, `SELECT 1`) prevents the
128
122
  # transaction from becoming idle.
129
123
  #
130
- # ## Snapshot Read-Only Transactions
131
- #
124
+ # Snapshot Read-Only Transactions:
132
125
  # Snapshot read-only transactions provides a simpler method than
133
126
  # locking read-write transactions for doing several consistent
134
127
  # reads. However, this type of transaction does not support writes.
@@ -165,8 +158,7 @@ module Google
165
158
  #
166
159
  # Each type of timestamp bound is discussed in detail below.
167
160
  #
168
- # ## Strong
169
- #
161
+ # Strong:
170
162
  # Strong reads are guaranteed to see the effects of all transactions
171
163
  # that have committed before the start of the read. Furthermore, all
172
164
  # rows yielded by a single read are consistent with each other -- if
@@ -181,13 +173,12 @@ module Google
181
173
  #
182
174
  # See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#strong TransactionOptions.ReadOnly.strong}.
183
175
  #
184
- # ## Exact Staleness
185
- #
176
+ # Exact Staleness:
186
177
  # These timestamp bounds execute reads at a user-specified
187
178
  # timestamp. Reads at a timestamp are guaranteed to see a consistent
188
179
  # prefix of the global transaction history: they observe
189
- # modifications done by all transactions with a commit timestamp <=
190
- # the read timestamp, and observe none of the modifications done by
180
+ # modifications done by all transactions with a commit timestamp less than or
181
+ # equal to the read timestamp, and observe none of the modifications done by
191
182
  # transactions with a larger commit timestamp. They will block until
192
183
  # all conflicting transactions that may be assigned commit timestamps
193
184
  # <= the read timestamp have finished.
@@ -203,8 +194,7 @@ module Google
203
194
  # See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#read_timestamp TransactionOptions.ReadOnly.read_timestamp} and
204
195
  # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#exact_staleness TransactionOptions.ReadOnly.exact_staleness}.
205
196
  #
206
- # ## Bounded Staleness
207
- #
197
+ # Bounded Staleness:
208
198
  # Bounded staleness modes allow Cloud Spanner to pick the read timestamp,
209
199
  # subject to a user-provided staleness bound. Cloud Spanner chooses the
210
200
  # newest timestamp within the staleness bound that allows execution
@@ -233,8 +223,7 @@ module Google
233
223
  # See {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#max_staleness TransactionOptions.ReadOnly.max_staleness} and
234
224
  # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#min_read_timestamp TransactionOptions.ReadOnly.min_read_timestamp}.
235
225
  #
236
- # ## Old Read Timestamps and Garbage Collection
237
- #
226
+ # Old Read Timestamps and Garbage Collection:
238
227
  # Cloud Spanner continuously garbage collects deleted and overwritten data
239
228
  # in the background to reclaim storage space. This process is known
240
229
  # as "version GC". By default, version GC reclaims versions after they
@@ -244,8 +233,7 @@ module Google
244
233
  # timestamp become too old while executing. Reads and SQL queries with
245
234
  # too-old read timestamps fail with the error `FAILED_PRECONDITION`.
246
235
  #
247
- # ## Partitioned DML Transactions
248
- #
236
+ # Partitioned DML Transactions:
249
237
  # Partitioned DML transactions are used to execute DML statements with a
250
238
  # different execution strategy that provides different, and often better,
251
239
  # scalability properties for large, table-wide operations than DML in a
@@ -34,6 +34,14 @@ module Google
34
34
  # @return [::Google::Cloud::Spanner::V1::StructType]
35
35
  # If {::Google::Cloud::Spanner::V1::Type#code code} == {::Google::Cloud::Spanner::V1::TypeCode::STRUCT STRUCT}, then `struct_type`
36
36
  # provides type information for the struct's fields.
37
+ # @!attribute [rw] type_annotation
38
+ # @return [::Google::Cloud::Spanner::V1::TypeAnnotationCode]
39
+ # The {::Google::Cloud::Spanner::V1::TypeAnnotationCode TypeAnnotationCode} that disambiguates SQL type that Spanner will
40
+ # use to represent values of this type during query processing. This is
41
+ # necessary for some type codes because a single {::Google::Cloud::Spanner::V1::TypeCode TypeCode} can be mapped
42
+ # to different SQL types depending on the SQL dialect. {::Google::Cloud::Spanner::V1::Type#type_annotation type_annotation}
43
+ # typically is not needed to process the content of a value (it doesn't
44
+ # affect serialization) and clients can ignore it on the read path.
37
45
  class Type
38
46
  include ::Google::Protobuf::MessageExts
39
47
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -132,15 +140,34 @@ module Google
132
140
  # <br>(ExponentIndicator is `"e"` or `"E"`)
133
141
  NUMERIC = 10
134
142
 
135
- # Encoded as a JSON-formatted 'string' as described in RFC 7159. The
136
- # following rules will be applied when parsing JSON input:
137
- # - Whitespace will be stripped from the document.
138
- # - If a JSON object has duplicate keys, only the first key will be
139
- # preserved.
143
+ # Encoded as a JSON-formatted `string` as described in RFC 7159. The
144
+ # following rules are applied when parsing JSON input:
145
+ #
146
+ # - Whitespace characters are not preserved.
147
+ # - If a JSON object has duplicate keys, only the first key is preserved.
140
148
  # - Members of a JSON object are not guaranteed to have their order
141
- # preserved. JSON array elements will have their order preserved.
149
+ # preserved.
150
+ # - JSON array elements will have their order preserved.
142
151
  JSON = 11
143
152
  end
153
+
154
+ # `TypeAnnotationCode` is used as a part of {::Google::Cloud::Spanner::V1::Type Type} to
155
+ # disambiguate SQL types that should be used for a given Cloud Spanner value.
156
+ # Disambiguation is needed because the same Cloud Spanner type can be mapped to
157
+ # different SQL types depending on SQL dialect. TypeAnnotationCode doesn't
158
+ # affect the way value is serialized.
159
+ module TypeAnnotationCode
160
+ # Not specified.
161
+ TYPE_ANNOTATION_CODE_UNSPECIFIED = 0
162
+
163
+ # PostgreSQL compatible NUMERIC type. This annotation needs to be applied to
164
+ # {::Google::Cloud::Spanner::V1::Type Type} instances having {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC}
165
+ # type code to specify that values of this type should be treated as
166
+ # PostgreSQL NUMERIC values. Currently this annotation is always needed for
167
+ # {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC} when a client interacts with PostgreSQL-enabled
168
+ # Spanner databases.
169
+ PG_NUMERIC = 2
170
+ end
144
171
  end
145
172
  end
146
173
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-spanner-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2022-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  requirements: []
224
- rubygems_version: 3.2.17
224
+ rubygems_version: 3.3.5
225
225
  signing_key:
226
226
  specification_version: 4
227
227
  summary: API Client library for the Cloud Spanner V1 API