Documentation · Chapter 07

Start with SQLite,
without another server.

SQLite stores a complete database in one file. It is ideal for learning, prototyping, and deploying small applications.

We replace reading-list's temporary storage with SQLite without changing the application's purpose.

What “in one file” means

phpaml — zsh
runtime/storage/database.sqlite

This file is not a text document to edit. SQLite organizes tables, indexes, and transactions itself. The application talks to it through PHP's PDO driver.

SQLite or a database server?

SQLitesimple, local, one file, little administration
MySQL / MariaDBwidely available shared Web server
PostgreSQLfeature-rich server for advanced needs

PHPAML Data supports all four SQL drivers. Starting with SQLite does not lock the architecture: the entity and DbContext remain the same when the connection changes.

An important Git distinction

The reproducible schema belongs in migrations and therefore Git. database.sqlite contains real data and remains under runtime, normally ignored. Code explains how to rebuild the database; it does not publish private contents.

Check your understanding: Should you send database.sqlite to a colleague?

Usually no. Share migrations and, if needed, a demonstration seeder without private data.