Connect an AlloyDB resource

Learn how to connect your AlloyDB database to Retool.

Retool's AlloyDB for PostgreSQL integration provides a convenient UI for connecting to and interacting with your Google Cloud Platform AlloyDB databases.

Connect to an AlloyDB database

First, create a new resource to connect to your AlloyDB database. Resources sit on top of our integrations and store the authentication and metadata fields required to connect to your data source.

To get started, log in to Retool and select the Resources tab. Click Create new and then select AlloyDB as your resource type. Give your resource a name (e.g., Transaction Database), enter the host, port, and name of your database, and your authentication credentials. These are the credentials Retool uses when your apps run queries.

Accessing AlloyDB from the cloud

AlloyDB currently only supports network connectivity through private, internal IP addresses configured for private services access. To connect to your database from Retool's cloud product, configure an AlloyDB Auth proxy on GCP, or use Retool's SSH connection option to go through a bastion host in your VPC.

Query AlloyDB

You can now select your newly-created AlloyDB resource from the Select Resource dropdown when creating queries in your Retool apps. You can toggle between SQL mode for raw SQL statements, or the GUI mode for structured writes.

Since AlloyDB is fully compatible with PostgreSQL, our SQL query editor provides PostgreSQL syntax highlighting and auto-complete.