Skip to content

Supabase Connection

The Supabase connection integrates your Supabase PostgreSQL database with OpsTower, giving agents the ability to run read-only SQL queries against your data. All queries are limited to SELECT statements and return a maximum of 100 rows per query.

You need a Supabase account with an active project. Both free-tier and paid Supabase projects are supported.

To set up a Supabase connection, you need two pieces of information:

  • Project URL — the URL of your Supabase project
  • Service Role Key — a privileged API key for server-side access
  1. Log in to supabase.com and open your project.
  2. Go to Project Settings in the sidebar (the gear icon).
  3. Select API from the settings menu.
  4. Copy the Project URL shown at the top of the page. It follows the format https://abc123.supabase.co.
  1. In the same Project Settings > API page.
  2. Scroll to the Project API Keys section.
  3. Find the service_role key (not the anon key).
  4. Click Reveal to display the full key and copy it. It is a JWT that starts with eyJ.

Important: The service role key bypasses Row Level Security (RLS). OpsTower only runs read-only SELECT queries against your database, but you should treat this key as highly sensitive. Do not share it or expose it in client-side code.

  1. In OpsTower, navigate to Connections in the sidebar.
  2. Click Add Connection and select Supabase.
  3. Enter your Project URL and Service Role Key.
  4. Click Save to create the connection.

Once connected and enabled on an agent, the agent can:

  • Execute read-only SQL queries (SELECT statements only) against your PostgreSQL database
  • List all tables in the database
  • Inspect table schemas and relationships to understand your data model

All queries are validated as read-only before execution. Write operations (INSERT, UPDATE, DELETE, DROP, etc.) are rejected.

  • Authentication errors: Verify that you are using the service_role key, not the anon key. The anon key has limited permissions that may not cover all tables.
  • No data returned: Confirm that your project URL is correct and that the database contains data in the tables you are querying.
  • Connection refused: Ensure your Supabase project is active and not paused. Free-tier projects may be paused after a period of inactivity — reactivate them from the Supabase dashboard.
  • Missing tables: If you cannot see certain tables, verify that they exist in the public schema. Tables in other schemas may require explicit schema qualification in queries.