SQLite and MySQL
Configure SQLite automatically or connect Miblo to MySQL, then inspect and apply SQL migrations.
▶ Watch the demoOn this page
SQLite
Choose SQLite when creating a project. Miblo prepares .env, creates miblo.sqlite and applies initial migrations. No database server is needed.
| Miblo operation | SQLite migration |
|---|---|
| Create project | Applied automatically. |
| Add model with API stopped | Applied automatically. |
| Edit model with m | Apply with b or on the next API start. |
DATABASE_URL=sqlite://miblo.sqlite?mode=rwcThe generated API also creates a missing database file and applies migrations at startup.
MySQL
- Start a MySQL server, then choose MySQL when creating the project.
- Enter host, port, database, username and password in Miblo.
- Confirm Save the MySQL connection?. It is written to
.env. - In b, select Initialize the database and tables, then confirm.
The MySQL account needs permission for the requested operation. Miblo does not start a MySQL server.
Use the included compose.yaml
For local development, use the generated MySQL service and connection values from .env.example.
docker compose up -d db
# Once MySQL is ready:
miblo db init
miblo runDatabase commands
| Command | Effect |
|---|---|
miblo db check | Test the connection. |
miblo db init | Initialize if needed and apply migrations. |
miblo db migrate | Apply pending migrations. |
miblo db schema | Print the actual schema as JSON. |
--project PATH selects a project in another directory. Passwords are not passed as command arguments.
Configuration and limits
Miblo’s database commands read DATABASE_URL from the project’s .env first, falling back to the environment if absent. The generated API uses its runtime configuration; avoid conflicting file and shell values.
The database engine is selected at creation. Switching engines requires a separate code and data migration. The schema view distinguishes the actual database from declared models.