DbSchema for Google Cloud Spanner Database
DbSchema is a powerful database management and design tool for Google Cloud Spanner. It offers features such as
visual schema design, team collaboration with GIT, schema deployment and HTML schema documentation.
How to Connect to Google Cloud Spanner Database
- Access the Connection Dialog
Choose "Connect to the database" or "New Model Connected to the Database" will let you select your database
and open the Connection Dialog.
DbSchema automatically downloads the
JDBC driver to connect to your database.
- Configure the Connection
In the Connection Dialog window, select the JDBC URL you want to connect with. If your database is running in the cloud,
choose Edit Manually and insert the JDBC URL from the cloud console.
Enter the host name, the authentication details, select your database as described in the Connection Dialog page.
- Troubleshoot Firewall Issues
If you encounter connection issues, it may be due to firewall settings. Read how to enable Firewall Connections.
Firewalls & anti-viruses may block database connections.
In the DbSchema connection dialog you will have to specify the ProjectId, InstanceId and DatabaseId which can be fond in the Google console.
Also you will have to set an GOOGLE_APPLICATION_CREDENTIALS pointing to the authentication json file, which is generated on Google Credentials Console.
Generate Authentication JSON File
.
The simplest way to get a credential for this purpose is to create a Service account key in the Google API Console:
- Go to the API Console Credentials page.
- From the project drop-down, select your project.
- On the Credentials page, select the Create credentials drop-down, then select Service account key.
- From the Service account drop-down, select New Service Account.
- Name the service account and select Role as Project Owner from the drop down.
- For Key type, select the JSON key option, then select Create. The file automatically downloads to your computer.
- Put the *.json file you just downloaded in a directory of your choosing.
- Set the System Environment Variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file downloaded.