Documentation · Chapter 13

Give persistence a clear place in the application.

PHPAML Data is the optional persistence module shared by classic, View, API, and plain PHPAML projects. It provides one vocabulary for entities, queries, transactions, and schema changes.

Every lesson starts from the problem, explains the mechanism, then gives a concrete verification.

≈ 75 min

Persistence is a boundary

A controller should not assemble SQL, manage credentials, and translate rows at the same time. Data places those concerns behind an explicit context while keeping database behavior observable.

Entity, context, and database have different jobs

An entity carries application data, DbSet expresses a query for one entity type, DbContext coordinates changes, and the driver speaks to the database. These layers cooperate without becoming the same object.

Know the maturity level

The SQL module is currently 0.2.0-alpha.1. SQLite, MySQL, MariaDB, and PostgreSQL are supported; MongoDB is a separate alpha adapter with different capabilities.