endurance / workout-postgresql
Atomic PostgreSQL publication and immutable Workout revision storage
Package info
github.com/youmad/endurance-workout-postgresql
pkg:composer/endurance/workout-postgresql
Requires
- php: ^8.5
- ext-pdo_pgsql: *
- doctrine/dbal: ^4.4
- endurance/foundation: ^0.2.0
- endurance/workout: ^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 20:58:06 UTC
README
Doctrine DBAL storage for immutable Workout plans/revisions. Requires PHP 8.5, PostgreSQL 18, PDO pgsql and Doctrine DBAL ^4.4.
composer require endurance/workout-postgresql
Register migrations/ under namespace
Endurance\WorkoutPostgresql\Migrations in your migration runner and apply
it before use. No automatic schema creation; retained publication history prevents
destructive rollback.
use Endurance\Foundation\Clock\SystemClock; use Endurance\Workout\Application\UseCase\PublishWorkout; use Endurance\WorkoutPostgresql\DoctrineDbalWorkoutRepository; $workouts = new DoctrineDbalWorkoutRepository($connection); $publisher = new PublishWorkout($workouts, new SystemClock()); $plan = $publisher->create($workoutId, $revisionId, $prescription); $revision = $workouts->getRevision($plan->reference());
- Storage is unscoped; the application authorizes access. Revision references identify exact immutable content, including retained history.
- Publication atomically checks both expected head fields and never reuses a stored revision ID. Use the same DBAL connection for shared transactions. A nested commit is not durable until the outer transaction commits; reconcile uncertain responses with the original IDs.
- Persistence retains exact float bits and repeat counts without expansion. The versioned storage encoding is private to this adapter.
Types in Internal and elements marked @internal are not public API.
License: MPL-2.0.