Supabase
Connect Supabase to Formula Bot using your Postgres credentials. Includes Session pooler guidance, SSL defaults, optional read-only user setup, and public schema recommendations.
Connect your Supabase Postgres database to Formula Bot to analyze tables with natural language, charts, and dashboards.
Prerequisites
- A Supabase project
- Database password for the
postgresrole or another database login you control - Network access to your Supabase pooler host
- A schema with read access, typically
public
Recommended Connection Settings
Use the Session pooler connection details from the Supabase Connect dialog. Supabase recommends Session pooler for persistent client traffic and environments that need IPv4 compatibility.
| Field | Description | Example |
|---|---|---|
| Host | Session pooler hostname | aws-1-us-east-2.pooler.supabase.com |
| Port | Postgres port | 5432 |
| Database | Database name | postgres |
| Username | Database user | postgres.your-project-ref |
| Password | Database password | ******** |
| SSL Mode | SSL connection mode | require |
| Schema | Default schema | public |
Supabase API keys like anon and service_role are not database credentials. Formula Bot connects through Postgres, so use the database password instead.
Optional: Create a Dedicated Read-Only User
Supabase recommends creating a separate Postgres user for external services instead of reusing the postgres role. If you want Formula Bot isolated to read-only access on your application tables, create a dedicated login like this:
CREATE ROLE formulabot WITH LOGIN PASSWORD 'replace-with-a-strong-password';
GRANT CONNECT ON DATABASE postgres TO formulabot;
GRANT USAGE ON SCHEMA public TO formulabot;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO formulabot;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO formulabot;
If your app tables live outside public, grant access to that schema instead and use the same schema name in Formula Bot.
Finding Your Credentials
- Open your Supabase project.
- Click Connect.
- Select the Session pooler string.
- Copy the host, port, username, and database values.
- Use your database password for the
postgresrole.
If you do not know the password, reset it in Database Settings inside Supabase.
If you are pasting a full connection string and your password contains special characters, URL-encode the password first.
Choosing the Right Connection Type
Session Pooler
Use this by default. It is the best fit for Formula Bot, deployed apps, and most hosted environments.
Direct Connection
Use the direct db.<project-ref>.supabase.co:5432 host only if your environment supports it and you intentionally want a direct database path. Supabase notes that direct connections typically rely on IPv6 unless you have the IPv4 add-on.
Transaction Pooler
Formula Bot’s Supabase connector is designed around the Session pooler and direct Postgres connection paths. Stick with Session pooler unless you have a specific operational reason to do otherwise.
Connect in Formula Bot
- Go to Connectors.
- Select Supabase.
- Enter your host, port, database, username, and password.
- Keep SSL Mode set to
require. - Keep the schema set to
publicunless you intentionally want another schema. - Click Test Connection and save.
Why Session Pooler Is Recommended
Supabase provides multiple Postgres connection options. Session pooler is the best default for Formula Bot because it works well in hosted environments and avoids common IPv6 or direct-connection issues.
Use the direct host only if your environment explicitly supports it and you know you want a non-pooler connection.
Example Questions
- "Show me the first 10 rows from events"
- "What event types are most common this week?"
- "Create a daily signup trend from my public.users table"
- "Build a dashboard for weekly active users and retention"
- "Which plans convert best from trial to paid?"
- "What tables in public look related to subscriptions or invoices?"
Security Notes
- Credentials are stored encrypted
- Queries are read-only
- SSL is enabled with
require - Keep access scoped to the tables and schema you actually want analyzed
- Prefer a dedicated read-only database user when possible
Troubleshooting
Authentication Failed
- Verify you used the database password, not an API key
- Confirm the username matches the connection string from Supabase Connect
- Reset the database password in Supabase if needed
Connection Works in Supabase but Not in Formula Bot
- Use the session pooler host instead of the direct database host
- Confirm the port is
5432 - Keep SSL mode set to
require - Confirm the database is usually
postgres
Password Parsing Errors
- If you are using a full connection string, URL-encode passwords that contain special characters
- Paste separate host, port, username, and password fields when possible to avoid encoding mistakes
No Tables Found
- Check that your tables live in the selected schema
- Make sure the connected user can read the schema and tables
- Confirm you are looking in
publicif that is where your app tables live