Connecting to a database is critical to give your app access to real data. This section will cover how to connect to a database using the AI Builder.

To connect to a database you will need a DB_URI. Reflex.build currently supports postgresql and mysql databases.

This is what it looks like for a Postgres database:

You can also use a MySQL database. The connection string looks like this:

You can add your Database URI at the start of your generation as shown below.

Here if you wanted to build a dashboard for example we recommend a prompt as follows:

Build a dashboard around my database data

You can add your Database URI after you've already generated an app or directly from a template that you have forked as shown below.

Here if you wanted to hook up your data correctly we recommend a prompt as follows:

Use the database I added to rewrite the dashboard to display my expense reporting data, keep the existing layout charts and structure the same

Built with Reflex