PDO Event Store 使用教程
1、项目介绍
PDO Event Store 是一个基于 PDO 实现的 Prooph Event Store。它是一个用于事件溯源(Event Sourcing)的开源项目,支持 MySQL 和 PostgreSQL 数据库。该项目的主要目标是提供一个高性能、可扩展的事件存储解决方案,适用于需要事件溯源的应用场景。
2、项目快速启动
安装
首先,通过 Composer 安装 PDO Event Store:
composer require prooph/pdo-event-store
配置
创建一个 PDO 连接实例,并配置 Event Store:
use Prooph\EventStore\Pdo\PersistenceStrategy\MySqlSingleStreamStrategy;
use Prooph\EventStore\Pdo\Projection\MySqlProjectionManager;
use Prooph\EventStore\Pdo\MySqlEventStore;
use Prooph\EventStore\Pdo\PersistenceStrategy\MySqlAggregateStreamStrategy;
use Prooph\EventStore\Pdo\Exception\InvalidArgumentException;
use Prooph\EventStore\Pdo\Projection\MySqlProjectionManager;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection\MySqlProjection;
use Prooph\EventStore\Pdo\Projection