google-cloud-spanner 2.14.0 → 2.16.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 +4 -4
- data/CHANGELOG.md +12 -0
- data/LICENSE +2 -2
- data/lib/google/cloud/spanner/client.rb +12 -3
- data/lib/google/cloud/spanner/convert.rb +2 -0
- data/lib/google/cloud/spanner/pool.rb +1 -2
- data/lib/google/cloud/spanner/project.rb +3 -2
- data/lib/google/cloud/spanner/service.rb +5 -5
- data/lib/google/cloud/spanner/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ac65f8870848733eb9611fb9b1cd3810b436863216bbd94665a26c02c30b801
|
4
|
+
data.tar.gz: '089436aedb445450729b02d2896dde9643f1594fdc9cc17ced1e1fa4f65d214a'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e33f7f33797345589cb5a9febd28f6b51a1ff0985c4cb28998290f98f0bd4ed12485cd2cb9ca5c75554485884faf253f689f4154ace7eeb2a0c4d3ad3e4b310
|
7
|
+
data.tar.gz: ce30969182302cd7a4d13e3501a7d416f486d755a06a7bd3e1653e251088c3c4cee9a019dd9b75a0ca3a7e3a440139c616fc19e6c3b5cb80945b1130948d55c8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 2.16.0 (2022-10-25)
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* support pg jsonb ([#19116](https://github.com/googleapis/google-cloud-ruby/issues/19116))
|
8
|
+
|
9
|
+
### 2.15.0 (2022-09-07)
|
10
|
+
|
11
|
+
#### Features
|
12
|
+
|
13
|
+
* Support fine grained access control ([#19067](https://github.com/googleapis/google-cloud-ruby/issues/19067))
|
14
|
+
|
3
15
|
### 2.14.0 (2022-07-08)
|
4
16
|
|
5
17
|
#### Features
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Apache License
|
2
2
|
Version 2.0, January 2004
|
3
|
-
|
3
|
+
http://www.apache.org/licenses/
|
4
4
|
|
5
5
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
6
|
|
@@ -192,7 +192,7 @@
|
|
192
192
|
you may not use this file except in compliance with the License.
|
193
193
|
You may obtain a copy of the License at
|
194
194
|
|
195
|
-
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
196
|
|
197
197
|
Unless required by applicable law or agreed to in writing, software
|
198
198
|
distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -52,10 +52,11 @@ module Google
|
|
52
52
|
##
|
53
53
|
# @private Creates a new Spanner Client instance.
|
54
54
|
def initialize project, instance_id, database_id, session_labels: nil,
|
55
|
-
pool_opts: {}, query_options: nil
|
55
|
+
pool_opts: {}, query_options: nil, database_role: nil
|
56
56
|
@project = project
|
57
57
|
@instance_id = instance_id
|
58
58
|
@database_id = database_id
|
59
|
+
@database_role = database_role
|
59
60
|
@session_labels = session_labels
|
60
61
|
@pool = Pool.new self, **pool_opts
|
61
62
|
@query_options = query_options
|
@@ -97,6 +98,12 @@ module Google
|
|
97
98
|
@project.database instance_id, database_id
|
98
99
|
end
|
99
100
|
|
101
|
+
# The Spanner session creator role.
|
102
|
+
# @return [String]
|
103
|
+
def database_role
|
104
|
+
@database_role
|
105
|
+
end
|
106
|
+
|
100
107
|
# A hash of values to specify the custom query options for executing
|
101
108
|
# SQL query.
|
102
109
|
# @return [Hash]
|
@@ -2115,7 +2122,8 @@ module Google
|
|
2115
2122
|
Admin::Database::V1::DatabaseAdmin::Paths.database_path(
|
2116
2123
|
project: project_id, instance: instance_id, database: database_id
|
2117
2124
|
),
|
2118
|
-
labels: @session_labels
|
2125
|
+
labels: @session_labels,
|
2126
|
+
database_role: @database_role
|
2119
2127
|
Session.from_grpc grpc, @project.service, query_options: @query_options
|
2120
2128
|
end
|
2121
2129
|
|
@@ -2144,7 +2152,8 @@ module Google
|
|
2144
2152
|
project: project_id, instance: instance_id, database: database_id
|
2145
2153
|
),
|
2146
2154
|
session_count,
|
2147
|
-
labels: @session_labels
|
2155
|
+
labels: @session_labels,
|
2156
|
+
database_role: @database_role
|
2148
2157
|
resp.session.map { |grpc| Session.from_grpc grpc, @project.service, query_options: @query_options }
|
2149
2158
|
end
|
2150
2159
|
|
@@ -277,8 +277,7 @@ module Google
|
|
277
277
|
end
|
278
278
|
|
279
279
|
def create_keepalive_task!
|
280
|
-
@keepalive_task = Concurrent::TimerTask.new
|
281
|
-
timeout_interval: 60) do
|
280
|
+
@keepalive_task = Concurrent::TimerTask.new execution_interval: 300 do
|
282
281
|
keepalive_or_release!
|
283
282
|
end
|
284
283
|
@keepalive_task.execute
|
@@ -569,7 +569,7 @@ module Google
|
|
569
569
|
# end
|
570
570
|
#
|
571
571
|
def client instance_id, database_id, pool: {}, labels: nil,
|
572
|
-
query_options: nil
|
572
|
+
query_options: nil, database_role: nil
|
573
573
|
# Convert from possible Google::Protobuf::Map
|
574
574
|
labels = labels.to_h { |k, v| [String(k), String(v)] } if labels
|
575
575
|
# Configs set by environment variables take over client-level configs.
|
@@ -581,7 +581,8 @@ module Google
|
|
581
581
|
Client.new self, instance_id, database_id,
|
582
582
|
session_labels: labels,
|
583
583
|
pool_opts: valid_session_pool_options(pool),
|
584
|
-
query_options: query_options
|
584
|
+
query_options: query_options,
|
585
|
+
database_role: database_role
|
585
586
|
end
|
586
587
|
|
587
588
|
##
|
@@ -293,20 +293,20 @@ module Google
|
|
293
293
|
end
|
294
294
|
|
295
295
|
def create_session database_name, labels: nil,
|
296
|
-
call_options: nil
|
296
|
+
call_options: nil, database_role: nil
|
297
297
|
opts = default_options session_name: database_name,
|
298
298
|
call_options: call_options
|
299
|
-
session = V1::Session.new labels: labels if labels
|
299
|
+
session = V1::Session.new labels: labels, creator_role: database_role if labels || database_role
|
300
300
|
service.create_session(
|
301
301
|
{ database: database_name, session: session }, opts
|
302
302
|
)
|
303
303
|
end
|
304
304
|
|
305
305
|
def batch_create_sessions database_name, session_count, labels: nil,
|
306
|
-
call_options: nil
|
306
|
+
call_options: nil, database_role: nil
|
307
307
|
opts = default_options session_name: database_name,
|
308
308
|
call_options: call_options
|
309
|
-
session = V1::Session.new labels: labels if labels
|
309
|
+
session = V1::Session.new labels: labels, creator_role: database_role if labels || database_role
|
310
310
|
# The response may have fewer sessions than requested in the RPC.
|
311
311
|
request = {
|
312
312
|
database: database_name,
|
@@ -604,7 +604,7 @@ module Google
|
|
604
604
|
opts[:timeout] = call_options[:timeout] if call_options[:timeout]
|
605
605
|
opts[:retry_policy] = call_options[:retry_policy] if call_options[:retry_policy]
|
606
606
|
end
|
607
|
-
|
607
|
+
::Gapic::CallOptions.new(**opts)
|
608
608
|
end
|
609
609
|
|
610
610
|
def partition_options partition_size_bytes, max_partitions
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-spanner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-10-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -81,6 +81,20 @@ dependencies:
|
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '1.0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: gapic-common
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 0.11.0
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 0.11.0
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: google-style
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|