Build and run
Databases
Give a project a PostgreSQL database.
- A project with a server can have a PostgreSQL database. The app reads its address from
DATABASE_URL. - CLI:
--db schema.sqlcreates the database, runs that SQL, and gives your serverDATABASE_URL. You can repeat--db.--databasemakes an empty one. - Each SQL statement runs once, so deploying again with the same file is safe.
- In an AI app: ask for a database when you deploy. It sets it up.
- Use databases for projects with a server, not plain websites.
- Deleting a project deletes its database. Your code stays in GitHub.