Google Cloud SQL
Connect Google Cloud SQL for PostgreSQL or MySQL with a connection string over TLS.
Reads tables from a Google Cloud SQL instance. Cloud SQL runs the stock PostgreSQL and MySQL engines, so it connects exactly like a self-hosted database. Flitch connects over the instance's public IP, so it only issues read queries and can never write to your database.
Add a source
Cloud SQL comes in two engines. Pick the tile that matches yours: Cloud SQL Postgres or Cloud SQL MySQL.
Prerequisites
- A Cloud SQL instance with a public IP, and an authorized network allowing Flitch's connector egress IP.
- A user with read access to the tables you want.
Create a read-only user
CREATE USER flitch_readonly WITH PASSWORD 'choose-a-strong-password';
GRANT CONNECT ON DATABASE mydb TO flitch_readonly;
GRANT USAGE ON SCHEMA public TO flitch_readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO flitch_readonly;Build the connection string
Copy the public IP from the Cloud SQL console (your instance → Overview → Connect to this instance).
postgresql://flitch_readonly:password@34.x.x.x:5432/mydb?sslmode=requireOpen the form
Go to Data → Add → Cloud SQL Postgres, paste the connection string, then pick datasets.
Create a read-only user
CREATE USER 'flitch_readonly'@'%' IDENTIFIED BY 'choose-a-strong-password';
GRANT SELECT ON mydb.* TO 'flitch_readonly'@'%';
FLUSH PRIVILEGES;Build the connection string
mysql://flitch_readonly:password@34.x.x.x:3306/mydb?ssl-mode=REQUIREDOpen the form
Go to Data → Add → Cloud SQL MySQL, paste the connection string, then pick datasets.
Network access
Flitch connects from its own server, not your browser. Add Flitch's connector egress IP (shown in the Add Source form) to the instance's authorized networks (Connections → Networking → Authorized networks) and enable a public IP.
Team-wide credential (optional)
A team admin can store one shared credential in Settings → Data connections; new connections then default to it, with no per-connection secret.
Refresh
Refresh is off by default. Enable it to schedule a background refresh and serve from cache between runs. See Refresh.
Troubleshooting
Connection timed out. The egress IP is not in the instance's authorized networks, or the instance has no public IP. Add the IP and enable public IP.
Authentication failed. Check the user and password, and that the user can connect from any host.
SSL required. Keep sslmode=require (Postgres) or ssl-mode=REQUIRED (MySQL).