Retool Database

Store data in a Retool-hosted database with a spreadsheet-like interface.



Retool Database is currently in beta for Retool Cloud organizations. You can store up to 50,000 records or 1GB of storage (whichever comes first) for free. Create a free Retool account to get started โ†’

Retool Database is a fast, secure solution for saving and editing data to use in Retool apps. It combines a PostgreSQL database that's hosted by Retool with a spreadsheet-like interface to manage hosted data.

Retool Database


With Retool Database, you can:

Get started

Log in to Retool and navigate to the Resources tab. If you don't have an account yet, sign up for free.

The Retool Database resource, available in the Retool Hosted section, represents your Retool-hosted PostgreSQL database resource. You can view and manage your database and the data it contains using the Database editor UI, or configure resource settings, such as environments.

Retool Database resource

Interact with data using the Database editor UI

You can visually interact with your Retool-hosted database much like a spreadsheet. To access it, hover the cursor over the resource and click View.

Databases organize data into tables that can have different structures (e.g., separate tables for product and customer data). Each tab along the top of the interface corresponds to a tableโ€”click on a tab to view its data.

You can open the Table options menu by clicking the arrow next to the name.

Database tables


You can quickly navigate between tables using the Quick open menu on the left or pressing CMD/CTRL-K.

Click on a field's name in the header to open the Field options menu that provides access to various options.

Field options menu

To quickly edit existing table data, double-click on a cell and update its value, then click Save. You can also interact with certain fields using checkboxes or select options.

Update text in a cell

Create tables

Retool Database prompts you to create a new table automatically if one doesn't already exist. You can create an empty table or import existing data in CSV format.

Import CSV

To import existing CSV-formatted data, drag a file onto the drop zone. Once you upload a file, Retool attempts to identify the type for each field of CSV-formatted data and map it to an appropriate field type to create a table schema.

New CSV import

You have the opportunity to review and make changes to the new table schema in the Schema mapping section before importing data. You can change field names and types, drag fields to change their order, or remove certain fields from being imported by clicking the X button.

You can also configure how imports are processed using the Import settings section.

  • Column heading: Use the first record of CSV-formatted data to set field names.
  • Create a primary key: Create a primary key field for imported data (recommended).
  • Use a CSV column: Select an existing CSV field to use as the primary key. This is useful if you are importing data with an existing primary key (e.g., id). If turned off, Retool creates a new primary key field and sets values.

Set the primary key

A primary key is a field that uniquely identifies each table record. Retool automatically includes an id field for the primary key when you create a new table and it's the default option during a CSV import.

You can configure a table's primary key at any time. Click the table's tab and select Edit Primary Key, then select a field in the New Primary Key dropdown menu.

Edit primary key

If your data doesn't contain a single field that can uniquely identify records, you can use a composite key. When enabled, you can select multiple fields and use their combined values as a primary key.

Use a composite key

If necessary, you can delete a table's primary key. Tables without a primary key are read-only and you cannot make changes to data unless there is a primary key set.

Copy table schema

You can create a new, empty table based on an existing table's schema. Open the Table options menu for an existing table and select Copy schema. Retool creates a new table and configures it with the same fields.

Copy schema

Tables created using an existing schema do not have a primary key set and are initially read-only. You must configure a primary key before you can edit table data.

Add or edit records

Click Add record to save new data to the current table. This opens the Add record modal that contains input fields generated from the current table's schema. Each input reflects the field's type, whether the field is nullable, and any default value.

After completing the form, click Create to save the record to the table.

Add record

You can also edit existing records using the same modal by clicking the Expand button that appears when hovering the cursor over a record.

Edit record

To delete records, select them using the checkbox and click the red Delete button at the bottom of the window.


You cannot undo changes or the deletion of records in the Database editor UI. We strongly recommend you export table data as a CSV before making any significant changes.

Manage fields

To add a new field, click the + button to the right of the last field. Specify the name and type, then click Save. You can also add a new field to the left or right of existing fields. Click the field name to open the Field options menu and select either Insert field left or Insert field right.

