> ## 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.

# Heroku

> Connect your Heroku Postgres or JawsDB Maria database to VexiData.

## Prerequisites

* A [Heroku](https://heroku.com) account with a Heroku Postgres add-on attached to an app
* A [VexiData](https://vexidata.com) account

## Connect Heroku Postgres to VexiData

<Steps>
  <Step title="Get your Heroku Postgres credentials">
    1. Log in to your [Heroku Dashboard](https://dashboard.heroku.com)
    2. Select the app with the Postgres add-on
    3. Go to the **Resources** tab
    4. Click on the **Heroku Postgres** add-on to open its dashboard
    5. Go to **Settings** > **Database Credentials** > **View Credentials**
    6. Copy the individual connection parameters:

    | Parameter    | Example                                     |
    | ------------ | ------------------------------------------- |
    | **Host**     | `ec2-12-34-567-890.compute-1.amazonaws.com` |
    | **Port**     | `5432`                                      |
    | **Database** | `d1abc2defgh3ij`                            |
    | **Username** | `abcdefghijklmn`                            |
    | **Password** | Your database password                      |

    <Tip>
      You can also find the connection string in your app's **Settings** > **Config Vars** under `DATABASE_URL`.
    </Tip>
  </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., "Heroku Production")        |
    | **Host**         | Your EC2 hostname (e.g., `ec2-12-34-567-890.compute-1.amazonaws.com`) |
    | **Port**         | `5432`                                                                |
    | **Database**     | Your database name (e.g., `d1abc2defgh3ij`)                           |
    | **Schema**       | `public` (default — change if your tables are in a different schema)  |
    | **Username**     | Your database username                                                |
    | **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>

## Credential rotation

<Note>
  Heroku **automatically rotates** database credentials during maintenance events, hardware failures, and security incidents. When this happens, your host, username, and password may all change.

  If your VexiData connection stops working unexpectedly, check your Heroku Postgres credentials and update them in VexiData.
</Note>

To update your credentials in VexiData:

1. Get the new credentials from Heroku (see Step 1 above)
2. Go to [Data Sources](https://vexidata.com/data-sources) in VexiData
3. Click the edit button on your Heroku connection
4. Update the host, username, and password with the new values
5. Click **Update Connection**

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection suddenly stopped working">
    * This is most likely caused by **credential rotation**. Heroku rotates credentials during maintenance and security events. Get your new credentials from the Heroku Postgres dashboard and update them in VexiData
    * Check that your Heroku Postgres add-on is still active and not deprovisioned
  </Accordion>

  <Accordion title="Connection timed out">
    * Verify that your Heroku app and Postgres add-on are running (not in maintenance mode)
    * Heroku Postgres is hosted on AWS — occasional connectivity issues may occur during AWS infrastructure maintenance
  </Accordion>

  <Accordion title="Authentication failed">
    * Heroku credentials change over time. Always get the latest credentials from the Heroku Postgres dashboard, not from old notes or saved passwords
    * Make sure you're copying from **Database Credentials** in the Postgres add-on dashboard, not from old config vars
  </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
    * Heroku Postgres uses auto-generated database names (e.g., `d1abc2defgh3ij`). Make sure you copied the correct one
  </Accordion>
</AccordionGroup>

***

## Connect JawsDB Maria (MariaDB) to VexiData

Heroku supports MariaDB through the **JawsDB Maria** add-on — a fully managed MariaDB database service with automatic failover and geographic replication.

<Steps>
  <Step title="Install the JawsDB Maria add-on">
    If you haven't already added JawsDB Maria to your app:

    1. Go to your app's **Resources** tab in the [Heroku Dashboard](https://dashboard.heroku.com)
    2. Search for **JawsDB Maria** in the Add-ons section
    3. Select a plan and click **Submit Order Form**

    Or install via the CLI:

    ```bash theme={null}
    heroku addons:create jawsdb-maria
    ```
  </Step>

  <Step title="Get your connection credentials">
    1. Go to your app's **Settings** > **Config Vars**
    2. Find the `JAWSDB_MARIA_URL` variable
    3. The format is: `mysql://username:password@hostname:3306/database_name`
    4. Parse the individual parameters:

    | Parameter    | Example                           |
    | ------------ | --------------------------------- |
    | **Host**     | `abc123xyz.mshared.amazonaws.com` |
    | **Port**     | `3306`                            |
    | **Database** | `default_schema`                  |
    | **Username** | `u1a2b3c4d5e6f7g`                 |
    | **Password** | Your database password            |

    <Tip>
      You can also view credentials in the JawsDB dashboard by clicking the **JawsDB Maria** add-on in your app's **Resources** tab.
    </Tip>
  </Step>

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

    | Field            | Value                                                          |
    | ---------------- | -------------------------------------------------------------- |
    | **Display Name** | A name to identify this connection (e.g., "Heroku MariaDB")    |
    | **Host**         | Your JawsDB hostname (e.g., `abc123xyz.mshared.amazonaws.com`) |
    | **Port**         | `3306`                                                         |
    | **Database**     | Your database name                                             |
    | **Username**     | Your JawsDB username                                           |
    | **Password**     | Your JawsDB 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>

### JawsDB Maria troubleshooting

<AccordionGroup>
  <Accordion title="Query limit exceeded">
    JawsDB shared plans have hourly query limits (e.g., 3,600 queries/hour on the free Kitefin plan). If you hit this limit, queries will be temporarily blocked. Consider upgrading to a higher plan for more capacity.
  </Accordion>

  <Accordion title="Storage limit reached">
    If your database exceeds the plan's storage limit, INSERT privileges are revoked. You'll need to delete data or upgrade your plan to restore write access. VexiData only reads data, so existing queries will still work.
  </Accordion>

  <Accordion title="Connection failed after add-on creation">
    JawsDB Maria takes a few minutes to provision after installation. If the `JAWSDB_MARIA_URL` config var contains a placeholder or the connection fails immediately after creation, wait a few minutes and try again.
  </Accordion>
</AccordionGroup>
