---
title: "SQL database integration"
description: "Connect a PostgreSQL, MySQL, SQL Server or MariaDB database to Softr, then build apps and dashboards on your tables or on your own SQL queries in Softr."
canonical: "https://docs.softr.io/integrations/sql-database"
updated: "2026-12-04"
---

# SQL database integration

PostgreSQL, MySQL, SQL Server, and MariaDB are SQL data sources for your structured data. In Softr, you can build custom apps and dashboards on these databases on Business and Enterprise plans.

## Connect a SQL database

Before you connect, get your database credentials (host, port, database name, user and password) and make sure you have permission to access the database.

1. In the [Softr Studio dashboard](https://studio.softr.io/dashboard/integrations), select **Integrations** in the left menu.

2. Select **Connect new**.

   ![The Integrations page of the dashboard, with the Connect new button](/data-sources/sql-database/integrations.webp)

3. In the **Select an integration** window, select **PostgreSQL**, **MySQL**, **SQL Server**, or **MariaDB**.

   ![The Select an integration window with PostgreSQL selected](/data-sources/sql-database/select-postgresql-integration.webp)

   _The Select an integration window with PostgreSQL selected_

4. Enter a **Name** to recognize the connection, then the **Host** (for example `db.example.com`), **Port**, **Database**, **User**, and **Password**. Make sure you have permission to access the database.

   Softr fills in the default port: `5432` for PostgreSQL, `3306` for MySQL and MariaDB, and `1433` for SQL Server.

   ![The Connect to PostgreSQL database window with the Name, Host, Port, Database, User, and Password fields filled in](/data-sources/sql-database/connect-postgresql.webp)

   _The Connect to PostgreSQL database window_

5. Select **Connect** to verify and establish the connection. If the connection fails, check your credentials and try again.

6. Optional: add Softr's IP addresses to the allowed list of your database: `3.120.79.212`, `3.123.159.186`, and `52.58.246.121`.

> **Tip**
>
> You can also keep your data in Softr Databases, built into Softr and ready for your apps and workflows. See [Softr Databases](/databases/overview).

## Use cases

| Use case                       | What it does                                                                                            |
| ------------------------------ | ------------------------------------------------------------------------------------------------------- |
| **Custom apps and dashboards** | Shows your structured data from PostgreSQL, MySQL, SQL Server or MariaDB in custom apps and dashboards. |
| **Internal team access**       | Gives your internal teams secure access to the data through an app.                                     |
| **Partner access**             | Gives external partners secure access to the data through an app.                                       |
| **Write data back**            | Forms in your app write data back to your SQL database.                                                 |

## Use a SQL database as a data source

> **Note**
>
> In apps built with Softr AI, connect your account, then ask Softr AI to build on the source. It reads the tables and builds the pages for you. See [Connect your data](/apps/connect-your-data). The block settings below apply to Classic apps.

### Connect your SQL data to a Classic app

Once your database is connected, you can use it in any app.

1. **Connect a block to a table**

   To display your data in the app, connect a [dynamic block](/classic/overview#visualize-data-with-building-blocks), such as [List](/classic/list-and-grid-blocks#list-block), [Grid](/classic/list-and-grid-blocks#grid-block), or [Table](/classic/table-block), to your SQL table.

   1. Open the block's **Source** tab and select your SQL account in **Account**.
   2. Select the **database** you want to use.
   3. For PostgreSQL and SQL Server, select the **schema**. MySQL and MariaDB have no schema field.
   4. Select the **table** you want to use, or add a new **query**.
   5. Optional: select the **primary field**.

   ![The Source tab of a List block with the Account, Database, Schema, and Table fields filled in](/data-sources/sql-database/list-source-panel.webp)

   _The Source tab of a List block connected to a PostgreSQL table_
2. **Map table columns to item fields**

   Choose which table properties the block shows, and map each one to a Softr field. For example, map an email column in the database to an email field in Softr.

   ![The Avatar URL field window with Display type set to Image](/data-sources/sql-database/map-image-field.webp)

   _Mapping an image field_

## Use a SQL database in workflows

Add an action from the **SQL** group of the step picker, then pick your SQL account, the database and the table.

| Action                      | What it does                                       |
| --------------------------- | -------------------------------------------------- |
| **Add record**              | Creates a single record                            |
| **Find record**             | Finds the first record that matches the conditions |
| **Find multiple records**   | Finds every record that meets the criteria         |
| **Update record**           | Updates a single record                            |
| **Update multiple records** | Updates several records at once                    |
| **Delete record**           | Deletes a single record                            |
| **Delete multiple records** | Deletes several records at once                    |

## FAQ

**Which plan do I need for a SQL database?**

SQL data sources are available on Business and Enterprise plans.

**Which databases can I connect?**

PostgreSQL, MySQL, SQL Server and MariaDB. Softr fills in the default port for each type.

**Can I update my SQL database from Softr?**

Yes. Create forms in Softr that write data back to your SQL database.

**Is my SQL data secure?**

Softr uses industry-standard encryption to protect your data.

**Can I connect several databases to one Softr app?**

Yes. Connect several SQL databases and use them in the same app.
