Search by

endurance / route-postgresql

endurance

PostgreSQL storage for immutable route revisions and bounded streams

Package info

github.com/youmad/endurance-route-postgresql

pkg:composer/endurance/route-postgresql

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.0 2026-11-23 21:01 UTC

This package is auto-updated.

Last update: 2026-11-23 21:05:08 UTC


README

Doctrine DBAL storage for Endurance Route. Requires PHP 8.5, PostgreSQL 18, PDO pgsql and Doctrine DBAL ^4.4.

composer require endurance/route-postgresql

Register migrations/ under namespace Endurance\RoutePostgresql\Migrations in your migration runner and apply it before use. The repository does not create schema automatically.

use Endurance\Foundation\Clock\SystemClock;
use Endurance\Route\Application\UseCase\PublishRoute;
use Endurance\RoutePostgresql\DoctrineDbalRouteRepository;

$routes = new DoctrineDbalRouteRepository($connection);
$publisher = new PublishRoute($routes, new SystemClock());
$route = $publisher->create($routeId, $revisionId, $metadata, $properties, $content);
$geometry = $routes->geometry($route->currentRevisionId);
  • Storage is unscoped: authorize every read and write in your application. Revision reads stay pinned across pages and preserve exact floating-point bits.
  • Publication checks both expected head fields atomically. Operations sharing an application transaction must share the same DBAL connection. Keep long parsing outside that transaction; a nested commit is not the outer durable commit. Reconcile uncertain outcomes using the original IDs.
  • Retention references retain content, not access rights. Acquire multiple Route identity locks in sorted ID order.
  • Schedule privileged maintenance for abandoned staging, retired content and empty identities. Respect active reservation leases; never reuse purged IDs.

Types in Internal and elements marked @internal are not public API.

License: MPL-2.0.