Skip to main content

Manage Retool Database table fields

Learn how to add, remove, and edit fields in Retool Database.

A Retool Database field is a table column for a specific type of data. Each field maps to a supported PostgreSQL column type that specifies both the type and format of data. For example, the Number field is for number values, but you can specify which PostgreSQL type to use, such as integer, float, or decimal.

Available fields and types

When adding or editing table fields, you must specify the correct PostgreSQL column type to ensure that only valid data is entered. It also configures additional methods of input and determines how best to filter data.

Use the app below to explore Retool Database fields and supported PostgreSQL types.

Add a new field

To add a field, click Add Add to the right of the last column. Specify the name and type, then click Save.

Add a field.

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 Insert field left or Insert field right Insert field right.

Insert a field to the left or right of an existing field.

When adding a field, you configure its options based on your requirements.

Remove a field

To remove a field, click Field options Field options in the field header and select Delete in the toolbar.

Deleting a field permanently removes it and any data it contains from the table. You should export table data before making any significant changes.

Select the rows to delete.

Configure field options

You can configure additional options to refine the values for a field to further customize the data it stores.

Configure field options.

Nullable

Set Nullable to true to allow empty values for the field. This is useful for optional information that isn't required. For required fields, such as an order number, set this to false.

Unique

The UUID and auto-incrementing integer ID fields require unique values by default. You can also specify whether other fields should require unique values by setting Unique to true. When enabled, each row value must be unique. This is useful for unique data, such as a customer's email address or order number.

Default value

You can optionally specify a default value for a field if a new row is added without explicitly setting its value. Retool Database supports a manually specified default value or an SQL expression. An SQL expression is useful for default values that are dynamically set, such as a date:

CURRENT_DATE

Refer to PostgreSQL's official documentation to learn more about PostgreSQL schemas and data types.