domainflow/event-sourcing-mysql

EventSourcing MySQL adapter package for DomainFlow EventSourcing

Maintainers

Package info

github.com/domainflow/event-sourcing-mysql

pkg:composer/domainflow/event-sourcing-mysql

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-08-20 17:55 UTC

This package is auto-updated.

Last update: 2026-08-20 18:02:27 UTC


README

Tests Packagist Version PHP Version License PHPStan

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.