> ## Documentation Index
> Fetch the complete documentation index at: https://vexidata.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Supabase

> Connect your Supabase PostgreSQL database to VexiData.

## Prerequisites

* A [Supabase](https://supabase.com) account with an existing project
* A [VexiData](https://vexidata.com) account

## Understanding Supabase connection modes

Supabase offers two ways to connect to your database. Choosing the right one matters:

|                     | Transaction Pooler                   | Direct Connection                    |
| ------------------- | ------------------------------------ | ------------------------------------ |
| **Port**            | `6543`                               | `5432`                               |
| **Best for**        | Serverless, short-lived connections  | Persistent, long-running connections |
| **Username format** | `postgres.[project-ref]`             | `postgres`                           |
| **Host**            | `aws-0-[region].pooler.supabase.com` | `db.[project-ref].supabase.co`       |

<Tip>
  For VexiData, we recommend the **Transaction Pooler** (port `6543`). VexiData connects on-demand when running queries, so the pooler is the best fit and provides better performance.
</Tip>

## Connect Supabase to VexiData

<Steps>
  <Step title="Get your Supabase connection details">
    1. Log in to your [Supabase Dashboard](https://supabase.com/dashboard)
    2. Select the project you want to connect
    3. Go to **Project Settings** (gear icon) > **Database**
    4. Under **Connection string**, select the **URI** tab
    5. Choose **Transaction Pooler** mode (recommended)
    6. Copy the connection string — it looks like this:

    ```
    postgresql://postgres.[project-ref]:[YOUR-PASSWORD]@aws-0-[region].pooler.supabase.com:6543/postgres
    ```

    Extract the following values from the connection string:

    | Parameter    | Value                               | Example                                        |
    | ------------ | ----------------------------------- | ---------------------------------------------- |
    | **Host**     | Everything between `@` and the port | `aws-0-us-east-1.pooler.supabase.com`          |
    | **Port**     | Number after the host               | `6543`                                         |
    | **Username** | Between `://` and `:`               | `postgres.ynoocxmcrtjifofktnoa`                |
    | **Password** | Your database password              | The password you set when creating the project |
    | **Database** | After the last `/`                  | `postgres`                                     |
  </Step>

  <Step title="Whitelist VexiData's IP addresses">
    If your Supabase project has network restrictions enabled, add VexiData's IP addresses to your allowlist:

    * `46.101.71.122`

    You can manage network restrictions in **Project Settings** > **Database** > **Network Restrictions** in Supabase.

    <Info>
      By default, Supabase allows connections from all IP addresses. You only need this step if you have explicitly enabled network restrictions.
    </Info>
  </Step>

  <Step title="Add the connection in VexiData">
    1. Go to [Data Sources](https://vexidata.com/data-sources) in VexiData
    2. Click **PostgreSQL** to open the connection form
    3. Fill in the details:

    | Field            | Value                                                                |
    | ---------------- | -------------------------------------------------------------------- |
    | **Display Name** | A name to identify this connection (e.g., "Supabase Production")     |
    | **Host**         | `aws-0-[region].pooler.supabase.com`                                 |
    | **Port**         | `6543`                                                               |
    | **Database**     | `postgres`                                                           |
    | **Schema**       | `public` (default — change if your tables are in a different schema) |
    | **Username**     | `postgres.[project-ref]`                                             |
    | **Password**     | Your database password                                               |
  </Step>

  <Step title="Test and save">
    Click **Test & Save Connection**. VexiData will verify it can reach your database. Once connected, your schema will be analyzed automatically.
  </Step>
</Steps>

## Finding your database password

If you don't remember your database password, you can reset it in Supabase:

1. Go to **Project Settings** > **Database**
2. Under **Database Password**, click **Reset Database Password**

<Note>
  Resetting your database password will break any existing connections using the old password. Update them after resetting.
</Note>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection timed out">
    * Verify that VexiData's IP addresses are allowlisted if you have network restrictions enabled
    * Check that you're using the correct host and port for your chosen connection mode
    * Ensure your Supabase project is not paused — free-tier projects pause after inactivity
  </Accordion>

  <Accordion title="Authentication failed">
    * Double-check your username format — the Transaction Pooler requires `postgres.[project-ref]`, not just `postgres`
    * Verify your password is correct. If unsure, reset it in Supabase Project Settings
    * Make sure you're not mixing up Direct Connection and Transaction Pooler credentials
  </Accordion>

  <Accordion title="No tables visible after connecting">
    * Confirm your tables are in the `public` schema. If they're in a custom schema, update the **Schema** field in VexiData
    * Check that the database user has `SELECT` permissions on the tables you want to query
  </Accordion>

  <Accordion title="Connection works but queries are slow">
    * If your Supabase project is on the free tier, it may be running on shared infrastructure with limited resources
    * Consider upgrading your Supabase plan for better performance
  </Accordion>
</AccordionGroup>
