Module client (3.41.0)

Parent client for calling the Cloud Spanner API.

This is the base from which all interactions with the API occur.

In the hierarchy of API concepts

Classes

Client

Client(project=None, credentials=None, client_info=<google.api_core.gapic_v1.client_info.ClientInfo object>, client_options=None, query_options=None, route_to_leader_enabled=True, directed_read_options=None)

Client for interacting with Cloud Spanner API.

Parameters
NameDescription
project str or unicode

(Optional) The ID of the project which owns the instances, tables and data. If not provided, will attempt to determine from the environment.

credentials Credentials or :data:NoneType

(Optional) The authorization credentials to attach to requests. These credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment.

client_info google.api_core.gapic_v1.client_info.ClientInfo

(Optional) The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you're developing your own library or partner tool.

client_options google.api_core.client_options.ClientOptions or dict

(Optional) Client options used to set user options on the client. API Endpoint should be set through client_options.

query_options QueryOptions or dict

(Optional) Query optimizer configuration to use for the given query. If a dict is provided, it must be of the same form as the protobuf message QueryOptions

route_to_leader_enabled boolean

(Optional) Default True. Set route_to_leader_enabled as False to disable leader aware routing. Disabling leader aware routing would route all requests in RW/PDML transactions to the closest region.

directed_read_options DirectedReadOptions or dict

(Optional) Client options used to set the directed_read_options for all ReadRequests and ExecuteSqlRequests that indicates which replicas or regions should be used for non-transactional reads or queries.

Exceptions
TypeDescription
`ValueErro