google-cloud-spanner 2.14.0 → 2.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/LICENSE +2 -2
- data/lib/google/cloud/spanner/client.rb +12 -3
- 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: be9bac8912ff335f9d1bd4c18268b3796ad4bf521259559ccfd33bdc7aebd5b9
|
4
|
+
data.tar.gz: 5fe33da63dbe3ad1f733cc79c8a136a69f15ee013eda284a4d6c22e759728c33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c0939a408406551ade36f1bf01a43b2d9ced1a9556bfca9bb4642e348383da2ff3aa1e2285fa5acb1ed144dcdf6bf0e437419e9e07d1468bcc001203ed7c017
|
7
|
+
data.tar.gz: dc6d64fe998cd22ea0023516bb2429ea539c9e8230435800b4f19419b002a2313669880560a91297ff2a61c05b343b0de7f37aeaf15f6e093e8383813b153a63
|
data/CHANGELOG.md
CHANGED
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.15.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-09-08 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
|