technoly/neoseventstore-cycleadapter

Cycle ORM based implementation for the neos/event-store

2.0.0 2024-04-29 08:14 UTC

This package is auto-updated.

Last update: 2024-11-29 09:40:30 UTC


README

Database Adapter implementation for the neos/eventstore package. It is essentially an adaption of the Doctrine adapter for Cycle ORM / the Spiral framework.

Note Currently this package supports MySQL (including MariaDB) and PostgreSQL.

Usage

Install via composer:

composer require technoly/neos-eventstore-cycleadapter

Create an instance

To create a CycleEventStore, an instance of \Cycle\Database\DatabaseInterface is required. It can be obtained via the DatabaseManager or configured in your Spiral bootloader if you are using the Spiral framework.

See Cycle documentation for more details.

With that, an Event Store instance can be created:

use Cycle\Database;
use Cycle\Database\Config;
use Technoly\NeosEventStore\CycleAdapter\CycleEventStore;

$dbConfig = new Config\DatabaseConfig([
    // your database configuration
]);
$dbal = new Database\DatabaseManager($dbConfig);

$eventTableName = 'some_namespace_events';
$eventStore = new CycleEventStore($dbal->database('default'), $eventTableName);

See README of the neos/eventstore package for details on how to write and read events.

Known limitations

The CycleEventStore->status() method returns OK even if setup is required due to false positives for MariaDB (JSON column stored as longtext).

Contribution

Contributions in the form of issues or pull requests are highly appreciated.

License

See LICENSE