Skip to content

Commit

Permalink
TASK: Update neos/eventstore packages to 1.0
Browse files Browse the repository at this point in the history
Updates `neos/eventstore` and `neos/eventstore-doctrineadapter` packages to their first final release and adjusts code accordingly.

Furthermore this incorporates the following changes:

* Add `CheckpointStorageInterface` and its implementation `DbalCheckpointStorage` (aka `DoctrineCheckpointStorage`) from `neos/eventstore-doctrineadapter` (see neos/eventstore-doctrineadapter#13)
* Add `CatchUp` from `neos/eventstore` (see neos/eventstore#19)
  • Loading branch information
bwaidelich committed Jan 21, 2024
1 parent 65a8765 commit 11d4d5f
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/Domain/Projection/HypergraphProjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@
use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodePeerVariantWasCreated;
use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeSpecializationVariantWasCreated;
use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateWithNodeWasCreated;
use Neos\ContentRepository\Core\Infrastructure\DbalCheckpointStorage;
use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\Projection\ProjectionInterface;
use Neos\EventStore\CatchUp\CheckpointStorageInterface;
use Neos\EventStore\DoctrineAdapter\DoctrineCheckpointStorage;
use Neos\EventStore\Model\Event\SequenceNumber;
use Neos\EventStore\Model\EventEnvelope;
use Neos\EventStore\Model\EventStore\SetupResult;

/**
* The alternate reality-aware hypergraph projector for the PostgreSQL backend via Doctrine DBAL
Expand All @@ -76,7 +74,7 @@ final class HypergraphProjection implements ProjectionInterface
* so that always the same instance is returned
*/
private ?ContentHypergraph $contentHypergraph = null;
private DoctrineCheckpointStorage $checkpointStorage;
private DbalCheckpointStorage $checkpointStorage;
private ProjectionHypergraph $projectionHypergraph;

public function __construct(
Expand All @@ -87,7 +85,7 @@ public function __construct(
private readonly string $tableNamePrefix,
) {
$this->projectionHypergraph = new ProjectionHypergraph($this->databaseClient, $this->tableNamePrefix);
$this->checkpointStorage = new DoctrineCheckpointStorage(
$this->checkpointStorage = new DbalCheckpointStorage(
$this->databaseClient->getConnection(),
$this->tableNamePrefix . '_checkpoint',
self::class
Expand All @@ -98,10 +96,10 @@ public function __construct(
public function setUp(): void
{
$this->setupTables();
$this->checkpointStorage->setup();
$this->checkpointStorage->setUp();
}

private function setupTables(): SetupResult
private function setupTables(): void
{
$connection = $this->databaseClient->getConnection();
HypergraphSchemaBuilder::registerTypes($connection->getDatabasePlatform());
Expand All @@ -124,8 +122,6 @@ private function setupTables(): SetupResult
create index if not exists restriction_affected
on ' . $this->tableNamePrefix . '_restrictionhyperrelation using gin (affectednodeaggregateids);
');

return SetupResult::success('');
}

public function reset(): void
Expand Down Expand Up @@ -212,7 +208,7 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void
};
}

public function getCheckpointStorage(): CheckpointStorageInterface
public function getCheckpointStorage(): DbalCheckpointStorage
{
return $this->checkpointStorage;
}
Expand Down

0 comments on commit 11d4d5f

Please sign in to comment.