---
title: "Writable connection"
description: "Add an optional separate database connection for write operations like transforms or editable tables to keep the main Metabase connection read-only for analytics."
url: "https://www.metabase.com/docs/latest/databases/writable-connection"
version: "65"
---

> For the complete documentation index, see [llms.txt](https://www.metabase.com/docs/llms.txt).

# Writable connection

> Writable connection requires the [Advanced transforms add-on](https://www.metabase.com/docs/latest/data-modeling/transforms/addons.md)

_Admin > Databases > Writable connection_

Writable connection is an optional connection that Metabase will use for functionality that involves writing into the database (for example, transforms or CSV uploads). This allows you to keep your main Metabase connection read-only, and only to switch to a connection with write permissions for the operations that require write access.

![Writable connection in database settings](https://www.metabase.com/docs/latest/databases/images/writeable-connection.png)

## How writable connection works

Writable connection is an additional connection option added to an existing database connection.

When a writable connection is configured for a database, Metabase automatically switches between connections behind the scenes based on what people are doing with the database. The main connection is used for querying, and the writable connection is used for [features that require writes](#features-that-use-writable-connection).

Writable connection can use a different database user than the main connection, or even connect to a different database. For example, your main connection (used for querying) can go to a read replica, but the writable connection can be to a primary database.

## Add a writable connection

To add a writable connection to a database:

1. Go to **Admin > Databases**.
2. Select the database to add a writable connection to.
3. Under **Writable connection**, click **Add writable connection**.
4. Metabase will pre-fill some fields with information from your main connection. Input the credentials for the writable connection.
5. Click **Save**. Metabase will try to connect using the new connection.

## Remove a writable connection

To remove a writable connection from a database:

1. Go to **Admin > Databases**.
2. Select the database you want to remove the writable connection from.
3. Under **Writable connection**, click **Remove writable connection**.

Once writable connection is removed, Metabase will revert to using the main connection for [features that need write access](#features-that-use-writable-connection), so your main connection will need to have appropriate database permissions, see [Users, roles, and privileges](https://www.metabase.com/docs/latest/databases/users-roles-privileges.md)

## Features that use writable connection

When configured, writable connection will be used for:

- [Transforms](https://www.metabase.com/docs/latest/data-modeling/transforms/transforms-overview.md)
- [CSV uploads](https://www.metabase.com/docs/latest/databases/uploads.md)
- [Editable tables](https://www.metabase.com/docs/latest/data-modeling/editable-tables.md)
- [Actions](https://www.metabase.com/docs/latest/data-modeling/data-actions.md)
- [Model persistence](https://www.metabase.com/docs/latest/data-modeling/models/model-persistence.md)

Your writable connection will need to have the privileges required for these operations. See [Users, roles, and privileges](https://www.metabase.com/docs/latest/databases/users-roles-privileges.md).

## Limitations

- Writable connection can't be used with [database routing](https://www.metabase.com/docs/latest/permissions/database-routing.md).

- Writable connection must use the same database engine as the primary connection - so for example, if the primary connection is to a PostgreSQL database, the writable connection must be to a PostgreSQL database as well.
