Connect to CloudSQL
Securely connect your Hex workspace to your CloudSQL (GCP) data warehouse.
- Users need the Admin workspace role to create a shared workspace data connection.
- Users need Can Edit or higher project permissions to create project data connections.
CloudSQL Google Cloud Platform (GCP)'s fully managed relational database service that supports MySQL, PostgreSQL, and SQL Server. It's designed primarily for transactional workloads—think web applications, e-commerce sites, and line-of-business applications—rather than large-scale analytics. Cloud SQL handles routine database management tasks like backups, replication, and patches automatically, making it easy to run traditional relational databases in the cloud without managing infrastructure.
CloudSQL is a good fit if you're running operational applications on GCP and need to query or visualize transactional data in Hex. However, it has some limitations with analytics workflows:
- Performance can degrade significantly with large datasets or complex analytical queries since it's built for transactional processing;
- You're limited by the compute and storage of a single database instance, unlike purpose-built data warehouses that scale horizontally.
How to get set up
- Sign up for free GCP / CloudSQL account if you don't have one.
- Set up a Service User Account in Google Cloud.
- In Hex, go to Settings → Data sources.
- Click + Connection, select CloudSQL, and fill out the fields below.
Basic settings
1.Database type - Select your database type

- Name and Description - Set a display name and optional description to help identify your data connection.

- Host - The address of your CloudSQL database.
- Port - The port used for secure native connections to your CloudSQL database.
- Authentication - Choose your authentication method, if applicable (username and password, or certificate). Then fill out the required fields.
Additional settings
The data connection form includes several optional sections:
- Advanced - Optional settings like custom SQL formatting, including schema data for AI, and connecting via SSH.
- Access - Optional data connection permissions.
- Schema browsing - Recommended settings like scheduling schema browser refreshes and schema filtering, both of which are recommended for performance and AI agent accuracy.
If you use a firewall to restrict database access, you'll need to add Hex's IP addresses to your allowlist.