Download the PHP package youmad/endurance-activity-postgresql without Composer
On this page you can find all versions of the php package youmad/endurance-activity-postgresql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download youmad/endurance-activity-postgresql
More information about youmad/endurance-activity-postgresql
Files in youmad/endurance-activity-postgresql
Package endurance-activity-postgresql
Short Description Doctrine DBAL adapters and migrations for PostgreSQL activity storage
License MPL-2.0
Informations about the package endurance-activity-postgresql
Endurance Activity PostgreSQL
Doctrine DBAL adapters and migrations for Endurance Activity storage. Supports aggregate persistence, staged streaming imports and activity, lap and track reads. Tested with PostgreSQL 18.
Installation
Requires PHP ^8.5 and ext-pdo_pgsql.
Database setup
Register and execute the migrations in migrations/ through your application's
Doctrine Migrations configuration.
For Symfony with DoctrineMigrationsBundle:
The schema stores the Activity aggregate, import lifecycle and generations,
with generation-owned observations, laps, sessions, details and devices.
Read imported child data through the active_activity_import_* views, which
expose only the activated generation.
Aggregate persistence
$connection is a Doctrine DBAL connection and $activity is an Activity
aggregate. Repository saves use optimistic locking. Discard an aggregate involved
in a rolled-back transaction and reload it before retrying.
Streaming imports
Use the same DoctrineDbalActivityTransaction for the aggregate repository and
DoctrineDbalActivityImportGenerationRepository. Create an
ActivityImportGenerationCoordinator with the generation repository and that
transaction. Pass the coordinator and aggregate repository to
ImportActivityStream.
Create a DoctrineDbalStagedWriteExecutor from that transaction and use it for
the staged writers under Import. Observation and device-status batch writers
can be wrapped by the Activity package's batching adapters. Configure the item
handlers and ImportActivityStream in the consuming application.
Staging batches commit independently and must run outside an outer transaction. Activation persists the aggregate and exposes the completed generation in one transaction. Failed generations stay invisible and are retained until retry or cleanup; the application defines their retention policy.
Import processing claims, heartbeats and source-file cleanup claims are also provided. Completion, failure and release require the claim that owns the current processing attempt.
Reading activities
Adapters under Read implement the Activity read ports. Track pages preserve
all scalar readings, units, origins and sources in payload order. Convenience
fields such as heartRate are null when a measurement type is ambiguous.
Source-specific measurement metadata remains stored in the JSON payload and is
not exposed by the scalar track projection.
Development
From a source checkout:
By default, integration tests use Docker to start a disposable PostgreSQL 18
database. To use a dedicated existing test database, set
ENDURANCE_ACTIVITY_POSTGRESQL_TEST_DATABASE_MODE=external and
ENDURANCE_ACTIVITY_POSTGRESQL_TEST_DATABASE_HOST. Optional connection settings
use the same prefix: PORT, NAME, USER, PASSWORD and PASSWORD_FILE;
see bin/test-integration for defaults. The runner
applies migrations, and the suite truncates application tables between tests.
License
MPL-2.0.
All versions of endurance-activity-postgresql with dependencies
ext-pdo_pgsql Version *
doctrine/dbal Version ^4.4
youmad/endurance-activity Version ^0.1.2
youmad/endurance-foundation Version ^0.1.1