PHPackages                             marko/database - 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. marko/database

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

marko/database
==============

Marko Framework Database Layer - Entity-driven schema with Data Mapper pattern

0.8.4(1mo ago)0335↑31.6%12MITPHPPHP ^8.5

Since Mar 25Pushed 1mo agoCompare

[ Source](https://github.com/marko-php/marko-database)[ Packagist](https://packagist.org/packages/marko/database)[ RSS](/packages/marko-database/feed)WikiDiscussions develop Synced 4w ago

READMEChangelogDependencies (12)Versions (23)Used By (12)

marko/database
==============

[](#markodatabase)

Entity-driven schema definition with the Data Mapper pattern for the Marko framework.

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

[](#installation)

```
composer require marko/database
```

You typically install a driver package (like `marko/database-pgsql`) which requires this automatically.

Quick Example
-------------

[](#quick-example)

```
use Marko\Database\Attributes\Column;
use Marko\Database\Attributes\Table;
use Marko\Database\Entity\Entity;
use Marko\Database\Repository\Repository;

#[Table('posts')]
class Post extends Entity
{
    #[Column(primaryKey: true, autoIncrement: true)]
    public int $id;

    #[Column(length: 255)]
    public string $title;

    #[Column(type: 'json')]
    public array $metadata = [];
}

class PostRepository extends Repository
{
    protected const string ENTITY_CLASS = Post::class;
}
```

Documentation
-------------

[](#documentation)

Full usage, API reference, and examples: [marko/database](https://marko.build/docs/packages/database/)

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance90

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

21

Last Release

57d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/437029?v=4)[Mark Shust](/maintainers/markshust)[@markshust](https://github.com/markshust)

---

Top Contributors

[![markshust](https://avatars.githubusercontent.com/u/437029?v=4)](https://github.com/markshust "markshust (75 commits)")[![samsteele](https://avatars.githubusercontent.com/u/10742174?v=4)](https://github.com/samsteele "samsteele (6 commits)")[![michalbiarda](https://avatars.githubusercontent.com/u/1135380?v=4)](https://github.com/michalbiarda "michalbiarda (3 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/marko-database/health.svg)

```
[![Health](https://phpackages.com/badges/marko-database/health.svg)](https://phpackages.com/packages/marko-database)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
