Features

Using Custom Schemas

Using Custom Schemas

You can add multiple Supabase schemas from a single Supabase project to a single Dreambase workspace

Pro+ Dreambase subscribers can easily add additional Supabase schemas to their Dreambase workspace via the Integrations settings page.


Prerequisites

To make your custom schema visible to REST API endpoints and tables securely accessible, you'll first need to adjust a Supabase setting and run a few queries.

From the Supabase docs:

You can expose custom database schemas - to do so you need to follow these steps:

  1. Go to API settings and add your custom schema to "Exposed schemas".

  2. Run the following SQL, substituting myschema with your schema name:

GRANT USAGE ON SCHEMA myschema TO anon, authenticated, service_role;
GRANT ALL ON ALL TABLES IN SCHEMA myschema TO anon, authenticated, service_role;
GRANT ALL ON ALL ROUTINES IN SCHEMA myschema TO anon, authenticated, service_role;
GRANT ALL ON ALL SEQUENCES IN SCHEMA myschema TO anon, authenticated, service_role;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA myschema GRANT ALL ON TABLES TO anon, authenticated, service_role;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA myschema GRANT ALL ON ROUTINES TO anon, authenticated, service_role;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA myschema GRANT ALL ON SEQUENCES TO anon, authenticated, service_role;


Add this custom schema to Dreambase

After you've successfully setup the permissions and settings in Supabase, navigate to your Workspace Settings > Integrations.

If you are a Pro+ user, click Add API:

In the New API Connection dialog enter these values:

  • Name: a human friendly name

  • API Type: supabase (this name is required)

  • Endpoint URL: https://<project_id>.supabase.co/rest/v1/ (enter your Supabase project id)

  • Auth Type: Bearer

  • Auth Token: (leave this empty)

  • Custom Headers

    • apikey: anon or public key from your Supabase Project Settings > API Keys page

    • Accept-Profile: myschema (your schema name)

  • HTTP Method: GET

Then click Test Connection

If successful, you should see Test Response with your custom schema name and API Test Successful.

Click Save to add this schema


Ensure the new API was scanned

After clicking Save, the API should automatically be scanned by our Agents to create schema documentation (this is critical). If the scan was successful you should see the AI Context button to review and edit your schema documentation (may require a refresh).

ProTip: Whenever any of your schemas change (new tables, etc) you can come here to re-scan the schema by clicking Edit, Test Connection, then Update the API and it will save the updated endpoints and automatically scan the updates.


Validate your new schema tables

Add a new Project and view the data sources, and you should now see your new schema tables with the prefix of your custom schema!

Slack Community

© 2025 Dream, Inc. All rights reserved.

© 2025 Dream, Inc. All rights reserved.