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(8mo ago)0522.5k↓16.1%13MITPHP

Since May 16Pushed 6mo 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 2d 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

48

—

FairBetter than 93% of packages

Maintenance64

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

246d 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

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k3.5k](/packages/leantime-leantime)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

5.1k5.2k](/packages/shlinkio-shlink)[patchlevel/event-sourcing

A lightweight but also all-inclusive event sourcing library with a focus on developer experience

207362.9k13](/packages/patchlevel-event-sourcing)

PHPackages © 2026

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