PHPackages                             eventsauce/message-repository-for-doctrine - 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. eventsauce/message-repository-for-doctrine

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

eventsauce/message-repository-for-doctrine
==========================================

Message Repository for Doctrine DBAL 3

1.4.0(6mo ago)0491.8k—7.9%13MITPHP

Since May 16Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/EventSaucePHP/MessageRepositoryForDoctrine)[ Packagist](https://packagist.org/packages/eventsauce/message-repository-for-doctrine)[ GitHub Sponsors](https://github.com/frankdejonge)[ RSS](/packages/eventsauce-message-repository-for-doctrine/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (16)Used By (3)

Doctrine Message Repository
===========================

[](#doctrine-message-repository)

`MessageRepository` implementation that uses Doctrine DBAL for event persistence.

Usage
-----

[](#usage)

```
use EventSauce\MessageRepository\DoctrineMessageRepository\DoctrineUuidV4MessageRepository;
use EventSauce\MessageRepository\TableSchema\DefaultTableSchema;
use EventSauce\UuidEncoding\BinaryUuidEncoder;

$messageRepository = new DoctrineUuidV4MessageRepository(
    connection: $doctrineDbalConnection,
    tableName: $tableName,
    serializer: $eventSauceMessageSerializer,
    tableSchema: new DefaultTableSchema(), // optional
    uuidEncoder: new BinaryUuidEncoder(), // optional
);
```

Table Schema
------------

[](#table-schema)

`TableSchema` allows customizing the table and column names used when performing database operations, as well as allowing for additional headers to be added.

### Default Table Schema

[](#default-table-schema)

The default implementation `DefaultTableSchema` uses the following column names:

- `event_id` primary key (text/UUID)
- `aggregate_root_id` aggregate root ID (text/UUID)
- `version` aggregate root version (int)
- `payload` encoded event payload (text/JSON)

### Legacy Table Schema

[](#legacy-table-schema)

For users upgrading from EventSauce pre-1.0, there is a `LegacyTableSchema`:

- `event_id` primary key (text/UUID)
- `event_type` the serialized event name (text)
- `aggregate_root_id` aggregate root ID (text/UUID)
- `aggregate_root_version` aggregate root version (int)
- `time_of_recording` when the event was written (timestamp)
- `payload` encoded event payload (text/JSON)

### Custom Implementations

[](#custom-implementations)

Custom implementations of `TableSchema` can use the `additionalColumns` method to write other `Header` values to columns, which can be useful for indexing.

UUID Encoder
------------

[](#uuid-encoder)

`UuidEncoder` allows customizing how the UUIDs used for the event ID and the aggregate root ID are converted to string when written to the database.

### Binary UUID Encoder

[](#binary-uuid-encoder)

`UuidBinaryEncoder` encodes the UUID using `$uuid->getBytes()` to generate a binary text version of the UUID, which should be used when the database does not have a native `uuid` type.

### String UUID Encoder

[](#string-uuid-encoder)

`UuidStringEncoder` encodes the UUID using `$uuid->toString()` to generate a plain text version of the UUID, which should be used when the database has a `uuid` type.

### Custom Implementations

[](#custom-implementations-1)

Custom implementations of `UuidEncoder` can be used to optimize UUID storage as needed.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance70

Regular maintenance activity

Popularity36

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 69.4% 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 ~116 days

Recently: every ~221 days

Total

15

Last Release

200d ago

Major Versions

0.4.1 → 1.0.02023-05-27

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/534693?v=4)[Frank de Jonge](/maintainers/frankdejonge)[@frankdejonge](https://github.com/frankdejonge)

---

Top Contributors

[![frankdejonge](https://avatars.githubusercontent.com/u/534693?v=4)](https://github.com/frankdejonge "frankdejonge (25 commits)")[![wjzijderveld](https://avatars.githubusercontent.com/u/450201?v=4)](https://github.com/wjzijderveld "wjzijderveld (4 commits)")[![simensen](https://avatars.githubusercontent.com/u/191200?v=4)](https://github.com/simensen "simensen (3 commits)")[![driesvints](https://avatars.githubusercontent.com/u/594614?v=4)](https://github.com/driesvints "driesvints (2 commits)")[![shadowhand](https://avatars.githubusercontent.com/u/38203?v=4)](https://github.com/shadowhand "shadowhand (1 commits)")[![thomasschiet](https://avatars.githubusercontent.com/u/286026?v=4)](https://github.com/thomasschiet "thomasschiet (1 commits)")

### Embed Badge

![Health badge](/badges/eventsauce-message-repository-for-doctrine/health.svg)

```
[![Health](https://phpackages.com/badges/eventsauce-message-repository-for-doctrine/health.svg)](https://phpackages.com/packages/eventsauce-message-repository-for-doctrine)
```

###  Alternatives

[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)

PHPackages © 2026

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