Database Connector

The Database Connector has an easy-to-use interface that lets you connect to any Google Cloud SQL MySQL, MySQL, Microsoft SQL Server, and Oracle database directly from your Google Sheet. Import/Export data, live test, automate queries, chain different queries.

Just configure the connection to your database and you can run any statement and get the data back.

It uses the Google JDBC service, a wrapper around the standard Java Database Connectivity technology.

Configure a connection

Click Add-ons -> Database Connector -> Manage Connections

The Connection Management pane will appear. You can use it to create, edit, copy, or delete your saved database connections. Click Add New to add a new connection.

To add a new connection you need to configure the Url, User, Password, and give it a name. You can also click Test to check if the connection is successful.

In order for the Google JDBC service to be able to connect to your database, you need to whitelist certain IP ranges. If the database is open to the public this will not be necessary, but this is seldom the case. The full range of IP addresses and documentation of the JDBC service can be found on the Google JDBC Guide. - - - - - - - - - -

Configure a query

Click Add-ons -> Database Connector -> Add New Query to open the New Query screen

Select one of your configured database connections.

In the “Query” area you can write your SELECT query. The syntax supports adding references to cells so you can write dynamic queries. Format for a cell reference: +++SheetName!CellReference+++

Example: Select * from Employees WHERE id=+++MySheet!A1+++ , where MySheet is the name of a sheet and the A1 cell contains a table name.

Type: you can run a query(select) or a statement(select, insert, update). Only queries return a dataset to import into your Google Sheets!

You can Test your configuration first to get the desired results, then save them for later use or for scheduling/chaining using the Schedule tab.

Leave a Reply

Your email address will not be published. Required fields are marked *