google-cloud-spanner 3.55.0__py3-none-any.whl
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.
- google/cloud/spanner.py +47 -0
- google/cloud/spanner_admin_database_v1/__init__.py +146 -0
- google/cloud/spanner_admin_database_v1/gapic_metadata.json +418 -0
- google/cloud/spanner_admin_database_v1/gapic_version.py +16 -0
- google/cloud/spanner_admin_database_v1/py.typed +2 -0
- google/cloud/spanner_admin_database_v1/services/__init__.py +15 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/__init__.py +22 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py +4097 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/client.py +4602 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/pagers.py +989 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/__init__.py +38 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/base.py +820 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py +1303 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py +1688 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py +6512 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest_base.py +1650 -0
- google/cloud/spanner_admin_database_v1/types/__init__.py +144 -0
- google/cloud/spanner_admin_database_v1/types/backup.py +1106 -0
- google/cloud/spanner_admin_database_v1/types/backup_schedule.py +369 -0
- google/cloud/spanner_admin_database_v1/types/common.py +180 -0
- google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py +1303 -0
- google/cloud/spanner_admin_instance_v1/__init__.py +110 -0
- google/cloud/spanner_admin_instance_v1/gapic_metadata.json +343 -0
- google/cloud/spanner_admin_instance_v1/gapic_version.py +16 -0
- google/cloud/spanner_admin_instance_v1/py.typed +2 -0
- google/cloud/spanner_admin_instance_v1/services/__init__.py +15 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/__init__.py +22 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py +3466 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/client.py +3881 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/pagers.py +856 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/__init__.py +38 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/base.py +545 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py +1347 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py +1539 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/rest.py +4834 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/rest_base.py +1198 -0
- google/cloud/spanner_admin_instance_v1/types/__init__.py +104 -0
- google/cloud/spanner_admin_instance_v1/types/common.py +99 -0
- google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py +2375 -0
- google/cloud/spanner_dbapi/__init__.py +93 -0
- google/cloud/spanner_dbapi/_helpers.py +113 -0
- google/cloud/spanner_dbapi/batch_dml_executor.py +135 -0
- google/cloud/spanner_dbapi/checksum.py +80 -0
- google/cloud/spanner_dbapi/client_side_statement_executor.py +140 -0
- google/cloud/spanner_dbapi/client_side_statement_parser.py +106 -0
- google/cloud/spanner_dbapi/connection.py +818 -0
- google/cloud/spanner_dbapi/cursor.py +609 -0
- google/cloud/spanner_dbapi/exceptions.py +172 -0
- google/cloud/spanner_dbapi/parse_utils.py +392 -0
- google/cloud/spanner_dbapi/parsed_statement.py +63 -0
- google/cloud/spanner_dbapi/parser.py +258 -0
- google/cloud/spanner_dbapi/partition_helper.py +41 -0
- google/cloud/spanner_dbapi/transaction_helper.py +294 -0
- google/cloud/spanner_dbapi/types.py +106 -0
- google/cloud/spanner_dbapi/utils.py +147 -0
- google/cloud/spanner_dbapi/version.py +20 -0
- google/cloud/spanner_v1/__init__.py +154 -0
- google/cloud/spanner_v1/_helpers.py +751 -0
- google/cloud/spanner_v1/_opentelemetry_tracing.py +165 -0
- google/cloud/spanner_v1/backup.py +397 -0
- google/cloud/spanner_v1/batch.py +433 -0
- google/cloud/spanner_v1/client.py +538 -0
- google/cloud/spanner_v1/data_types.py +350 -0
- google/cloud/spanner_v1/database.py +1968 -0
- google/cloud/spanner_v1/database_sessions_manager.py +249 -0
- google/cloud/spanner_v1/gapic_metadata.json +268 -0
- google/cloud/spanner_v1/gapic_version.py +16 -0
- google/cloud/spanner_v1/instance.py +735 -0
- google/cloud/spanner_v1/keyset.py +193 -0
- google/cloud/spanner_v1/merged_result_set.py +146 -0
- google/cloud/spanner_v1/metrics/constants.py +71 -0
- google/cloud/spanner_v1/metrics/metrics_capture.py +75 -0
- google/cloud/spanner_v1/metrics/metrics_exporter.py +384 -0
- google/cloud/spanner_v1/metrics/metrics_interceptor.py +156 -0
- google/cloud/spanner_v1/metrics/metrics_tracer.py +588 -0
- google/cloud/spanner_v1/metrics/metrics_tracer_factory.py +328 -0
- google/cloud/spanner_v1/metrics/spanner_metrics_tracer_factory.py +172 -0
- google/cloud/spanner_v1/param_types.py +110 -0
- google/cloud/spanner_v1/pool.py +813 -0
- google/cloud/spanner_v1/py.typed +2 -0
- google/cloud/spanner_v1/request_id_header.py +64 -0
- google/cloud/spanner_v1/services/__init__.py +15 -0
- google/cloud/spanner_v1/services/spanner/__init__.py +22 -0
- google/cloud/spanner_v1/services/spanner/async_client.py +2205 -0
- google/cloud/spanner_v1/services/spanner/client.py +2624 -0
- google/cloud/spanner_v1/services/spanner/pagers.py +196 -0
- google/cloud/spanner_v1/services/spanner/transports/__init__.py +38 -0
- google/cloud/spanner_v1/services/spanner/transports/base.py +520 -0
- google/cloud/spanner_v1/services/spanner/transports/grpc.py +911 -0
- google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py +1144 -0
- google/cloud/spanner_v1/services/spanner/transports/rest.py +3468 -0
- google/cloud/spanner_v1/services/spanner/transports/rest_base.py +981 -0
- google/cloud/spanner_v1/session.py +631 -0
- google/cloud/spanner_v1/session_options.py +133 -0
- google/cloud/spanner_v1/snapshot.py +1057 -0
- google/cloud/spanner_v1/streamed.py +402 -0
- google/cloud/spanner_v1/table.py +181 -0
- google/cloud/spanner_v1/testing/__init__.py +0 -0
- google/cloud/spanner_v1/testing/database_test.py +121 -0
- google/cloud/spanner_v1/testing/interceptors.py +118 -0
- google/cloud/spanner_v1/testing/mock_database_admin.py +38 -0
- google/cloud/spanner_v1/testing/mock_spanner.py +261 -0
- google/cloud/spanner_v1/testing/spanner_database_admin_pb2_grpc.py +1267 -0
- google/cloud/spanner_v1/testing/spanner_pb2_grpc.py +882 -0
- google/cloud/spanner_v1/transaction.py +747 -0
- google/cloud/spanner_v1/types/__init__.py +118 -0
- google/cloud/spanner_v1/types/commit_response.py +94 -0
- google/cloud/spanner_v1/types/keys.py +248 -0
- google/cloud/spanner_v1/types/mutation.py +201 -0
- google/cloud/spanner_v1/types/query_plan.py +220 -0
- google/cloud/spanner_v1/types/result_set.py +379 -0
- google/cloud/spanner_v1/types/spanner.py +1815 -0
- google/cloud/spanner_v1/types/transaction.py +818 -0
- google/cloud/spanner_v1/types/type.py +288 -0
- google_cloud_spanner-3.55.0.dist-info/LICENSE +202 -0
- google_cloud_spanner-3.55.0.dist-info/METADATA +318 -0
- google_cloud_spanner-3.55.0.dist-info/RECORD +119 -0
- google_cloud_spanner-3.55.0.dist-info/WHEEL +5 -0
- google_cloud_spanner-3.55.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright 2025 Google LLC
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
import abc
|
|
17
|
+
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
|
|
18
|
+
|
|
19
|
+
from google.cloud.spanner_v1 import gapic_version as package_version
|
|
20
|
+
|
|
21
|
+
import google.auth # type: ignore
|
|
22
|
+
import google.api_core
|
|
23
|
+
from google.api_core import exceptions as core_exceptions
|
|
24
|
+
from google.api_core import gapic_v1
|
|
25
|
+
from google.api_core import retry as retries
|
|
26
|
+
from google.auth import credentials as ga_credentials # type: ignore
|
|
27
|
+
from google.oauth2 import service_account # type: ignore
|
|
28
|
+
import google.protobuf
|
|
29
|
+
|
|
30
|
+
from google.cloud.spanner_v1.types import commit_response
|
|
31
|
+
from google.cloud.spanner_v1.types import result_set
|
|
32
|
+
from google.cloud.spanner_v1.types import spanner
|
|
33
|
+
from google.cloud.spanner_v1.types import transaction
|
|
34
|
+
from google.cloud.spanner_v1.metrics.metrics_interceptor import MetricsInterceptor
|
|
35
|
+
from google.protobuf import empty_pb2 # type: ignore
|
|
36
|
+
|
|
37
|
+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
|
|
38
|
+
gapic_version=package_version.__version__
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
|
|
42
|
+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class SpannerTransport(abc.ABC):
|
|
46
|
+
"""Abstract transport class for Spanner."""
|
|
47
|
+
|
|
48
|
+
AUTH_SCOPES = (
|
|
49
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
|
50
|
+
"https://www.googleapis.com/auth/spanner.data",
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
DEFAULT_HOST: str = "spanner.googleapis.com"
|
|
54
|
+
|
|
55
|
+
def __init__(
|
|
56
|
+
self,
|
|
57
|
+
*,
|
|
58
|
+
host: str = DEFAULT_HOST,
|
|
59
|
+
credentials: Optional[ga_credentials.Credentials] = None,
|
|
60
|
+
credentials_file: Optional[str] = None,
|
|
61
|
+
scopes: Optional[Sequence[str]] = None,
|
|
62
|
+
quota_project_id: Optional[str] = None,
|
|
63
|
+
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
|
|
64
|
+
always_use_jwt_access: Optional[bool] = False,
|
|
65
|
+
api_audience: Optional[str] = None,
|
|
66
|
+
metrics_interceptor: Optional[MetricsInterceptor] = None,
|
|
67
|
+
**kwargs,
|
|
68
|
+
) -> None:
|
|
69
|
+
"""Instantiate the transport.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
host (Optional[str]):
|
|
73
|
+
The hostname to connect to (default: 'spanner.googleapis.com').
|
|
74
|
+
credentials (Optional[google.auth.credentials.Credentials]): The
|
|
75
|
+
authorization credentials to attach to requests. These
|
|
76
|
+
credentials identify the application to the service; if none
|
|
77
|
+
are specified, the client will attempt to ascertain the
|
|
78
|
+
credentials from the environment.
|
|
79
|
+
credentials_file (Optional[str]): A file with credentials that can
|
|
80
|
+
be loaded with :func:`google.auth.load_credentials_from_file`.
|
|
81
|
+
This argument is mutually exclusive with credentials.
|
|
82
|
+
scopes (Optional[Sequence[str]]): A list of scopes.
|
|
83
|
+
quota_project_id (Optional[str]): An optional project to use for billing
|
|
84
|
+
and quota.
|
|
85
|
+
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
|
|
86
|
+
The client info used to send a user-agent string along with
|
|
87
|
+
API requests. If ``None``, then default info will be used.
|
|
88
|
+
Generally, you only need to set this if you're developing
|
|
89
|
+
your own client library.
|
|
90
|
+
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
|
|
91
|
+
be used for service account credentials.
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
|
|
95
|
+
|
|
96
|
+
# Save the scopes.
|
|
97
|
+
self._scopes = scopes
|
|
98
|
+
if not hasattr(self, "_ignore_credentials"):
|
|
99
|
+
self._ignore_credentials: bool = False
|
|
100
|
+
|
|
101
|
+
# If no credentials are provided, then determine the appropriate
|
|
102
|
+
# defaults.
|
|
103
|
+
if credentials and credentials_file:
|
|
104
|
+
raise core_exceptions.DuplicateCredentialArgs(
|
|
105
|
+
"'credentials_file' and 'credentials' are mutually exclusive"
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
if credentials_file is not None:
|
|
109
|
+
credentials, _ = google.auth.load_credentials_from_file(
|
|
110
|
+
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
|
|
111
|
+
)
|
|
112
|
+
elif credentials is None and not self._ignore_credentials:
|
|
113
|
+
credentials, _ = google.auth.default(
|
|
114
|
+
**scopes_kwargs, quota_project_id=quota_project_id
|
|
115
|
+
)
|
|
116
|
+
# Don't apply audience if the credentials file passed from user.
|
|
117
|
+
if hasattr(credentials, "with_gdch_audience"):
|
|
118
|
+
credentials = credentials.with_gdch_audience(
|
|
119
|
+
api_audience if api_audience else host
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# If the credentials are service account credentials, then always try to use self signed JWT.
|
|
123
|
+
if (
|
|
124
|
+
always_use_jwt_access
|
|
125
|
+
and isinstance(credentials, service_account.Credentials)
|
|
126
|
+
and hasattr(service_account.Credentials, "with_always_use_jwt_access")
|
|
127
|
+
):
|
|
128
|
+
credentials = credentials.with_always_use_jwt_access(True)
|
|
129
|
+
|
|
130
|
+
# Save the credentials.
|
|
131
|
+
self._credentials = credentials
|
|
132
|
+
|
|
133
|
+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
|
|
134
|
+
if ":" not in host:
|
|
135
|
+
host += ":443"
|
|
136
|
+
self._host = host
|
|
137
|
+
|
|
138
|
+
@property
|
|
139
|
+
def host(self):
|
|
140
|
+
return self._host
|
|
141
|
+
|
|
142
|
+
def _prep_wrapped_messages(self, client_info):
|
|
143
|
+
# Precompute the wrapped methods.
|
|
144
|
+
self._wrapped_methods = {
|
|
145
|
+
self.create_session: gapic_v1.method.wrap_method(
|
|
146
|
+
self.create_session,
|
|
147
|
+
default_retry=retries.Retry(
|
|
148
|
+
initial=0.25,
|
|
149
|
+
maximum=32.0,
|
|
150
|
+
multiplier=1.3,
|
|
151
|
+
predicate=retries.if_exception_type(
|
|
152
|
+
core_exceptions.ResourceExhausted,
|
|
153
|
+
core_exceptions.ServiceUnavailable,
|
|
154
|
+
),
|
|
155
|
+
deadline=30.0,
|
|
156
|
+
),
|
|
157
|
+
default_timeout=30.0,
|
|
158
|
+
client_info=client_info,
|
|
159
|
+
),
|
|
160
|
+
self.batch_create_sessions: gapic_v1.method.wrap_method(
|
|
161
|
+
self.batch_create_sessions,
|
|
162
|
+
default_retry=retries.Retry(
|
|
163
|
+
initial=0.25,
|
|
164
|
+
maximum=32.0,
|
|
165
|
+
multiplier=1.3,
|
|
166
|
+
predicate=retries.if_exception_type(
|
|
167
|
+
core_exceptions.ResourceExhausted,
|
|
168
|
+
core_exceptions.ServiceUnavailable,
|
|
169
|
+
),
|
|
170
|
+
deadline=60.0,
|
|
171
|
+
),
|
|
172
|
+
default_timeout=60.0,
|
|
173
|
+
client_info=client_info,
|
|
174
|
+
),
|
|
175
|
+
self.get_session: gapic_v1.method.wrap_method(
|
|
176
|
+
self.get_session,
|
|
177
|
+
default_retry=retries.Retry(
|
|
178
|
+
initial=0.25,
|
|
179
|
+
maximum=32.0,
|
|
180
|
+
multiplier=1.3,
|
|
181
|
+
predicate=retries.if_exception_type(
|
|
182
|
+
core_exceptions.ResourceExhausted,
|
|
183
|
+
core_exceptions.ServiceUnavailable,
|
|
184
|
+
),
|
|
185
|
+
deadline=30.0,
|
|
186
|
+
),
|
|
187
|
+
default_timeout=30.0,
|
|
188
|
+
client_info=client_info,
|
|
189
|
+
),
|
|
190
|
+
self.list_sessions: gapic_v1.method.wrap_method(
|
|
191
|
+
self.list_sessions,
|
|
192
|
+
default_retry=retries.Retry(
|
|
193
|
+
initial=0.25,
|
|
194
|
+
maximum=32.0,
|
|
195
|
+
multiplier=1.3,
|
|
196
|
+
predicate=retries.if_exception_type(
|
|
197
|
+
core_exceptions.ResourceExhausted,
|
|
198
|
+
core_exceptions.ServiceUnavailable,
|
|
199
|
+
),
|
|
200
|
+
deadline=3600.0,
|
|
201
|
+
),
|
|
202
|
+
default_timeout=3600.0,
|
|
203
|
+
client_info=client_info,
|
|
204
|
+
),
|
|
205
|
+
self.delete_session: gapic_v1.method.wrap_method(
|
|
206
|
+
self.delete_session,
|
|
207
|
+
default_retry=retries.Retry(
|
|
208
|
+
initial=0.25,
|
|
209
|
+
maximum=32.0,
|
|
210
|
+
multiplier=1.3,
|
|
211
|
+
predicate=retries.if_exception_type(
|
|
212
|
+
core_exceptions.ResourceExhausted,
|
|
213
|
+
core_exceptions.ServiceUnavailable,
|
|
214
|
+
),
|
|
215
|
+
deadline=30.0,
|
|
216
|
+
),
|
|
217
|
+
default_timeout=30.0,
|
|
218
|
+
client_info=client_info,
|
|
219
|
+
),
|
|
220
|
+
self.execute_sql: gapic_v1.method.wrap_method(
|
|
221
|
+
self.execute_sql,
|
|
222
|
+
default_retry=retries.Retry(
|
|
223
|
+
initial=0.25,
|
|
224
|
+
maximum=32.0,
|
|
225
|
+
multiplier=1.3,
|
|
226
|
+
predicate=retries.if_exception_type(
|
|
227
|
+
core_exceptions.ResourceExhausted,
|
|
228
|
+
core_exceptions.ServiceUnavailable,
|
|
229
|
+
),
|
|
230
|
+
deadline=30.0,
|
|
231
|
+
),
|
|
232
|
+
default_timeout=30.0,
|
|
233
|
+
client_info=client_info,
|
|
234
|
+
),
|
|
235
|
+
self.execute_streaming_sql: gapic_v1.method.wrap_method(
|
|
236
|
+
self.execute_streaming_sql,
|
|
237
|
+
default_timeout=3600.0,
|
|
238
|
+
client_info=client_info,
|
|
239
|
+
),
|
|
240
|
+
self.execute_batch_dml: gapic_v1.method.wrap_method(
|
|
241
|
+
self.execute_batch_dml,
|
|
242
|
+
default_retry=retries.Retry(
|
|
243
|
+
initial=0.25,
|
|
244
|
+
maximum=32.0,
|
|
245
|
+
multiplier=1.3,
|
|
246
|
+
predicate=retries.if_exception_type(
|
|
247
|
+
core_exceptions.ResourceExhausted,
|
|
248
|
+
core_exceptions.ServiceUnavailable,
|
|
249
|
+
),
|
|
250
|
+
deadline=30.0,
|
|
251
|
+
),
|
|
252
|
+
default_timeout=30.0,
|
|
253
|
+
client_info=client_info,
|
|
254
|
+
),
|
|
255
|
+
self.read: gapic_v1.method.wrap_method(
|
|
256
|
+
self.read,
|
|
257
|
+
default_retry=retries.Retry(
|
|
258
|
+
initial=0.25,
|
|
259
|
+
maximum=32.0,
|
|
260
|
+
multiplier=1.3,
|
|
261
|
+
predicate=retries.if_exception_type(
|
|
262
|
+
core_exceptions.ResourceExhausted,
|
|
263
|
+
core_exceptions.ServiceUnavailable,
|
|
264
|
+
),
|
|
265
|
+
deadline=30.0,
|
|
266
|
+
),
|
|
267
|
+
default_timeout=30.0,
|
|
268
|
+
client_info=client_info,
|
|
269
|
+
),
|
|
270
|
+
self.streaming_read: gapic_v1.method.wrap_method(
|
|
271
|
+
self.streaming_read,
|
|
272
|
+
default_timeout=3600.0,
|
|
273
|
+
client_info=client_info,
|
|
274
|
+
),
|
|
275
|
+
self.begin_transaction: gapic_v1.method.wrap_method(
|
|
276
|
+
self.begin_transaction,
|
|
277
|
+
default_retry=retries.Retry(
|
|
278
|
+
initial=0.25,
|
|
279
|
+
maximum=32.0,
|
|
280
|
+
multiplier=1.3,
|
|
281
|
+
predicate=retries.if_exception_type(
|
|
282
|
+
core_exceptions.ResourceExhausted,
|
|
283
|
+
core_exceptions.ServiceUnavailable,
|
|
284
|
+
),
|
|
285
|
+
deadline=30.0,
|
|
286
|
+
),
|
|
287
|
+
default_timeout=30.0,
|
|
288
|
+
client_info=client_info,
|
|
289
|
+
),
|
|
290
|
+
self.commit: gapic_v1.method.wrap_method(
|
|
291
|
+
self.commit,
|
|
292
|
+
default_retry=retries.Retry(
|
|
293
|
+
initial=0.25,
|
|
294
|
+
maximum=32.0,
|
|
295
|
+
multiplier=1.3,
|
|
296
|
+
predicate=retries.if_exception_type(
|
|
297
|
+
core_exceptions.ResourceExhausted,
|
|
298
|
+
core_exceptions.ServiceUnavailable,
|
|
299
|
+
),
|
|
300
|
+
deadline=3600.0,
|
|
301
|
+
),
|
|
302
|
+
default_timeout=3600.0,
|
|
303
|
+
client_info=client_info,
|
|
304
|
+
),
|
|
305
|
+
self.rollback: gapic_v1.method.wrap_method(
|
|
306
|
+
self.rollback,
|
|
307
|
+
default_retry=retries.Retry(
|
|
308
|
+
initial=0.25,
|
|
309
|
+
maximum=32.0,
|
|
310
|
+
multiplier=1.3,
|
|
311
|
+
predicate=retries.if_exception_type(
|
|
312
|
+
core_exceptions.ResourceExhausted,
|
|
313
|
+
core_exceptions.ServiceUnavailable,
|
|
314
|
+
),
|
|
315
|
+
deadline=30.0,
|
|
316
|
+
),
|
|
317
|
+
default_timeout=30.0,
|
|
318
|
+
client_info=client_info,
|
|
319
|
+
),
|
|
320
|
+
self.partition_query: gapic_v1.method.wrap_method(
|
|
321
|
+
self.partition_query,
|
|
322
|
+
default_retry=retries.Retry(
|
|
323
|
+
initial=0.25,
|
|
324
|
+
maximum=32.0,
|
|
325
|
+
multiplier=1.3,
|
|
326
|
+
predicate=retries.if_exception_type(
|
|
327
|
+
core_exceptions.ResourceExhausted,
|
|
328
|
+
core_exceptions.ServiceUnavailable,
|
|
329
|
+
),
|
|
330
|
+
deadline=30.0,
|
|
331
|
+
),
|
|
332
|
+
default_timeout=30.0,
|
|
333
|
+
client_info=client_info,
|
|
334
|
+
),
|
|
335
|
+
self.partition_read: gapic_v1.method.wrap_method(
|
|
336
|
+
self.partition_read,
|
|
337
|
+
default_retry=retries.Retry(
|
|
338
|
+
initial=0.25,
|
|
339
|
+
maximum=32.0,
|
|
340
|
+
multiplier=1.3,
|
|
341
|
+
predicate=retries.if_exception_type(
|
|
342
|
+
core_exceptions.ResourceExhausted,
|
|
343
|
+
core_exceptions.ServiceUnavailable,
|
|
344
|
+
),
|
|
345
|
+
deadline=30.0,
|
|
346
|
+
),
|
|
347
|
+
default_timeout=30.0,
|
|
348
|
+
client_info=client_info,
|
|
349
|
+
),
|
|
350
|
+
self.batch_write: gapic_v1.method.wrap_method(
|
|
351
|
+
self.batch_write,
|
|
352
|
+
default_timeout=3600.0,
|
|
353
|
+
client_info=client_info,
|
|
354
|
+
),
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
def close(self):
|
|
358
|
+
"""Closes resources associated with the transport.
|
|
359
|
+
|
|
360
|
+
.. warning::
|
|
361
|
+
Only call this method if the transport is NOT shared
|
|
362
|
+
with other clients - this may cause errors in other clients!
|
|
363
|
+
"""
|
|
364
|
+
raise NotImplementedError()
|
|
365
|
+
|
|
366
|
+
@property
|
|
367
|
+
def create_session(
|
|
368
|
+
self,
|
|
369
|
+
) -> Callable[
|
|
370
|
+
[spanner.CreateSessionRequest],
|
|
371
|
+
Union[spanner.Session, Awaitable[spanner.Session]],
|
|
372
|
+
]:
|
|
373
|
+
raise NotImplementedError()
|
|
374
|
+
|
|
375
|
+
@property
|
|
376
|
+
def batch_create_sessions(
|
|
377
|
+
self,
|
|
378
|
+
) -> Callable[
|
|
379
|
+
[spanner.BatchCreateSessionsRequest],
|
|
380
|
+
Union[
|
|
381
|
+
spanner.BatchCreateSessionsResponse,
|
|
382
|
+
Awaitable[spanner.BatchCreateSessionsResponse],
|
|
383
|
+
],
|
|
384
|
+
]:
|
|
385
|
+
raise NotImplementedError()
|
|
386
|
+
|
|
387
|
+
@property
|
|
388
|
+
def get_session(
|
|
389
|
+
self,
|
|
390
|
+
) -> Callable[
|
|
391
|
+
[spanner.GetSessionRequest], Union[spanner.Session, Awaitable[spanner.Session]]
|
|
392
|
+
]:
|
|
393
|
+
raise NotImplementedError()
|
|
394
|
+
|
|
395
|
+
@property
|
|
396
|
+
def list_sessions(
|
|
397
|
+
self,
|
|
398
|
+
) -> Callable[
|
|
399
|
+
[spanner.ListSessionsRequest],
|
|
400
|
+
Union[spanner.ListSessionsResponse, Awaitable[spanner.ListSessionsResponse]],
|
|
401
|
+
]:
|
|
402
|
+
raise NotImplementedError()
|
|
403
|
+
|
|
404
|
+
@property
|
|
405
|
+
def delete_session(
|
|
406
|
+
self,
|
|
407
|
+
) -> Callable[
|
|
408
|
+
[spanner.DeleteSessionRequest],
|
|
409
|
+
Union[empty_pb2.Empty, Awaitable[empty_pb2.Empty]],
|
|
410
|
+
]:
|
|
411
|
+
raise NotImplementedError()
|
|
412
|
+
|
|
413
|
+
@property
|
|
414
|
+
def execute_sql(
|
|
415
|
+
self,
|
|
416
|
+
) -> Callable[
|
|
417
|
+
[spanner.ExecuteSqlRequest],
|
|
418
|
+
Union[result_set.ResultSet, Awaitable[result_set.ResultSet]],
|
|
419
|
+
]:
|
|
420
|
+
raise NotImplementedError()
|
|
421
|
+
|
|
422
|
+
@property
|
|
423
|
+
def execute_streaming_sql(
|
|
424
|
+
self,
|
|
425
|
+
) -> Callable[
|
|
426
|
+
[spanner.ExecuteSqlRequest],
|
|
427
|
+
Union[result_set.PartialResultSet, Awaitable[result_set.PartialResultSet]],
|
|
428
|
+
]:
|
|
429
|
+
raise NotImplementedError()
|
|
430
|
+
|
|
431
|
+
@property
|
|
432
|
+
def execute_batch_dml(
|
|
433
|
+
self,
|
|
434
|
+
) -> Callable[
|
|
435
|
+
[spanner.ExecuteBatchDmlRequest],
|
|
436
|
+
Union[
|
|
437
|
+
spanner.ExecuteBatchDmlResponse, Awaitable[spanner.ExecuteBatchDmlResponse]
|
|
438
|
+
],
|
|
439
|
+
]:
|
|
440
|
+
raise NotImplementedError()
|
|
441
|
+
|
|
442
|
+
@property
|
|
443
|
+
def read(
|
|
444
|
+
self,
|
|
445
|
+
) -> Callable[
|
|
446
|
+
[spanner.ReadRequest],
|
|
447
|
+
Union[result_set.ResultSet, Awaitable[result_set.ResultSet]],
|
|
448
|
+
]:
|
|
449
|
+
raise NotImplementedError()
|
|
450
|
+
|
|
451
|
+
@property
|
|
452
|
+
def streaming_read(
|
|
453
|
+
self,
|
|
454
|
+
) -> Callable[
|
|
455
|
+
[spanner.ReadRequest],
|
|
456
|
+
Union[result_set.PartialResultSet, Awaitable[result_set.PartialResultSet]],
|
|
457
|
+
]:
|
|
458
|
+
raise NotImplementedError()
|
|
459
|
+
|
|
460
|
+
@property
|
|
461
|
+
def begin_transaction(
|
|
462
|
+
self,
|
|
463
|
+
) -> Callable[
|
|
464
|
+
[spanner.BeginTransactionRequest],
|
|
465
|
+
Union[transaction.Transaction, Awaitable[transaction.Transaction]],
|
|
466
|
+
]:
|
|
467
|
+
raise NotImplementedError()
|
|
468
|
+
|
|
469
|
+
@property
|
|
470
|
+
def commit(
|
|
471
|
+
self,
|
|
472
|
+
) -> Callable[
|
|
473
|
+
[spanner.CommitRequest],
|
|
474
|
+
Union[
|
|
475
|
+
commit_response.CommitResponse, Awaitable[commit_response.CommitResponse]
|
|
476
|
+
],
|
|
477
|
+
]:
|
|
478
|
+
raise NotImplementedError()
|
|
479
|
+
|
|
480
|
+
@property
|
|
481
|
+
def rollback(
|
|
482
|
+
self,
|
|
483
|
+
) -> Callable[
|
|
484
|
+
[spanner.RollbackRequest], Union[empty_pb2.Empty, Awaitable[empty_pb2.Empty]]
|
|
485
|
+
]:
|
|
486
|
+
raise NotImplementedError()
|
|
487
|
+
|
|
488
|
+
@property
|
|
489
|
+
def partition_query(
|
|
490
|
+
self,
|
|
491
|
+
) -> Callable[
|
|
492
|
+
[spanner.PartitionQueryRequest],
|
|
493
|
+
Union[spanner.PartitionResponse, Awaitable[spanner.PartitionResponse]],
|
|
494
|
+
]:
|
|
495
|
+
raise NotImplementedError()
|
|
496
|
+
|
|
497
|
+
@property
|
|
498
|
+
def partition_read(
|
|
499
|
+
self,
|
|
500
|
+
) -> Callable[
|
|
501
|
+
[spanner.PartitionReadRequest],
|
|
502
|
+
Union[spanner.PartitionResponse, Awaitable[spanner.PartitionResponse]],
|
|
503
|
+
]:
|
|
504
|
+
raise NotImplementedError()
|
|
505
|
+
|
|
506
|
+
@property
|
|
507
|
+
def batch_write(
|
|
508
|
+
self,
|
|
509
|
+
) -> Callable[
|
|
510
|
+
[spanner.BatchWriteRequest],
|
|
511
|
+
Union[spanner.BatchWriteResponse, Awaitable[spanner.BatchWriteResponse]],
|
|
512
|
+
]:
|
|
513
|
+
raise NotImplementedError()
|
|
514
|
+
|
|
515
|
+
@property
|
|
516
|
+
def kind(self) -> str:
|
|
517
|
+
raise NotImplementedError()
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
__all__ = ("SpannerTransport",)
|