Set field types

You can set a field's type, which reflects the data it contains. Click the field name to open the Field options menu and select Settings, or configure it when adding a new field. Each type includes additional options for configuration.

Setting the correct field type helps ensure that only valid data is entered. It also configures additional methods of input and determines how best to filter data. Some examples include:

  • Date and Date + Time: Input dates using a date picker.
  • Boolean: Toggle Boolean values using a checkbox.
  • Enum: Configure a list of possible values from which to select.

Configure fields

If you need more control over the field, click Advanced to configure advanced options like PostgreSQL type, default field value, and whether a field should allow null (nullable) or require unique values. Refer to PostgreSQL's official documentation to learn more about about PostgreSQL schemas and data types.

Search records


Use CMD/CTRL-F to open Quick find.

Click Quick find and enter a search term to search through all records in the current table. Any results are highlighted and you can move between results using the search box.

Filter records

Click Filter to define filter conditions and show only records that match all of them. For example, you can show only records with a quantity field value less than 9000 and contain the in the name field value.

You can add field filters from the Field options menu. Click the field name in the header and select Filter by this field.

Click Apply filter to filter records. The Filter button remains active while filters are applied and displays the number of filter conditions in use. To disable the filter, remove all filters and click Apply filter again.

Filter records

Sort records

You can sort records by multiple fields in ascending or descending order. Click the Sort button to select fields and specify sort order. You can configure sorting to use multiple fields. In the event that multiple records have the same field values, the next field sorting option is applied.

Sort by field

You can quickly add fields for sorting from the Field options menu. Click the field name in the header and select either Sort ascending or Sort descending.

Click Apply to sort records. The Sort button remains active while sorting is applied and displays the number of sorting options in use. To disable sorting, remove all sorting options and click Apply again.

Customize view options for fields

Click the Fields button in the toolbar to customize how fields appear in the Database editor UI. You can change the order of fields, pin a single field to the left, and toggle visibility.

Pin a field

A pinned field is fixed to the left of the Database editor UI and is always visible when scrolling horizontally. Click and drag a field to the Pinned section to pin it.

You can also pin a field from its Field options menu by clicking Pin this field.

Reorder fields

You can drag-and-drop fields to reorder them in the Database editor UI. Click and drag fields into different positions to change their order.

Hidden fields

If you need to work with large tables with many fields, you can hide fields that you don't need to use. Toggle the switch to the right of a field's name to show or hide fields. When there are hidden fields, the Fields button remains active and displays the number of hidden fields.

You can also hide a field from its Field options menu by clicking Hide this field.

Link records across tables

You can link records between tables in the Database editor UI to see relevant data in one place. For example, you could link a table with order information to another table with user details. The foreign keys field references a field from another table that contains unique values, such as the primary key. Once a value is set, you can view the relevant linked record.

  1. Click the + button to the right of the last field and select Foreign key as the field type.
  2. Specify the table and field on which to link. You can only select fields with unique values.
  3. Set a value in the new field that corresponds to a value of the field you selected.

Once linked, you can click the Link icon to jump to the related record.

The values you specify for a Foreign key field do not need to be unique. You can link to the same unique record on the linked table multiple times (e.g., multiple orders for the same customer).

Use multiple environments


Multiple environments are only available on paid Retool plans.

You can use Retool Database with multiple environments to build and test apps using staging data without impacting critical data.

The Retool Database resource is automatically configured for any additional environments in use by your organization. Each environment contains an isolated set of tablesโ€”any changes you make in one environment do not affect others.

The Database editor UI loads tables for the currently selected environment, which is production by default. Use the Environment menu in the upper-right to select which environment tables to use.

Query your data


You can quickly access the Database editor UI when editing queries that use Retool Database by clicking View data.

You write queries to interact with Retool Database data in the same way as any other SQL database resource connected to Retool.

