domainflow / event-sourcing-mysql
EventSourcing MySQL adapter package for DomainFlow EventSourcing
Package info
github.com/domainflow/event-sourcing-mysql
pkg:composer/domainflow/event-sourcing-mysql
v0.1.0
2026-08-20 17:55 UTC
Requires
- php: ^8.4
- ext-pdo: *
- domainflow/event-sourcing-core: ^v0.1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.70
- mikey179/vfsstream: ^1.6
- nikic/php-parser: ^5.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpunit/phpunit: ^12.5
- symfony/phpunit-bridge: ^7.2
README
A PDO/MySQL storage adapter for domainflow/event-sourcing-core
— implements EventStorageInterface, SnapshotStorageInterface, SnapshotHistoryStorageInterface, and ProcessManagerStorageInterface against MySQL 8. No domain logic of its own — no aggregate modeling, no business rules, just translation between Core's interfaces and SQL.
Requirements
- PHP 8.4+
ext-pdo- A reachable MySQL 8+ instance
- InnoDB (the default). The atomicity guarantee below is a transaction, and MyISAM has none.
Installation
composer require domainflow/event-sourcing-mysql
Usage
use DomainFlow\EventSourcingMySQL\Storage\MySqlEventStorage; use DomainFlow\EventSourcingMySQL\Snapshot\MySqlSnapshotStorage; use DomainFlow\EventSourcing\Facade\EventSourcingFacade; $pdo = new PDO('mysql:host=127.0.0.1;dbname=my_app;charset=utf8mb4', $user, $pass); $facade = new EventSourcingFacade( new MySqlEventStorage($pdo), new MySqlSnapshotStorage($pdo) ); $order = new Order(); $order->create($orderId, 'customer-1'); $facade->persist($order);
Development
docker compose up -d # start a local MySQL 8 instance composer install composer quality # lint + static analysis + full test suite (100% coverage required) + audit
License
MIT — see LICENSE.