-
Notifications
You must be signed in to change notification settings - Fork 26
Home
John James Jacoby edited this page May 27, 2026
·
2 revisions
BerlinDB is a small database layer for WordPress-oriented PHP applications that want custom database tables without giving up familiar WordPress conventions.
It provides an ORM-like shape around five core objects:
-
Tablemanages the physical database table and its lifecycle. -
Schemadescribes columns and indexes. -
Columndescribes one database column and how values are validated, cast, queried, and created. -
Rowshapes raw database records into application objects. -
Queryreads and writes rows, builds SQL, manages cache keys, and delegates clause parsing to parser objects.
Version 3.0.0 also introduces a clearer internal structure:
-
Adapterswrap database connections. -
Interfacesdefine database contracts. -
Kerncontains the core table, schema, row, query, column, and index objects. -
Operatorsbuild individual SQL comparisons. -
Parsersturn query vars into SQL clauses. -
Traitsprovide shared boot, lifecycle, logging, parsing, environment, and sanitization behavior.
If you are new to BerlinDB, read these in order:
- Define columns and indexes with Schemas, Columns, and Indexes.
- Convert rows into application objects with Rows and Casting.
- Add filters, date queries,
__inclauses, and search with Parsers and Operators. - Swap or inspect the database connection with Adapters and Connections.
- Run the suite with Testing and Tooling.
- Diagnose common mistakes with Troubleshooting.
BerlinDB is a library for custom database tables. It is not a complete application framework, and it intentionally keeps close to WordPress database behavior. When in doubt, prefer explicit schemas, explicit query classes, and small wrappers in your own plugin or application.