technoly / neoseventstore-cycleadapter
Cycle ORM based implementation for the neos/event-store
Requires
- php: ^8.1
- cycle/database: ^2.3
- neos/eventstore: ^1
- psr/clock: ^1
- webmozart/assert: ^1.10
Requires (Dev)
- brianium/paratest: ^7.2
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^4.0.x-dev
This package is auto-updated.
Last update: 2024-10-29 09:28:14 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