Select the Retool Database resource in the query editor, then specify whether you want to write raw SQL queries in SQL mode or construct queries with an interface using GUI mode. As with other SQL databases, you can explore tables in the database.

Use Retool Database in your apps

You can switch between multiple environments from your apps which automatically refreshes any queries you've written. Provided you use the same table names, your app will reload data from the selected environment automatically.

You can also use and query Retool Database in the Query Library by selecting the retool_db resource.

Use Retool Database within the Query Library

Access data externally

To access Retool Database data outside of your apps, you can export a CSV or use Retool Workflows to connect it to other data sources and integrations.


Query Retool Database with a REST API

Weโ€™re working on a REST API that lets you query Retool Database directly using SQL. Reach out to [email protected] if youโ€™re interested in trying it out.

Export data

You can export a copy of table data at any time in CSV format. Open the Table options menu for an existing table and select Export CSV.

Alt text

In the Query Library, you can also export CSVs after running SQL commands. Click the Download csv button next to the query results to download a CSV of your data.

Use Retool Workflows with Retool Database

With Retool Workflows, you can schedule ETL tasks to push and pull data between Retool Database and third-party endpoints and integrations. In a Workflows Query block, select retool_db as the resource to access Retool Database data.

Using Retool DB in Workflows blocks


Additional information about Retool Database. If you have any other questions or feedback about Retool Database, or have a use case that requires more storage, please let us know at [email protected].

How safe is my data?

Retool Database stores your data in a Postgres cluster managed by our cloud provider. Retool uses multiple levels of redundancy, which include daily backups of all data. If you have any questions or would like to know more, please get in touch.

Retool continually backs up all hosted data in Retool Database and have we store data in a Postgres cluster managed by our cloud provider.

How do I back up or restore my data?

You can export a copy of table data in CSV format. Open the Table options menu and click Export CSV. If you ever need to restore the data, you can import that CSV.

Any changes you make with data in Retool Database cannot be reverted. We recommend using multiple environments with staging data to avoid accidental loss of data.

Is there any data I shouldn't store?

To guard against risk on our side, Retool asks that you do not store protected health information (PHI), financial data, and nonpublic personal information. Although Retool does not have a legal obligation to enforce this, storing these kinds of information may not comply with your own legal or compliance obligations.

Examples of data you should not store include:

  • Personally Identifiable Information (PII)
    • Social security, driverโ€™s license, state identification card, or passport number
    • Racial or ethnic origin, political opinions, religious or philosophical beliefs, or union membership
    • The contents mail, email, and text messages unless a business is the intended recipient of the communication.
    • Genetic or biometric data. Data concerning health or data concerning a natural personโ€™s sex life or sexual orientation.
    • Precise location information (e.g., geolocation data).
  • Financial information
    • Account login credentials, including financial account, and in combination with any required security or access code, password, or credentials that would grant access to an account.
    • Debit or credit card information, including full card details

Please refer to our terms of service for detailed information.

Can I access the PostgreSQL database externally?

The Retool Database resource can only be used within your Retool organization. You cannot access the database externally. If this is a feature you need, please get in touch and let us know more about your use case.

What happens when I reach the record or size limit?

You can store up to 50,000 records or 1GB of storage (whichever comes first) for free. You can check the current record count for each table to understand if you're approaching these limits in two ways:

  • Refer to the record count in the Database editor UI for the selected table. This is displayed on the right of the toolbar.
  • Write queries to count table records, such as: select count(*) as records from products;

The amount of storage space your data uses is dependent on how many records, fields, and tables you use, and the size of values. Retool Database does not currently provide usage information for storage space.

If you exceed either the record or storage limits, Retool will reach out to ask that you either remove data or migrate it to another database.

Where is my data hosted and who can access it?

Retool's security guide provides detailed information about data storage and security for provisioned databases hosted by Retool. Within your Retool organization, you can control who has access by configuring user permissions.

Whatโ€™s Next

Learn more about building apps that interact with your data in Retool Database.