google-cloud-spanner-v1 1.3.0 → 1.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e4a957fb99ebd8f100929c7323de595d0dabe0bf5752d6cb9b76c209db8233d
4
- data.tar.gz: 67f77e4fa5a7fb8af5253dc8100b8b31ef38aa610ff0b5ac9edd36e201001677
3
+ metadata.gz: fbc12b0558397742935801d9b6e189c54ff8efbd334c65d4d4672bf3583cf043
4
+ data.tar.gz: 2ed9608ca002304c2fe835a6705510c04f8b1872285be6f85156ed4cf971a461
5
5
  SHA512:
6
- metadata.gz: fa70947d97763c9cb6a59431d7746d16d784abfe283d463e56e2416815a7685028e0c72107bb975f4b408b61f42b663b552cb5cd3c353bb12a2e7f96a2c45a79
7
- data.tar.gz: e72338bcf69f74a1b00104a35cc8d4d375ebe5b3bcb08a23afd7c3616e2dce4fffaafe29042c859140832542fa47bac56d197491543a93543f804a392debfcd1
6
+ metadata.gz: 7d64d91e68a4af41028083a53566f4e517f62d158d176de5d579c0b296ff8f731ba421f07f236cd2e245b9a4a59f0f4f598190dadc2e53254ecc0d4f15849c3b
7
+ data.tar.gz: ceb43a4790b7f0f2fc11a41f962559d98b4ca8e9814da0c141cdf5a01412fb9dfbff1938cdff3be510286e7a25e6d52d95d5b1504a89f9c934ca6e0cb378a7a4
data/README.md CHANGED
@@ -42,33 +42,43 @@ for class and method documentation.
42
42
  See also the [Product Documentation](https://cloud.google.com/spanner)
43
43
  for general usage information.
44
44
 
45
- ## Enabling Logging
46
-
47
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
48
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
49
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
50
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
51
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
52
-
53
- Configuring a Ruby stdlib logger:
45
+ ## Debug Logging
46
+
47
+ This library comes with opt-in Debug Logging that can help you troubleshoot
48
+ your application's integration with the API. When logging is activated, key
49
+ events such as requests and responses, along with data payloads and metadata
50
+ such as headers and client configuration, are logged to the standard error
51
+ stream.
52
+
53
+ **WARNING:** Client Library Debug Logging includes your data payloads in
54
+ plaintext, which could include sensitive data such as PII for yourself or your
55
+ customers, private keys, or other security data that could be compromising if
56
+ leaked. Always practice good data hygiene with your application logs, and follow
57
+ the principle of least access. Google also recommends that Client Library Debug
58
+ Logging be enabled only temporarily during active debugging, and not used
59
+ permanently in production.
60
+
61
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
62
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
63
+ list of client library gem names. This will select the default logging behavior,
64
+ which writes logs to the standard error stream. On a local workstation, this may
65
+ result in logs appearing on the console. When running on a Google Cloud hosting
66
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
67
+ results in logs appearing alongside your application logs in the
68
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
69
+
70
+ You can customize logging by modifying the `logger` configuration when
71
+ constructing a client object. For example:
54
72
 
55
73
  ```ruby
74
+ require "google/cloud/spanner/v1"
56
75
  require "logger"
57
76
 
58
- module MyLogger
59
- LOGGER = Logger.new $stderr, level: Logger::WARN
60
- def logger
61
- LOGGER
62
- end
63
- end
64
-
65
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
66
- module GRPC
67
- extend MyLogger
77
+ client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config|
78
+ config.logger = Logger.new "my-app.log"
68
79
  end
69
80
  ```
70
81
 
71
-
72
82
  ## Google Cloud Samples
73
83
 
74
84
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -231,8 +231,28 @@ module Google
231
231
  universe_domain: @config.universe_domain,
232
232
  channel_args: @config.channel_args,
233
233
  interceptors: @config.interceptors,
234
- channel_pool_config: @config.channel_pool
234
+ channel_pool_config: @config.channel_pool,
235
+ logger: @config.logger
235
236
  )
