Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def channel(self):

@property
def list_databases(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`DatabaseAdminClient.list_databases`.

Lists Cloud Spanner databases.

Expand All @@ -123,7 +123,7 @@ def list_databases(self):

@property
def create_database(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`DatabaseAdminClient.create_database`.

Creates a new Cloud Spanner database and starts to prepare it for
serving. The returned ``long-running operation`` will have a name of the
Expand All @@ -141,7 +141,7 @@ def create_database(self):

@property
def get_database(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`DatabaseAdminClient.get_database`.

Gets the state of a Cloud Spanner database.

Expand All @@ -154,7 +154,7 @@ def get_database(self):

@property
def update_database_ddl(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`DatabaseAdminClient.update_database_ddl`.

Updates the schema of a Cloud Spanner database by
creating/altering/dropping tables, columns, indexes, etc. The returned
Expand All @@ -172,7 +172,7 @@ def update_database_ddl(self):

@property
def drop_database(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`DatabaseAdminClient.drop_database`.

Drops (aka deletes) a Cloud Spanner database.

Expand All @@ -185,7 +185,7 @@ def drop_database(self):

@property
def get_database_ddl(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`DatabaseAdminClient.get_database_ddl`.

Returns the schema of a Cloud Spanner database as a list of formatted
DDL statements. This method does not show pending schema updates, those
Expand All @@ -200,7 +200,7 @@ def get_database_ddl(self):

@property
def set_iam_policy(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`DatabaseAdminClient.set_iam_policy`.

Sets the access control policy on a database resource. Replaces any
existing policy.
Expand All @@ -217,7 +217,7 @@ def set_iam_policy(self):

@property
def get_iam_policy(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`DatabaseAdminClient.get_iam_policy`.

Gets the access control policy for a database resource. Returns an empty
policy if a database exists but does not have a policy set.
Expand All @@ -234,7 +234,7 @@ def get_iam_policy(self):

@property
def test_iam_permissions(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`DatabaseAdminClient.test_iam_permissions`.

Returns permissions that the caller has on the specified database
resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def channel(self):

@property
def list_instance_configs(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`InstanceAdminClient.list_instance_configs`.

Lists the supported instance configurations for a given project.

Expand All @@ -123,7 +123,7 @@ def list_instance_configs(self):

@property
def get_instance_config(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`InstanceAdminClient.get_instance_config`.

Gets information about a particular instance configuration.

Expand All @@ -136,7 +136,7 @@ def get_instance_config(self):

@property
def list_instances(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`InstanceAdminClient.list_instances`.

Lists all instances in the given project.

Expand All @@ -149,7 +149,7 @@ def list_instances(self):

@property
def get_instance(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`InstanceAdminClient.get_instance`.

Gets information about a particular instance.

Expand All @@ -162,7 +162,7 @@ def get_instance(self):

@property
def create_instance(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`InstanceAdminClient.create_instance`.

Creates an instance and begins preparing it to begin serving. The
returned ``long-running operation`` can be used to track the progress of
Expand Down Expand Up @@ -205,7 +205,7 @@ def create_instance(self):

@property
def update_instance(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`InstanceAdminClient.update_instance`.

Updates an instance, and begins allocating or releasing resources as
requested. The returned ``long-running operation`` can be used to track
Expand Down Expand Up @@ -253,7 +253,7 @@ def update_instance(self):

@property
def delete_instance(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`InstanceAdminClient.delete_instance`.

Deletes an instance.

Expand All @@ -276,7 +276,7 @@ def delete_instance(self):

@property
def set_iam_policy(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`InstanceAdminClient.set_iam_policy`.

Sets the access control policy on an instance resource. Replaces any
existing policy.
Expand All @@ -293,7 +293,7 @@ def set_iam_policy(self):

@property
def get_iam_policy(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`InstanceAdminClient.get_iam_policy`.

Gets the access control policy for an instance resource. Returns an
empty policy if an instance exists but does not have a policy set.
Expand All @@ -310,7 +310,7 @@ def get_iam_policy(self):

@property
def test_iam_permissions(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`InstanceAdminClient.test_iam_permissions`.

Returns permissions that the caller has on the specified instance
resource.
Expand Down
36 changes: 18 additions & 18 deletions spanner/google/cloud/spanner_v1/gapic/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@ class TypeCode(enum.IntEnum):
STRUCT = 9


class ExecuteSqlRequest(object):
class QueryMode(enum.IntEnum):
"""
Mode in which the statement must be processed.

Attributes:
NORMAL (int): The default mode. Only the statement results are returned.
PLAN (int): This mode returns only the query plan, without any results or
execution statistics information.
PROFILE (int): This mode returns both the query plan and the execution statistics along
with the results.
"""

NORMAL = 0
PLAN = 1
PROFILE = 2


class PlanNode(object):
class Kind(enum.IntEnum):
"""
Expand All @@ -97,21 +115,3 @@ class Kind(enum.IntEnum):
KIND_UNSPECIFIED = 0
RELATIONAL = 1
SCALAR = 2


class ExecuteSqlRequest(object):
class QueryMode(enum.IntEnum):
"""
Mode in which the statement must be processed.

Attributes:
NORMAL (int): The default mode. Only the statement results are returned.
PLAN (int): This mode returns only the query plan, without any results or
execution statistics information.
PROFILE (int): This mode returns both the query plan and the execution statistics along
with the results.
"""

NORMAL = 0
PLAN = 1
PROFILE = 2
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def channel(self):

@property
def create_session(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.create_session`.

Creates a new session. A session can be used to perform transactions
that read and/or modify data in a Cloud Spanner database. Sessions are
Expand Down Expand Up @@ -137,7 +137,7 @@ def create_session(self):

@property
def get_session(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.get_session`.

Gets a session. Returns ``NOT_FOUND`` if the session does not exist.
This is mainly useful for determining whether a session is still alive.
Expand All @@ -151,7 +151,7 @@ def get_session(self):

@property
def list_sessions(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.list_sessions`.

Lists all sessions in a given database.

Expand All @@ -164,7 +164,7 @@ def list_sessions(self):

@property
def delete_session(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.delete_session`.

Ends a session, releasing server resources associated with it.

Expand All @@ -177,7 +177,7 @@ def delete_session(self):

@property
def execute_sql(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.execute_sql`.

Executes an SQL statement, returning all results in a single reply. This
method cannot be used to return a result set larger than 10 MiB; if the
Expand All @@ -200,7 +200,7 @@ def execute_sql(self):

@property
def execute_streaming_sql(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.execute_streaming_sql`.

Like ``ExecuteSql``, except returns the result set as a stream. Unlike
``ExecuteSql``, there is no limit on the size of the returned result
Expand All @@ -216,7 +216,7 @@ def execute_streaming_sql(self):

@property
def read(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.read`.

Reads rows from the database using key lookups and scans, as a simple
key/value style alternative to ``ExecuteSql``. This method cannot be
Expand All @@ -239,7 +239,7 @@ def read(self):

@property
def streaming_read(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.streaming_read`.

Like ``Read``, except returns the result set as a stream. Unlike
``Read``, there is no limit on the size of the returned result set.
Expand All @@ -255,7 +255,7 @@ def streaming_read(self):

@property
def begin_transaction(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.begin_transaction`.

Begins a new transaction. This step can often be skipped: ``Read``,
``ExecuteSql`` and ``Commit`` can begin a new transaction as a
Expand All @@ -270,7 +270,7 @@ def begin_transaction(self):

@property
def commit(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.commit`.

Commits a transaction. The request includes the mutations to be applied
to rows in the database.
Expand All @@ -290,7 +290,7 @@ def commit(self):

@property
def rollback(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.rollback`.

Rolls back a transaction, releasing any locks it holds. It is a good
idea to call this for any transaction that includes one or more ``Read``
Expand All @@ -309,7 +309,7 @@ def rollback(self):

@property
def partition_query(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.partition_query`.

Creates a set of partition tokens that can be used to execute a query
operation in parallel. Each of the returned partition tokens can be used
Expand All @@ -332,7 +332,7 @@ def partition_query(self):

@property
def partition_read(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`SpannerClient.partition_read`.

Creates a set of partition tokens that can be used to execute a read
operation in parallel. Each of the returned partition tokens can be used
Expand Down
10 changes: 5 additions & 5 deletions spanner/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2018-12-07T13:26:48.951251Z",
"updateTime": "2019-01-04T18:38:23.269891Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.2",
"dockerImage": "googleapis/artman@sha256:2f6b261ee7fe1aedf238991c93a20b3820de37a343d0cacf3e3e9555c2aaf2ea"
"version": "0.16.4",
"dockerImage": "googleapis/artman@sha256:8b45fae963557c3299921037ecbb86f0689f41b1b4aea73408ebc50562cb2857"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "200fbbe59cc7b0077ae525eb5f3d6420c0c53e61",
"internalRef": "224174014"
"sha": "c050b8885af23bfbc4e2858858db47e33e311da7",
"internalRef": "227870263"
}
},
{
Expand Down
9 changes: 9 additions & 0 deletions spanner/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,13 @@
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

# Template's MANIFEST.in does not include the needed GAPIC config file.
# See PR #6928.
s.replace(
"MANIFEST.in",
"include README.rst LICENSE\n",
"include README.rst LICENSE\n"
"include google/cloud/spanner_v1/gapic/transports/spanner.grpc.config\n",
)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)