Skip to main content

Explore database schemas

Learn how to explore database table schemas when writing queries.

Retool can retrieve database table schemas from supported data sources, such as SQL databases. You can then browse the schema, search for tables and columns, and use autocompletion in the code editor.

View schema

In the code editor for a resource query, click Schema to display the schema browser for the currently selected resource. The schema browser contains a list of all tables and details about their columns, such as name and type. You can also search the schema in the App IDE to find relevant tables or columns.

Refresh schema

Retool periodically fetches the resource's schema. Click to manually refresh the schema to reflect the latest state.

Autocomplete table and columns

You can autocomplete table and column names in SQL mode queries by selecting one of the presented options or pressing to autocomplete the first match. In GUI mode, Retool populates column names in the provided dropdowns.

Schemas for large datasets

If your resource contains a large number of databases or tables, Retool performs a partial fetch of the schema to prevent performance degradation. Regardless of whether the schema is complete, you can always reference valid tables and columns when writing queries.