PHPackages                             berlindb/core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. berlindb/core

ActiveLibrary[Database &amp; ORM](/categories/database)

berlindb/core
=============

A collection of PHP classes and functions that aims to provide an ORM-like experience and interface to WordPress database tables.

3.0.0(1mo ago)271450.0k↓35.2%27[26 issues](https://github.com/berlindb/core/issues)[1 PRs](https://github.com/berlindb/core/pulls)7MITPHPPHP &gt;=8.1CI passing

Since Jul 12Pushed 2d ago18 watchersCompare

[ Source](https://github.com/berlindb/core)[ Packagist](https://packagist.org/packages/berlindb/core)[ Docs](https://github.com/berlindb/core)[ RSS](/packages/berlindb-core/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (9)Versions (11)Used By (7)

BerlinDB
========

[](#berlindb)

[![CI](https://github.com/berlindb/core/actions/workflows/ci.yml/badge.svg)](https://github.com/berlindb/core/actions/workflows/ci.yml)[![Packagist Version](https://camo.githubusercontent.com/e0bf4ec1751b2afccd085ba497e204edbe1f784b41faea73594fedfd545d3fe3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6265726c696e64622f636f72652e737667)](https://packagist.org/packages/berlindb/core)[![PHP Version](https://camo.githubusercontent.com/26aef83b3ffe74ce930817030899716a76cbd541fa811dcf9a9cc9c6729c488c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6265726c696e64622f636f72652f7068702e737667)](https://packagist.org/packages/berlindb/core)[![License](https://camo.githubusercontent.com/90a4ff929f098b138b0a0938dd09fc760a3a54d745023743f3c0556ada00df6b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6265726c696e64622f636f72652e737667)](LICENSE)

BerlinDB provides an ORM-like interface for custom database tables in WordPress.

Use it when custom post types, taxonomies, or post meta are no longer the right storage model for your data, but you still want a WordPress-native developer experience: `wpdb` compatibility, schema objects, query builders, row objects, caching hooks, and table upgrade routines.

Requirements
------------

[](#requirements)

- PHP 8.1 or newer
- WordPress
- Composer

Installation
------------

[](#installation)

```
composer require berlindb/core
```

Quick Start
-----------

[](#quick-start)

A typical integration defines four small classes:

- a `Schema` that describes columns and indexes
- a `Table` that creates and upgrades the database table
- a `Row` that shapes returned records
- a `Query` that reads and writes records

### Define A Schema

[](#define-a-schema)

```