237
+
238
+ @spanner_stub.stub_logger&.info do |entry|
239
+ entry.set_system_name
240
+ entry.set_service
241
+ entry.message = "Created client for #{entry.service}"
242
+ entry.set_credentials_fields credentials
243
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
244
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
245
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
246
+ end
247
+ end
248
+
249
+ ##
250
+ # The logger used for request/response debug logging.
251
+ #
252
+ # @return [Logger]
253
+ #
254
+ def logger
255
+ @spanner_stub.logger
236
256
  end
237
257
 
238
258
  # Service calls
@@ -337,7 +357,6 @@ module Google
337
357
 
338
358
  @spanner_stub.call_rpc :create_session, request, options: options do |response, operation|
339
359
  yield response, operation if block_given?
340
- return response
341
360
  end
342
361
  rescue ::GRPC::BadStatus => e
343
362
  raise ::Google::Cloud::Error.from_error(e)
@@ -435,7 +454,6 @@ module Google
435
454
 
436
455
  @spanner_stub.call_rpc :batch_create_sessions, request, options: options do |response, operation|
437
456
  yield response, operation if block_given?
438
- return response
439
457
  end
440
458
  rescue ::GRPC::BadStatus => e
441
459
  raise ::Google::Cloud::Error.from_error(e)
@@ -523,7 +541,6 @@ module Google
523
541
 
524
542
  @spanner_stub.call_rpc :get_session, request, options: options do |response, operation|
525
543
  yield response, operation if block_given?
526
- return response
527
544
  end
528
545
  rescue ::GRPC::BadStatus => e
529
546
  raise ::Google::Cloud::Error.from_error(e)
@@ -633,7 +650,7 @@ module Google
633
650
  @spanner_stub.call_rpc :list_sessions, request, options: options do |response, operation|
634
651
  response = ::Gapic::PagedEnumerable.new @spanner_stub, :list_sessions, request, response, operation, options
635
652
  yield response, operation if block_given?
636
- return response
653
+ throw :response, response
637
654
  end
638
655
  rescue ::GRPC::BadStatus => e
639
656
  raise ::Google::Cloud::Error.from_error(e)
@@ -721,7 +738,6 @@ module Google
721
738
 
722
739
  @spanner_stub.call_rpc :delete_session, request, options: options do |response, operation|
723
740
  yield response, operation if block_given?
724
- return response
725
741
  end
726
742
  rescue ::GRPC::BadStatus => e
727
743
  raise ::Google::Cloud::Error.from_error(e)
@@ -908,7 +924,6 @@ module Google
908
924
 
909
925
  @spanner_stub.call_rpc :execute_sql, request, options: options do |response, operation|
910
926
  yield response, operation if block_given?
911
- return response
912
927
  end
913
928
  rescue ::GRPC::BadStatus => e
914
929
  raise ::Google::Cloud::Error.from_error(e)
@@ -1090,7 +1105,6 @@ module Google
1090
1105
 
1091
1106
  @spanner_stub.call_rpc :execute_streaming_sql, request, options: options do |response, operation|
1092
1107
  yield response, operation if block_given?
1093
- return response
1094
1108
  end
1095
1109
  rescue ::GRPC::BadStatus => e
1096
1110
  raise ::Google::Cloud::Error.from_error(e)
@@ -1221,7 +1235,6 @@ module Google
1221
1235
 
1222
1236
  @spanner_stub.call_rpc :execute_batch_dml, request, options: options do |response, operation|
1223
1237
  yield response, operation if block_given?
1224
- return response
1225
1238
  end
1226
1239
  rescue ::GRPC::BadStatus => e
1227
1240
  raise ::Google::Cloud::Error.from_error(e)
@@ -1389,7 +1402,6 @@ module Google
1389
1402
 
1390
1403
  @spanner_stub.call_rpc :read, request, options: options do |response, operation|
1391
1404
  yield response, operation if block_given?
1392
- return response
1393
1405
  end
1394
1406
  rescue ::GRPC::BadStatus => e
1395
1407
  raise ::Google::Cloud::Error.from_error(e)
@@ -1551,7 +1563,6 @@ module Google
1551
1563
 
1552
1564
  @spanner_stub.call_rpc :streaming_read, request, options: options do |response, operation|
1553
1565
  yield response, operation if block_given?
1554
- return response
1555
1566
  end
1556
1567
  rescue ::GRPC::BadStatus => e
1557
1568
  raise ::Google::Cloud::Error.from_error(e)
