endurance / route-postgresql
PostgreSQL storage for immutable route revisions and bounded streams
v0.2.0
2026-11-23 21:01 UTC
Requires
- php: ^8.5
- ext-pdo_pgsql: *
- doctrine/dbal: ^4.4
- endurance/foundation: ^0.2.0
- endurance/geo: ^0.2.0
- endurance/route: ^0.2.0
Requires (Dev)
- doctrine/migrations: ^3.9
- phpunit/phpunit: ^12.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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.