# Managing database connections

{% hint style="info" %}
The ability to add database connections to a database is currently in private preview. To request access, contact Tonic.ai.
{% endhint %}

{% hint style="info" %}
Database connections require an Enterprise license.

Your external database must allow connections from the following Fabricate IP addresses:

* US instance (<https://fabricate.tonic.ai/>)
  * 184.72.239.148
  * 3.231.122.192
* EU instance (<http://eu.fabricate.tonic.ai/>)
  * 3.67.149.135
  * 3.69.97.191
    {% endhint %}

In a Data Agent database, you can create and manage a set of connections to external databases.

You can use a database connection as a resource to guide the structure of the generated data or as a source of data to incorporate into the generated data.

You can also generate data to a database connection instead of directly to Fabricate. The data is then immediately available to use, instead of having to go through additional steps to export the data or to push it to a database.

## Viewing the list of database connections

In the left navigation pane, the **Connections** section lists the database connections for the database. For example, you connect a live connection database to both an empty staging database and an existing production database. You might then generate data to the staging database based on the profile of the production database.

The database connection that you create when you create the live connection database is marked as the default.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FpYJxm6ewouLjB05rTlH6%2FDatabase_LiveConnectionConnections.png?alt=media&#x26;token=de984c86-326a-4b31-82d6-be465732cb6c" alt=""><figcaption><p>Connections list for a database</p></figcaption></figure>

## Supported database platforms

Live connection databases can connect to the following databases:

* MySQL
* Oracle
* PostgreSQL
* SQL Server

## Displaying the schema for a database connection

The displayed schema information, including the list of tables and the structure of the tables, is based on the currently selected connected database connection.

To display the schema for a database connection, in the **Connections** list, click the database connection name.

## Adding a database connection

To add a database connection:

1. In the **Connections** list, click the **+** icon.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2F8d9kFyKO9xviDHoazgiI%2FDatabase_LiveConnectionNewTarget.png?alt=media&#x26;token=0db668e3-4cfc-4e70-8b59-1638512f476c" alt=""><figcaption><p> New Target Database Connection to add a database connection to a live connection database</p></figcaption></figure>

2. In the **Connection Name** field, provide a name to use to identify the database connection.
3. From the **Server Connection** dropdown list, select the server connection where the database is located.\
   \
   You can optionally add a new server connection or edit the selected server connection.\
   \
   New server connections are added to the [available server connections for the workspace](https://docs.tonic.ai/fabricate/workspaces/workspace-server-connections).\
   \
   Note that any edits to the selected server connection apply to all of the locations where the server connection is used.
4. In the **Database Name** field, provide the name of the database.
5. To test the connection to the database, click **Test Connection**.
6. To save the database connection, click **Create Connection**.

## Editing a database connection

You can change a database connection. You can select a different server connection, or choose a different database.

To edit a database connection:

1. In the **Connections** list, click the edit icon for the database connection.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FNUNKpWqOBcSfKdIck4tG%2FDatabase_LiveConnectionTargetEdit.png?alt=media&#x26;token=ca4d7ef9-c6c6-4605-b10b-e88d31e696a3" alt=""><figcaption><p>Edit Target Database Connection panel to change a database connection</p></figcaption></figure>

2. From the details panel, you can:
   * Change the name of the database connection. You can change the name of the default database connection, but it is still marked as the default.
   * Select a different server connection.
   * Select a different database.
3. Click **Save Changes**.

## Deleting a database connection

For a live connection database, you cannot delete the default database connection.

You can delete other database connections.

To delete a database connection:

1. In the **Connections** list, click the edit icon for the database connection.
2. On the details panel, click **Delete**.