@@ -1656,7 +1667,6 @@ module Google
1656
1667
 
1657
1668
  @spanner_stub.call_rpc :begin_transaction, request, options: options do |response, operation|
1658
1669
  yield response, operation if block_given?
1659
- return response
1660
1670
  end
1661
1671
  rescue ::GRPC::BadStatus => e
1662
1672
  raise ::Google::Cloud::Error.from_error(e)
@@ -1790,7 +1800,6 @@ module Google
1790
1800
 
1791
1801
  @spanner_stub.call_rpc :commit, request, options: options do |response, operation|
1792
1802
  yield response, operation if block_given?
1793
- return response
1794
1803
  end
1795
1804
  rescue ::GRPC::BadStatus => e
1796
1805
  raise ::Google::Cloud::Error.from_error(e)
@@ -1886,7 +1895,6 @@ module Google
1886
1895
 
1887
1896
  @spanner_stub.call_rpc :rollback, request, options: options do |response, operation|
1888
1897
  yield response, operation if block_given?
1889
- return response
1890
1898
  end
1891
1899
  rescue ::GRPC::BadStatus => e
1892
1900
  raise ::Google::Cloud::Error.from_error(e)
@@ -2024,7 +2032,6 @@ module Google
2024
2032
 
2025
2033
  @spanner_stub.call_rpc :partition_query, request, options: options do |response, operation|
2026
2034
  yield response, operation if block_given?
2027
- return response
2028
2035
  end
2029
2036
  rescue ::GRPC::BadStatus => e
2030
2037
  raise ::Google::Cloud::Error.from_error(e)
@@ -2151,7 +2158,6 @@ module Google
2151
2158
 
2152
2159
  @spanner_stub.call_rpc :partition_read, request, options: options do |response, operation|
2153
2160
  yield response, operation if block_given?
2154
- return response
2155
2161
  end
2156
2162
  rescue ::GRPC::BadStatus => e
2157
2163
  raise ::Google::Cloud::Error.from_error(e)
@@ -2271,7 +2277,6 @@ module Google
2271
2277
 
2272
2278
  @spanner_stub.call_rpc :batch_write, request, options: options do |response, operation|
2273
2279
  yield response, operation if block_given?
2274
- return response
2275
2280
  end
2276
2281
  rescue ::GRPC::BadStatus => e
2277
2282
  raise ::Google::Cloud::Error.from_error(e)
@@ -2360,6 +2365,11 @@ module Google
2360
2365
  # default endpoint URL. The default value of nil uses the environment
2361
2366
  # universe (usually the default "googleapis.com" universe).
2362
2367
  # @return [::String,nil]
2368
+ # @!attribute [rw] logger
2369
+ # A custom logger to use for request/response debug logging, or the value
2370
+ # `:default` (the default) to construct a default logger, or `nil` to
2371
+ # explicitly disable logging.
2372
+ # @return [::Logger,:default,nil]
2363
2373
  #
2364
2374
  class Configuration
2365
2375
  extend ::Gapic::Config
@@ -2384,6 +2394,7 @@ module Google
2384
2394
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2385
2395
  config_attr :quota_project, nil, ::String, nil
2386
2396
  config_attr :universe_domain, nil, ::String, nil
2397
+ config_attr :logger, :default, ::Logger, nil, :default
2387
2398
 
2388
2399
  # @private
2389
2400
  def initialize parent_config = nil
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Spanner
23
23
  module V1
24
- VERSION = "1.3.0"
24
+ VERSION = "1.4.0"
25
25
  end
26
26
  end
27
27
  end
@@ -306,9 +306,28 @@ module Google
306
306
  # @!attribute [rw] common
307
307
  # @return [::Google::Api::CommonLanguageSettings]
308
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
309
319
  class GoSettings
310
320
  include ::Google::Protobuf::MessageExts
311
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
312
331
  end
313
332
 
314
333
  # Describes the generator configuration for a method.
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: 1.3.0
4
+ version: 1.4.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: 2024-12-04 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.1
19
+ version: 0.24.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.21.1
29
+ version: 0.24.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  requirements: []
114
- rubygems_version: 3.5.22
114
+ rubygems_version: 3.5.23
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Cloud Spanner is a managed, mission-critical, globally consistent and scalable