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,882 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
|
|
3
|
+
# Generated with the following commands:
|
|
4
|
+
#
|
|
5
|
+
# pip install grpcio-tools
|
|
6
|
+
# git clone git@github.com:googleapis/googleapis.git
|
|
7
|
+
# cd googleapis
|
|
8
|
+
# python -m grpc_tools.protoc \
|
|
9
|
+
# -I . \
|
|
10
|
+
# --python_out=. --pyi_out=. --grpc_python_out=. \
|
|
11
|
+
# ./google/spanner/v1/*.proto
|
|
12
|
+
|
|
13
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
14
|
+
|
|
15
|
+
import grpc
|
|
16
|
+
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
|
|
17
|
+
from google.cloud.spanner_v1.types import (
|
|
18
|
+
commit_response as google_dot_spanner_dot_v1_dot_commit__response__pb2,
|
|
19
|
+
)
|
|
20
|
+
from google.cloud.spanner_v1.types import (
|
|
21
|
+
result_set as google_dot_spanner_dot_v1_dot_result__set__pb2,
|
|
22
|
+
)
|
|
23
|
+
from google.cloud.spanner_v1.types import (
|
|
24
|
+
spanner as google_dot_spanner_dot_v1_dot_spanner__pb2,
|
|
25
|
+
)
|
|
26
|
+
from google.cloud.spanner_v1.types import (
|
|
27
|
+
transaction as google_dot_spanner_dot_v1_dot_transaction__pb2,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
GRPC_GENERATED_VERSION = "1.67.0"
|
|
31
|
+
GRPC_VERSION = grpc.__version__
|
|
32
|
+
_version_not_supported = False
|
|
33
|
+
|
|
34
|
+
try:
|
|
35
|
+
from grpc._utilities import first_version_is_lower
|
|
36
|
+
|
|
37
|
+
_version_not_supported = first_version_is_lower(
|
|
38
|
+
GRPC_VERSION, GRPC_GENERATED_VERSION
|
|
39
|
+
)
|
|
40
|
+
except ImportError:
|
|
41
|
+
_version_not_supported = True
|
|
42
|
+
|
|
43
|
+
if _version_not_supported:
|
|
44
|
+
raise RuntimeError(
|
|
45
|
+
f"The grpc package installed is at version {GRPC_VERSION},"
|
|
46
|
+
+ " but the generated code in google/spanner/v1/spanner_pb2_grpc.py depends on"
|
|
47
|
+
+ f" grpcio>={GRPC_GENERATED_VERSION}."
|
|
48
|
+
+ f" Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}"
|
|
49
|
+
+ f" or downgrade your generated code using grpcio-tools<={GRPC_VERSION}."
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class SpannerServicer(object):
|
|
54
|
+
"""Cloud Spanner API
|
|
55
|
+
|
|
56
|
+
The Cloud Spanner API can be used to manage sessions and execute
|
|
57
|
+
transactions on data stored in Cloud Spanner databases.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
def CreateSession(self, request, context):
|
|
61
|
+
"""Creates a new session. A session can be used to perform
|
|
62
|
+
transactions that read and/or modify data in a Cloud Spanner database.
|
|
63
|
+
Sessions are meant to be reused for many consecutive
|
|
64
|
+
transactions.
|
|
65
|
+
|
|
66
|
+
Sessions can only execute one transaction at a time. To execute
|
|
67
|
+
multiple concurrent read-write/write-only transactions, create
|
|
68
|
+
multiple sessions. Note that standalone reads and queries use a
|
|
69
|
+
transaction internally, and count toward the one transaction
|
|
70
|
+
limit.
|
|
71
|
+
|
|
72
|
+
Active sessions use additional server resources, so it is a good idea to
|
|
73
|
+
delete idle and unneeded sessions.
|
|
74
|
+
Aside from explicit deletes, Cloud Spanner may delete sessions for which no
|
|
75
|
+
operations are sent for more than an hour. If a session is deleted,
|
|
76
|
+
requests to it return `NOT_FOUND`.
|
|
77
|
+
|
|
78
|
+
Idle sessions can be kept alive by sending a trivial SQL query
|
|
79
|
+
periodically, e.g., `"SELECT 1"`.
|
|
80
|
+
"""
|
|
81
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
82
|
+
context.set_details("Method not implemented!")
|
|
83
|
+
raise NotImplementedError("Method not implemented!")
|
|
84
|
+
|
|
85
|
+
def BatchCreateSessions(self, request, context):
|
|
86
|
+
"""Creates multiple new sessions.
|
|
87
|
+
|
|
88
|
+
This API can be used to initialize a session cache on the clients.
|
|
89
|
+
See https://goo.gl/TgSFN2 for best practices on session cache management.
|
|
90
|
+
"""
|
|
91
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
92
|
+
context.set_details("Method not implemented!")
|
|
93
|
+
raise NotImplementedError("Method not implemented!")
|
|
94
|
+
|
|
95
|
+
def GetSession(self, request, context):
|
|
96
|
+
"""Gets a session. Returns `NOT_FOUND` if the session does not exist.
|
|
97
|
+
This is mainly useful for determining whether a session is still
|
|
98
|
+
alive.
|
|
99
|
+
"""
|
|
100
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
101
|
+
context.set_details("Method not implemented!")
|
|
102
|
+
raise NotImplementedError("Method not implemented!")
|
|
103
|
+
|
|
104
|
+
def ListSessions(self, request, context):
|
|
105
|
+
"""Lists all sessions in a given database."""
|
|
106
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
107
|
+
context.set_details("Method not implemented!")
|
|
108
|
+
raise NotImplementedError("Method not implemented!")
|
|
109
|
+
|
|
110
|
+
def DeleteSession(self, request, context):
|
|
111
|
+
"""Ends a session, releasing server resources associated with it. This will
|
|
112
|
+
asynchronously trigger cancellation of any operations that are running with
|
|
113
|
+
this session.
|
|
114
|
+
"""
|
|
115
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
116
|
+
context.set_details("Method not implemented!")
|
|
117
|
+
raise NotImplementedError("Method not implemented!")
|
|
118
|
+
|
|
119
|
+
def ExecuteSql(self, request, context):
|
|
120
|
+
"""Executes an SQL statement, returning all results in a single reply. This
|
|
121
|
+
method cannot be used to return a result set larger than 10 MiB;
|
|
122
|
+
if the query yields more data than that, the query fails with
|
|
123
|
+
a `FAILED_PRECONDITION` error.
|
|
124
|
+
|
|
125
|
+
Operations inside read-write transactions might return `ABORTED`. If
|
|
126
|
+
this occurs, the application should restart the transaction from
|
|
127
|
+
the beginning. See [Transaction][google.spanner.v1.Transaction] for more
|
|
128
|
+
details.
|
|
129
|
+
|
|
130
|
+
Larger result sets can be fetched in streaming fashion by calling
|
|
131
|
+
[ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]
|
|
132
|
+
instead.
|
|
133
|
+
"""
|
|
134
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
135
|
+
context.set_details("Method not implemented!")
|
|
136
|
+
raise NotImplementedError("Method not implemented!")
|
|
137
|
+
|
|
138
|
+
def ExecuteStreamingSql(self, request, context):
|
|
139
|
+
"""Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the
|
|
140
|
+
result set as a stream. Unlike
|
|
141
|
+
[ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on
|
|
142
|
+
the size of the returned result set. However, no individual row in the
|
|
143
|
+
result set can exceed 100 MiB, and no column value can exceed 10 MiB.
|
|
144
|
+
"""
|
|
145
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
146
|
+
context.set_details("Method not implemented!")
|
|
147
|
+
raise NotImplementedError("Method not implemented!")
|
|
148
|
+
|
|
149
|
+
def ExecuteBatchDml(self, request, context):
|
|
150
|
+
"""Executes a batch of SQL DML statements. This method allows many statements
|
|
151
|
+
to be run with lower latency than submitting them sequentially with
|
|
152
|
+
[ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
|
|
153
|
+
|
|
154
|
+
Statements are executed in sequential order. A request can succeed even if
|
|
155
|
+
a statement fails. The
|
|
156
|
+
[ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status]
|
|
157
|
+
field in the response provides information about the statement that failed.
|
|
158
|
+
Clients must inspect this field to determine whether an error occurred.
|
|
159
|
+
|
|
160
|
+
Execution stops after the first failed statement; the remaining statements
|
|
161
|
+
are not executed.
|
|
162
|
+
"""
|
|
163
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
164
|
+
context.set_details("Method not implemented!")
|
|
165
|
+
raise NotImplementedError("Method not implemented!")
|
|
166
|
+
|
|
167
|
+
def Read(self, request, context):
|
|
168
|
+
"""Reads rows from the database using key lookups and scans, as a
|
|
169
|
+
simple key/value style alternative to
|
|
170
|
+
[ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be
|
|
171
|
+
used to return a result set larger than 10 MiB; if the read matches more
|
|
172
|
+
data than that, the read fails with a `FAILED_PRECONDITION`
|
|
173
|
+
error.
|
|
174
|
+
|
|
175
|
+
Reads inside read-write transactions might return `ABORTED`. If
|
|
176
|
+
this occurs, the application should restart the transaction from
|
|
177
|
+
the beginning. See [Transaction][google.spanner.v1.Transaction] for more
|
|
178
|
+
details.
|
|
179
|
+
|
|
180
|
+
Larger result sets can be yielded in streaming fashion by calling
|
|
181
|
+
[StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead.
|
|
182
|
+
"""
|
|
183
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
184
|
+
context.set_details("Method not implemented!")
|
|
185
|
+
raise NotImplementedError("Method not implemented!")
|
|
186
|
+
|
|
187
|
+
def StreamingRead(self, request, context):
|
|
188
|
+
"""Like [Read][google.spanner.v1.Spanner.Read], except returns the result set
|
|
189
|
+
as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no
|
|
190
|
+
limit on the size of the returned result set. However, no individual row in
|
|
191
|
+
the result set can exceed 100 MiB, and no column value can exceed
|
|
192
|
+
10 MiB.
|
|
193
|
+
"""
|
|
194
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
195
|
+
context.set_details("Method not implemented!")
|
|
196
|
+
raise NotImplementedError("Method not implemented!")
|
|
197
|
+
|
|
198
|
+
def BeginTransaction(self, request, context):
|
|
199
|
+
"""Begins a new transaction. This step can often be skipped:
|
|
200
|
+
[Read][google.spanner.v1.Spanner.Read],
|
|
201
|
+
[ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
|
|
202
|
+
[Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a
|
|
203
|
+
side-effect.
|
|
204
|
+
"""
|
|
205
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
206
|
+
context.set_details("Method not implemented!")
|
|
207
|
+
raise NotImplementedError("Method not implemented!")
|
|
208
|
+
|
|
209
|
+
def Commit(self, request, context):
|
|
210
|
+
"""Commits a transaction. The request includes the mutations to be
|
|
211
|
+
applied to rows in the database.
|
|
212
|
+
|
|
213
|
+
`Commit` might return an `ABORTED` error. This can occur at any time;
|
|
214
|
+
commonly, the cause is conflicts with concurrent
|
|
215
|
+
transactions. However, it can also happen for a variety of other
|
|
216
|
+
reasons. If `Commit` returns `ABORTED`, the caller should re-attempt
|
|
217
|
+
the transaction from the beginning, re-using the same session.
|
|
218
|
+
|
|
219
|
+
On very rare occasions, `Commit` might return `UNKNOWN`. This can happen,
|
|
220
|
+
for example, if the client job experiences a 1+ hour networking failure.
|
|
221
|
+
At that point, Cloud Spanner has lost track of the transaction outcome and
|
|
222
|
+
we recommend that you perform another read from the database to see the
|
|
223
|
+
state of things as they are now.
|
|
224
|
+
"""
|
|
225
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
226
|
+
context.set_details("Method not implemented!")
|
|
227
|
+
raise NotImplementedError("Method not implemented!")
|
|
228
|
+
|
|
229
|
+
def Rollback(self, request, context):
|
|
230
|
+
"""Rolls back a transaction, releasing any locks it holds. It is a good
|
|
231
|
+
idea to call this for any transaction that includes one or more
|
|
232
|
+
[Read][google.spanner.v1.Spanner.Read] or
|
|
233
|
+
[ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately
|
|
234
|
+
decides not to commit.
|
|
235
|
+
|
|
236
|
+
`Rollback` returns `OK` if it successfully aborts the transaction, the
|
|
237
|
+
transaction was already aborted, or the transaction is not
|
|
238
|
+
found. `Rollback` never returns `ABORTED`.
|
|
239
|
+
"""
|
|
240
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
241
|
+
context.set_details("Method not implemented!")
|
|
242
|
+
raise NotImplementedError("Method not implemented!")
|
|
243
|
+
|
|
244
|
+
def PartitionQuery(self, request, context):
|
|
245
|
+
"""Creates a set of partition tokens that can be used to execute a query
|
|
246
|
+
operation in parallel. Each of the returned partition tokens can be used
|
|
247
|
+
by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to
|
|
248
|
+
specify a subset of the query result to read. The same session and
|
|
249
|
+
read-only transaction must be used by the PartitionQueryRequest used to
|
|
250
|
+
create the partition tokens and the ExecuteSqlRequests that use the
|
|
251
|
+
partition tokens.
|
|
252
|
+
|
|
253
|
+
Partition tokens become invalid when the session used to create them
|
|
254
|
+
is deleted, is idle for too long, begins a new transaction, or becomes too
|
|
255
|
+
old. When any of these happen, it is not possible to resume the query, and
|
|
256
|
+
the whole operation must be restarted from the beginning.
|
|
257
|
+
"""
|
|
258
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
259
|
+
context.set_details("Method not implemented!")
|
|
260
|
+
raise NotImplementedError("Method not implemented!")
|
|
261
|
+
|
|
262
|
+
def PartitionRead(self, request, context):
|
|
263
|
+
"""Creates a set of partition tokens that can be used to execute a read
|
|
264
|
+
operation in parallel. Each of the returned partition tokens can be used
|
|
265
|
+
by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a
|
|
266
|
+
subset of the read result to read. The same session and read-only
|
|
267
|
+
transaction must be used by the PartitionReadRequest used to create the
|
|
268
|
+
partition tokens and the ReadRequests that use the partition tokens. There
|
|
269
|
+
are no ordering guarantees on rows returned among the returned partition
|
|
270
|
+
tokens, or even within each individual StreamingRead call issued with a
|
|
271
|
+
partition_token.
|
|
272
|
+
|
|
273
|
+
Partition tokens become invalid when the session used to create them
|
|
274
|
+
is deleted, is idle for too long, begins a new transaction, or becomes too
|
|
275
|
+
old. When any of these happen, it is not possible to resume the read, and
|
|
276
|
+
the whole operation must be restarted from the beginning.
|
|
277
|
+
"""
|
|
278
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
279
|
+
context.set_details("Method not implemented!")
|
|
280
|
+
raise NotImplementedError("Method not implemented!")
|
|
281
|
+
|
|
282
|
+
def BatchWrite(self, request, context):
|
|
283
|
+
"""Batches the supplied mutation groups in a collection of efficient
|
|
284
|
+
transactions. All mutations in a group are committed atomically. However,
|
|
285
|
+
mutations across groups can be committed non-atomically in an unspecified
|
|
286
|
+
order and thus, they must be independent of each other. Partial failure is
|
|
287
|
+
possible, i.e., some groups may have been committed successfully, while
|
|
288
|
+
some may have failed. The results of individual batches are streamed into
|
|
289
|
+
the response as the batches are applied.
|
|
290
|
+
|
|
291
|
+
BatchWrite requests are not replay protected, meaning that each mutation
|
|
292
|
+
group may be applied more than once. Replays of non-idempotent mutations
|
|
293
|
+
may have undesirable effects. For example, replays of an insert mutation
|
|
294
|
+
may produce an already exists error or if you use generated or commit
|
|
295
|
+
timestamp-based keys, it may result in additional rows being added to the
|
|
296
|
+
mutation's table. We recommend structuring your mutation groups to be
|
|
297
|
+
idempotent to avoid this issue.
|
|
298
|
+
"""
|
|
299
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
300
|
+
context.set_details("Method not implemented!")
|
|
301
|
+
raise NotImplementedError("Method not implemented!")
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
def add_SpannerServicer_to_server(servicer, server):
|
|
305
|
+
rpc_method_handlers = {
|
|
306
|
+
"CreateSession": grpc.unary_unary_rpc_method_handler(
|
|
307
|
+
servicer.CreateSession,
|
|
308
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.CreateSessionRequest.deserialize,
|
|
309
|
+
response_serializer=google_dot_spanner_dot_v1_dot_spanner__pb2.Session.serialize,
|
|
310
|
+
),
|
|
311
|
+
"BatchCreateSessions": grpc.unary_unary_rpc_method_handler(
|
|
312
|
+
servicer.BatchCreateSessions,
|
|
313
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.BatchCreateSessionsRequest.deserialize,
|
|
314
|
+
response_serializer=google_dot_spanner_dot_v1_dot_spanner__pb2.BatchCreateSessionsResponse.serialize,
|
|
315
|
+
),
|
|
316
|
+
"GetSession": grpc.unary_unary_rpc_method_handler(
|
|
317
|
+
servicer.GetSession,
|
|
318
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.GetSessionRequest.deserialize,
|
|
319
|
+
response_serializer=google_dot_spanner_dot_v1_dot_spanner__pb2.Session.serialize,
|
|
320
|
+
),
|
|
321
|
+
"ListSessions": grpc.unary_unary_rpc_method_handler(
|
|
322
|
+
servicer.ListSessions,
|
|
323
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.ListSessionsRequest.deserialize,
|
|
324
|
+
response_serializer=google_dot_spanner_dot_v1_dot_spanner__pb2.ListSessionsResponse.serialize,
|
|
325
|
+
),
|
|
326
|
+
"DeleteSession": grpc.unary_unary_rpc_method_handler(
|
|
327
|
+
servicer.DeleteSession,
|
|
328
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.DeleteSessionRequest.deserialize,
|
|
329
|
+
response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
|
|
330
|
+
),
|
|
331
|
+
"ExecuteSql": grpc.unary_unary_rpc_method_handler(
|
|
332
|
+
servicer.ExecuteSql,
|
|
333
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.ExecuteSqlRequest.deserialize,
|
|
334
|
+
response_serializer=google_dot_spanner_dot_v1_dot_result__set__pb2.ResultSet.serialize,
|
|
335
|
+
),
|
|
336
|
+
"ExecuteStreamingSql": grpc.unary_stream_rpc_method_handler(
|
|
337
|
+
servicer.ExecuteStreamingSql,
|
|
338
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.ExecuteSqlRequest.deserialize,
|
|
339
|
+
response_serializer=google_dot_spanner_dot_v1_dot_result__set__pb2.PartialResultSet.serialize,
|
|
340
|
+
),
|
|
341
|
+
"ExecuteBatchDml": grpc.unary_unary_rpc_method_handler(
|
|
342
|
+
servicer.ExecuteBatchDml,
|
|
343
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.ExecuteBatchDmlRequest.deserialize,
|
|
344
|
+
response_serializer=google_dot_spanner_dot_v1_dot_spanner__pb2.ExecuteBatchDmlResponse.serialize,
|
|
345
|
+
),
|
|
346
|
+
"Read": grpc.unary_unary_rpc_method_handler(
|
|
347
|
+
servicer.Read,
|
|
348
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.ReadRequest.deserialize,
|
|
349
|
+
response_serializer=google_dot_spanner_dot_v1_dot_result__set__pb2.ResultSet.serialize,
|
|
350
|
+
),
|
|
351
|
+
"StreamingRead": grpc.unary_stream_rpc_method_handler(
|
|
352
|
+
servicer.StreamingRead,
|
|
353
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.ReadRequest.deserialize,
|
|
354
|
+
response_serializer=google_dot_spanner_dot_v1_dot_result__set__pb2.PartialResultSet.serialize,
|
|
355
|
+
),
|
|
356
|
+
"BeginTransaction": grpc.unary_unary_rpc_method_handler(
|
|
357
|
+
servicer.BeginTransaction,
|
|
358
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.BeginTransactionRequest.deserialize,
|
|
359
|
+
response_serializer=google_dot_spanner_dot_v1_dot_transaction__pb2.Transaction.serialize,
|
|
360
|
+
),
|
|
361
|
+
"Commit": grpc.unary_unary_rpc_method_handler(
|
|
362
|
+
servicer.Commit,
|
|
363
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.CommitRequest.deserialize,
|
|
364
|
+
response_serializer=google_dot_spanner_dot_v1_dot_commit__response__pb2.CommitResponse.serialize,
|
|
365
|
+
),
|
|
366
|
+
"Rollback": grpc.unary_unary_rpc_method_handler(
|
|
367
|
+
servicer.Rollback,
|
|
368
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.RollbackRequest.deserialize,
|
|
369
|
+
response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
|
|
370
|
+
),
|
|
371
|
+
"PartitionQuery": grpc.unary_unary_rpc_method_handler(
|
|
372
|
+
servicer.PartitionQuery,
|
|
373
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.PartitionQueryRequest.deserialize,
|
|
374
|
+
response_serializer=google_dot_spanner_dot_v1_dot_spanner__pb2.PartitionResponse.serialize,
|
|
375
|
+
),
|
|
376
|
+
"PartitionRead": grpc.unary_unary_rpc_method_handler(
|
|
377
|
+
servicer.PartitionRead,
|
|
378
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.PartitionReadRequest.deserialize,
|
|
379
|
+
response_serializer=google_dot_spanner_dot_v1_dot_spanner__pb2.PartitionResponse.serialize,
|
|
380
|
+
),
|
|
381
|
+
"BatchWrite": grpc.unary_stream_rpc_method_handler(
|
|
382
|
+
servicer.BatchWrite,
|
|
383
|
+
request_deserializer=google_dot_spanner_dot_v1_dot_spanner__pb2.BatchWriteRequest.deserialize,
|
|
384
|
+
response_serializer=google_dot_spanner_dot_v1_dot_spanner__pb2.BatchWriteResponse.serialize,
|
|
385
|
+
),
|
|
386
|
+
}
|
|
387
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
388
|
+
"google.spanner.v1.Spanner", rpc_method_handlers
|
|
389
|
+
)
|
|
390
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
391
|
+
server.add_registered_method_handlers(
|
|
392
|
+
"google.spanner.v1.Spanner", rpc_method_handlers
|
|
393
|
+
)
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
# This class is part of an EXPERIMENTAL API.
|
|
397
|
+
class Spanner(object):
|
|
398
|
+
"""Cloud Spanner API
|
|
399
|
+
|
|
400
|
+
The Cloud Spanner API can be used to manage sessions and execute
|
|
401
|
+
transactions on data stored in Cloud Spanner databases.
|
|
402
|
+
"""
|
|
403
|
+
|
|
404
|
+
@staticmethod
|
|
405
|
+
def CreateSession(
|
|
406
|
+
request,
|
|
407
|
+
target,
|
|
408
|
+
options=(),
|
|
409
|
+
channel_credentials=None,
|
|
410
|
+
call_credentials=None,
|
|
411
|
+
insecure=False,
|
|
412
|
+
compression=None,
|
|
413
|
+
wait_for_ready=None,
|
|
414
|
+
timeout=None,
|
|
415
|
+
metadata=None,
|
|
416
|
+
):
|
|
417
|
+
return grpc.experimental.unary_unary(
|
|
418
|
+
request,
|
|
419
|
+
target,
|
|
420
|
+
"/google.spanner.v1.Spanner/CreateSession",
|
|
421
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.CreateSessionRequest.to_json,
|
|
422
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.Session.from_json,
|
|
423
|
+
options,
|
|
424
|
+
channel_credentials,
|
|
425
|
+
insecure,
|
|
426
|
+
call_credentials,
|
|
427
|
+
compression,
|
|
428
|
+
wait_for_ready,
|
|
429
|
+
timeout,
|
|
430
|
+
metadata,
|
|
431
|
+
_registered_method=True,
|
|
432
|
+
)
|
|
433
|
+
|
|
434
|
+
@staticmethod
|
|
435
|
+
def BatchCreateSessions(
|
|
436
|
+
request,
|
|
437
|
+
target,
|
|
438
|
+
options=(),
|
|
439
|
+
channel_credentials=None,
|
|
440
|
+
call_credentials=None,
|
|
441
|
+
insecure=False,
|
|
442
|
+
compression=None,
|
|
443
|
+
wait_for_ready=None,
|
|
444
|
+
timeout=None,
|
|
445
|
+
metadata=None,
|
|
446
|
+
):
|
|
447
|
+
return grpc.experimental.unary_unary(
|
|
448
|
+
request,
|
|
449
|
+
target,
|
|
450
|
+
"/google.spanner.v1.Spanner/BatchCreateSessions",
|
|
451
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.BatchCreateSessionsRequest.to_json,
|
|
452
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.BatchCreateSessionsResponse.from_json,
|
|
453
|
+
options,
|
|
454
|
+
channel_credentials,
|
|
455
|
+
insecure,
|
|
456
|
+
call_credentials,
|
|
457
|
+
compression,
|
|
458
|
+
wait_for_ready,
|
|
459
|
+
timeout,
|
|
460
|
+
metadata,
|
|
461
|
+
_registered_method=True,
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
@staticmethod
|
|
465
|
+
def GetSession(
|
|
466
|
+
request,
|
|
467
|
+
target,
|
|
468
|
+
options=(),
|
|
469
|
+
channel_credentials=None,
|
|
470
|
+
call_credentials=None,
|
|
471
|
+
insecure=False,
|
|
472
|
+
compression=None,
|
|
473
|
+
wait_for_ready=None,
|
|
474
|
+
timeout=None,
|
|
475
|
+
metadata=None,
|
|
476
|
+
):
|
|
477
|
+
return grpc.experimental.unary_unary(
|
|
478
|
+
request,
|
|
479
|
+
target,
|
|
480
|
+
"/google.spanner.v1.Spanner/GetSession",
|
|
481
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.GetSessionRequest.to_json,
|
|
482
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.Session.from_json,
|
|
483
|
+
options,
|
|
484
|
+
channel_credentials,
|
|
485
|
+
insecure,
|
|
486
|
+
call_credentials,
|
|
487
|
+
compression,
|
|
488
|
+
wait_for_ready,
|
|
489
|
+
timeout,
|
|
490
|
+
metadata,
|
|
491
|
+
_registered_method=True,
|
|
492
|
+
)
|
|
493
|
+
|
|
494
|
+
@staticmethod
|
|
495
|
+
def ListSessions(
|
|
496
|
+
request,
|
|
497
|
+
target,
|
|
498
|
+
options=(),
|
|
499
|
+
channel_credentials=None,
|
|
500
|
+
call_credentials=None,
|
|
501
|
+
insecure=False,
|
|
502
|
+
compression=None,
|
|
503
|
+
wait_for_ready=None,
|
|
504
|
+
timeout=None,
|
|
505
|
+
metadata=None,
|
|
506
|
+
):
|
|
507
|
+
return grpc.experimental.unary_unary(
|
|
508
|
+
request,
|
|
509
|
+
target,
|
|
510
|
+
"/google.spanner.v1.Spanner/ListSessions",
|
|
511
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.ListSessionsRequest.to_json,
|
|
512
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.ListSessionsResponse.from_json,
|
|
513
|
+
options,
|
|
514
|
+
channel_credentials,
|
|
515
|
+
insecure,
|
|
516
|
+
call_credentials,
|
|
517
|
+
compression,
|
|
518
|
+
wait_for_ready,
|
|
519
|
+
timeout,
|
|
520
|
+
metadata,
|
|
521
|
+
_registered_method=True,
|
|
522
|
+
)
|
|
523
|
+
|
|
524
|
+
@staticmethod
|
|
525
|
+
def DeleteSession(
|
|
526
|
+
request,
|
|
527
|
+
target,
|
|
528
|
+
options=(),
|
|
529
|
+
channel_credentials=None,
|
|
530
|
+
call_credentials=None,
|
|
531
|
+
insecure=False,
|
|
532
|
+
compression=None,
|
|
533
|
+
wait_for_ready=None,
|
|
534
|
+
timeout=None,
|
|
535
|
+
metadata=None,
|
|
536
|
+
):
|
|
537
|
+
return grpc.experimental.unary_unary(
|
|
538
|
+
request,
|
|
539
|
+
target,
|
|
540
|
+
"/google.spanner.v1.Spanner/DeleteSession",
|
|
541
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.DeleteSessionRequest.to_json,
|
|
542
|
+
google_dot_protobuf_dot_empty__pb2.Empty.from_json,
|
|
543
|
+
options,
|
|
544
|
+
channel_credentials,
|
|
545
|
+
insecure,
|
|
546
|
+
call_credentials,
|
|
547
|
+
compression,
|
|
548
|
+
wait_for_ready,
|
|
549
|
+
timeout,
|
|
550
|
+
metadata,
|
|
551
|
+
_registered_method=True,
|
|
552
|
+
)
|
|
553
|
+
|
|
554
|
+
@staticmethod
|
|
555
|
+
def ExecuteSql(
|
|
556
|
+
request,
|
|
557
|
+
target,
|
|
558
|
+
options=(),
|
|
559
|
+
channel_credentials=None,
|
|
560
|
+
call_credentials=None,
|
|
561
|
+
insecure=False,
|
|
562
|
+
compression=None,
|
|
563
|
+
wait_for_ready=None,
|
|
564
|
+
timeout=None,
|
|
565
|
+
metadata=None,
|
|
566
|
+
):
|
|
567
|
+
return grpc.experimental.unary_unary(
|
|
568
|
+
request,
|
|
569
|
+
target,
|
|
570
|
+
"/google.spanner.v1.Spanner/ExecuteSql",
|
|
571
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.ExecuteSqlRequest.to_json,
|
|
572
|
+
google_dot_spanner_dot_v1_dot_result__set__pb2.ResultSet.from_json,
|
|
573
|
+
options,
|
|
574
|
+
channel_credentials,
|
|
575
|
+
insecure,
|
|
576
|
+
call_credentials,
|
|
577
|
+
compression,
|
|
578
|
+
wait_for_ready,
|
|
579
|
+
timeout,
|
|
580
|
+
metadata,
|
|
581
|
+
_registered_method=True,
|
|
582
|
+
)
|
|
583
|
+
|
|
584
|
+
@staticmethod
|
|
585
|
+
def ExecuteStreamingSql(
|
|
586
|
+
request,
|
|
587
|
+
target,
|
|
588
|
+
options=(),
|
|
589
|
+
channel_credentials=None,
|
|
590
|
+
call_credentials=None,
|
|
591
|
+
insecure=False,
|
|
592
|
+
compression=None,
|
|
593
|
+
wait_for_ready=None,
|
|
594
|
+
timeout=None,
|
|
595
|
+
metadata=None,
|
|
596
|
+
):
|
|
597
|
+
return grpc.experimental.unary_stream(
|
|
598
|
+
request,
|
|
599
|
+
target,
|
|
600
|
+
"/google.spanner.v1.Spanner/ExecuteStreamingSql",
|
|
601
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.ExecuteSqlRequest.to_json,
|
|
602
|
+
google_dot_spanner_dot_v1_dot_result__set__pb2.PartialResultSet.from_json,
|
|
603
|
+
options,
|
|
604
|
+
channel_credentials,
|
|
605
|
+
insecure,
|
|
606
|
+
call_credentials,
|
|
607
|
+
compression,
|
|
608
|
+
wait_for_ready,
|
|
609
|
+
timeout,
|
|
610
|
+
metadata,
|
|
611
|
+
_registered_method=True,
|
|
612
|
+
)
|
|
613
|
+
|
|
614
|
+
@staticmethod
|
|
615
|
+
def ExecuteBatchDml(
|
|
616
|
+
request,
|
|
617
|
+
target,
|
|
618
|
+
options=(),
|
|
619
|
+
channel_credentials=None,
|
|
620
|
+
call_credentials=None,
|
|
621
|
+
insecure=False,
|
|
622
|
+
compression=None,
|
|
623
|
+
wait_for_ready=None,
|
|
624
|
+
timeout=None,
|
|
625
|
+
metadata=None,
|
|
626
|
+
):
|
|
627
|
+
return grpc.experimental.unary_unary(
|
|
628
|
+
request,
|
|
629
|
+
target,
|
|
630
|
+
"/google.spanner.v1.Spanner/ExecuteBatchDml",
|
|
631
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.ExecuteBatchDmlRequest.to_json,
|
|
632
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.ExecuteBatchDmlResponse.from_json,
|
|
633
|
+
options,
|
|
634
|
+
channel_credentials,
|
|
635
|
+
insecure,
|
|
636
|
+
call_credentials,
|
|
637
|
+
compression,
|
|
638
|
+
wait_for_ready,
|
|
639
|
+
timeout,
|
|
640
|
+
metadata,
|
|
641
|
+
_registered_method=True,
|
|
642
|
+
)
|
|
643
|
+
|
|
644
|
+
@staticmethod
|
|
645
|
+
def Read(
|
|
646
|
+
request,
|
|
647
|
+
target,
|
|
648
|
+
options=(),
|
|
649
|
+
channel_credentials=None,
|
|
650
|
+
call_credentials=None,
|
|
651
|
+
insecure=False,
|
|
652
|
+
compression=None,
|
|
653
|
+
wait_for_ready=None,
|
|
654
|
+
timeout=None,
|
|
655
|
+
metadata=None,
|
|
656
|
+
):
|
|
657
|
+
return grpc.experimental.unary_unary(
|
|
658
|
+
request,
|
|
659
|
+
target,
|
|
660
|
+
"/google.spanner.v1.Spanner/Read",
|
|
661
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.ReadRequest.to_json,
|
|
662
|
+
google_dot_spanner_dot_v1_dot_result__set__pb2.ResultSet.from_json,
|
|
663
|
+
options,
|
|
664
|
+
channel_credentials,
|
|
665
|
+
insecure,
|
|
666
|
+
call_credentials,
|
|
667
|
+
compression,
|
|
668
|
+
wait_for_ready,
|
|
669
|
+
timeout,
|
|
670
|
+
metadata,
|
|
671
|
+
_registered_method=True,
|
|
672
|
+
)
|
|
673
|
+
|
|
674
|
+
@staticmethod
|
|
675
|
+
def StreamingRead(
|
|
676
|
+
request,
|
|
677
|
+
target,
|
|
678
|
+
options=(),
|
|
679
|
+
channel_credentials=None,
|
|
680
|
+
call_credentials=None,
|
|
681
|
+
insecure=False,
|
|
682
|
+
compression=None,
|
|
683
|
+
wait_for_ready=None,
|
|
684
|
+
timeout=None,
|
|
685
|
+
metadata=None,
|
|
686
|
+
):
|
|
687
|
+
return grpc.experimental.unary_stream(
|
|
688
|
+
request,
|
|
689
|
+
target,
|
|
690
|
+
"/google.spanner.v1.Spanner/StreamingRead",
|
|
691
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.ReadRequest.to_json,
|
|
692
|
+
google_dot_spanner_dot_v1_dot_result__set__pb2.PartialResultSet.from_json,
|
|
693
|
+
options,
|
|
694
|
+
channel_credentials,
|
|
695
|
+
insecure,
|
|
696
|
+
call_credentials,
|
|
697
|
+
compression,
|
|
698
|
+
wait_for_ready,
|
|
699
|
+
timeout,
|
|
700
|
+
metadata,
|
|
701
|
+
_registered_method=True,
|
|
702
|
+
)
|
|
703
|
+
|
|
704
|
+
@staticmethod
|
|
705
|
+
def BeginTransaction(
|
|
706
|
+
request,
|
|
707
|
+
target,
|
|
708
|
+
options=(),
|
|
709
|
+
channel_credentials=None,
|
|
710
|
+
call_credentials=None,
|
|
711
|
+
insecure=False,
|
|
712
|
+
compression=None,
|
|
713
|
+
wait_for_ready=None,
|
|
714
|
+
timeout=None,
|
|
715
|
+
metadata=None,
|
|
716
|
+
):
|
|
717
|
+
return grpc.experimental.unary_unary(
|
|
718
|
+
request,
|
|
719
|
+
target,
|
|
720
|
+
"/google.spanner.v1.Spanner/BeginTransaction",
|
|
721
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.BeginTransactionRequest.to_json,
|
|
722
|
+
google_dot_spanner_dot_v1_dot_transaction__pb2.Transaction.from_json,
|
|
723
|
+
options,
|
|
724
|
+
channel_credentials,
|
|
725
|
+
insecure,
|
|
726
|
+
call_credentials,
|
|
727
|
+
compression,
|
|
728
|
+
wait_for_ready,
|
|
729
|
+
timeout,
|
|
730
|
+
metadata,
|
|
731
|
+
_registered_method=True,
|
|
732
|
+
)
|
|
733
|
+
|
|
734
|
+
@staticmethod
|
|
735
|
+
def Commit(
|
|
736
|
+
request,
|
|
737
|
+
target,
|
|
738
|
+
options=(),
|
|
739
|
+
channel_credentials=None,
|
|
740
|
+
call_credentials=None,
|
|
741
|
+
insecure=False,
|
|
742
|
+
compression=None,
|
|
743
|
+
wait_for_ready=None,
|
|
744
|
+
timeout=None,
|
|
745
|
+
metadata=None,
|
|
746
|
+
):
|
|
747
|
+
return grpc.experimental.unary_unary(
|
|
748
|
+
request,
|
|
749
|
+
target,
|
|
750
|
+
"/google.spanner.v1.Spanner/Commit",
|
|
751
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.CommitRequest.to_json,
|
|
752
|
+
google_dot_spanner_dot_v1_dot_commit__response__pb2.CommitResponse.from_json,
|
|
753
|
+
options,
|
|
754
|
+
channel_credentials,
|
|
755
|
+
insecure,
|
|
756
|
+
call_credentials,
|
|
757
|
+
compression,
|
|
758
|
+
wait_for_ready,
|
|
759
|
+
timeout,
|
|
760
|
+
metadata,
|
|
761
|
+
_registered_method=True,
|
|
762
|
+
)
|
|
763
|
+
|
|
764
|
+
@staticmethod
|
|
765
|
+
def Rollback(
|
|
766
|
+
request,
|
|
767
|
+
target,
|
|
768
|
+
options=(),
|
|
769
|
+
channel_credentials=None,
|
|
770
|
+
call_credentials=None,
|
|
771
|
+
insecure=False,
|
|
772
|
+
compression=None,
|
|
773
|
+
wait_for_ready=None,
|
|
774
|
+
timeout=None,
|
|
775
|
+
metadata=None,
|
|
776
|
+
):
|
|
777
|
+
return grpc.experimental.unary_unary(
|
|
778
|
+
request,
|
|
779
|
+
target,
|
|
780
|
+
"/google.spanner.v1.Spanner/Rollback",
|
|
781
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.RollbackRequest.to_json,
|
|
782
|
+
google_dot_protobuf_dot_empty__pb2.Empty.from_json,
|
|
783
|
+
options,
|
|
784
|
+
channel_credentials,
|
|
785
|
+
insecure,
|
|
786
|
+
call_credentials,
|
|
787
|
+
compression,
|
|
788
|
+
wait_for_ready,
|
|
789
|
+
timeout,
|
|
790
|
+
metadata,
|
|
791
|
+
_registered_method=True,
|
|
792
|
+
)
|
|
793
|
+
|
|
794
|
+
@staticmethod
|
|
795
|
+
def PartitionQuery(
|
|
796
|
+
request,
|
|
797
|
+
target,
|
|
798
|
+
options=(),
|
|
799
|
+
channel_credentials=None,
|
|
800
|
+
call_credentials=None,
|
|
801
|
+
insecure=False,
|
|
802
|
+
compression=None,
|
|
803
|
+
wait_for_ready=None,
|
|
804
|
+
timeout=None,
|
|
805
|
+
metadata=None,
|
|
806
|
+
):
|
|
807
|
+
return grpc.experimental.unary_unary(
|
|
808
|
+
request,
|
|
809
|
+
target,
|
|
810
|
+
"/google.spanner.v1.Spanner/PartitionQuery",
|
|
811
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.PartitionQueryRequest.to_json,
|
|
812
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.PartitionResponse.from_json,
|
|
813
|
+
options,
|
|
814
|
+
channel_credentials,
|
|
815
|
+
insecure,
|
|
816
|
+
call_credentials,
|
|
817
|
+
compression,
|
|
818
|
+
wait_for_ready,
|
|
819
|
+
timeout,
|
|
820
|
+
metadata,
|
|
821
|
+
_registered_method=True,
|
|
822
|
+
)
|
|
823
|
+
|
|
824
|
+
@staticmethod
|
|
825
|
+
def PartitionRead(
|
|
826
|
+
request,
|
|
827
|
+
target,
|
|
828
|
+
options=(),
|
|
829
|
+
channel_credentials=None,
|
|
830
|
+
call_credentials=None,
|
|
831
|
+
insecure=False,
|
|
832
|
+
compression=None,
|
|
833
|
+
wait_for_ready=None,
|
|
834
|
+
timeout=None,
|
|
835
|
+
metadata=None,
|
|
836
|
+
):
|
|
837
|
+
return grpc.experimental.unary_unary(
|
|
838
|
+
request,
|
|
839
|
+
target,
|
|
840
|
+
"/google.spanner.v1.Spanner/PartitionRead",
|
|
841
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.PartitionReadRequest.to_json,
|
|
842
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.PartitionResponse.from_json,
|
|
843
|
+
options,
|
|
844
|
+
channel_credentials,
|
|
845
|
+
insecure,
|
|
846
|
+
call_credentials,
|
|
847
|
+
compression,
|
|
848
|
+
wait_for_ready,
|
|
849
|
+
timeout,
|
|
850
|
+
metadata,
|
|
851
|
+
_registered_method=True,
|
|
852
|
+
)
|
|
853
|
+
|
|
854
|
+
@staticmethod
|
|
855
|
+
def BatchWrite(
|
|
856
|
+
request,
|
|
857
|
+
target,
|
|
858
|
+
options=(),
|
|
859
|
+
channel_credentials=None,
|
|
860
|
+
call_credentials=None,
|
|
861
|
+
insecure=False,
|
|
862
|
+
compression=None,
|
|
863
|
+
wait_for_ready=None,
|
|
864
|
+
timeout=None,
|
|
865
|
+
metadata=None,
|
|
866
|
+
):
|
|
867
|
+
return grpc.experimental.unary_stream(
|
|
868
|
+
request,
|
|
869
|
+
target,
|
|
870
|
+
"/google.spanner.v1.Spanner/BatchWrite",
|
|
871
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.BatchWriteRequest.to_json,
|
|
872
|
+
google_dot_spanner_dot_v1_dot_spanner__pb2.BatchWriteResponse.from_json,
|
|
873
|
+
options,
|
|
874
|
+
channel_credentials,
|
|
875
|
+
insecure,
|
|
876
|
+
call_credentials,
|
|
877
|
+
compression,
|
|
878
|
+
wait_for_ready,
|
|
879
|
+
timeout,
|
|
880
|
+
metadata,
|
|
881
|
+
_registered_method=True,
|
|
882
|
+
)
|