Implementation
This handler was implemented using thegoogle-cloud-spanner Python client library.
The required arguments to establish a connection are as follows:
instance_idis the instance identifier.database_idis the database identifier.projectis the identifier of the project that owns the resources.credentialsis a stringified GCP service account key JSON.
If you installed MindsDB locally via pip, you need to install all handler dependencies manually. To do so, go to the handler’s folder (mindsdb/integrations/handlers/cloud_spanner_handler) and run this command:
pip install -r requirements.txt.Usage
In order to make use of this handler and connect to the Cloud Spanner database in MindsDB, the following syntax can be used:Cloud Spanner supports both PostgreSQL and GoogleSQL dialects. However, not all PostgresSQL features are supported.