DbSchema Google Cloud Spanner ER Diagram Designer

DbSchema is a Google Cloud Spanner ER diagram database designer and query tool. Using DbSchema, you can design and document Google Cloud Spanner databases while connected to the database server or without a connection.

Next, you can share the design with the team using Git. The design model loaded in DbSchema can be compared with the database, synchronization scripts can be generated, and the schema can be deployed to any database server.

DbSchema Database Designer

Download DbSchema

How to Connect to Google Cloud Spanner Database

  1. 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.

  2. Configure the Connection
  3. 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.

  4. Troubleshoot Firewall Issues
  5. If you encounter connection issues, it may be due to firewall settings. Read how to enable Firewall Connections.
Remember to enable Windows Firewalls 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.

Google Cloud Spanner 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.
    Create Google Cloud Spanner Account
  • 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.
    Create Google Cloud Spanner Account