Skip to content

#2456 - add sorting schema#2459

Merged
norberttech merged 4 commits into
flow-php:1.xfrom
MrHDOLEK:#2456
Jun 18, 2026
Merged

#2456 - add sorting schema#2459
norberttech merged 4 commits into
flow-php:1.xfrom
MrHDOLEK:#2456

Conversation

@MrHDOLEK

Copy link
Copy Markdown
Contributor

Add Schema::sort(SortingStrategy) with AlphabeticalStrategy (default), TypeStrategy, MetadataStrategy and CombinedStrategy in core, plus a PostgreSqlSortingStrategy (primary-key ->type -> name) in the postgresql adapter. Strategies are exposed via sort_by_name, sort_by_type, sort_by_type_and_name, sort_by_metadata and pgsql_sort_strategy DSL helpers.

Change Log


Added

  • Flow\ETL\Schema::sort() accepting a pluggable SortingStrategy (defaults to AlphabeticalStrategy)
  • Core sorting strategies AlphabeticalStrategy, TypeStrategy, MetadataStrategy and CombinedStrategy, exposed via sort_by_name(), sort_by_type(), sort_by_type_and_name() and sort_by_metadata() DSL helpers
  • PostgreSqlSortingStrategy (primary-key columns first, then by PostgreSQL type, then by name) exposed via the pgsql_sort_strategy() DSL helper

Fixed

Changed

Removed

Deprecated

Security

Add Schema::sort(SortingStrategy) with AlphabeticalStrategy (default), TypeStrategy, MetadataStrategy and CombinedStrategy in core, plus a PostgreSqlSortingStrategy (primary-key -> type -> name) in the postgresql adapter. Strategies are exposed via sort_by_name, sort_by_type, sort_by_type_and_name, sort_by_metadata and pgsql_sort_strategy DSL helpers.

Resolves flow-php#2456
Comment thread src/core/etl/src/Flow/ETL/Schema/SortingStrategy/TypePriorities.php Outdated
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.18750% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.13%. Comparing base (a911d76) to head (b729ea8).
⚠️ Report is 4 commits behind head on 1.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2459      +/-   ##
============================================
  Coverage     85.13%   85.13%              
- Complexity        0    21255   +21255     
============================================
  Files          1598     1605       +7     
  Lines         65485    65575      +90     
============================================
+ Hits          55749    55826      +77     
- Misses         9736     9749      +13     
Components Coverage Δ
etl 88.43% <93.33%> (+0.01%) ⬆️
cli 89.40% <ø> (ø)
lib-array-dot 81.44% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 93.61% <ø> (ø)
lib-filesystem 85.03% <ø> (ø)
lib-types 90.06% <ø> (ø)
lib-parquet 70.10% <ø> (ø)
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 89.38% <ø> (-0.45%) ⬇️
lib-dremel 0.00% <ø> (ø)
lib-postgresql 88.59% <ø> (ø)
lib-telemetry 85.95% <ø> (ø)
bridge-filesystem-async-aws 92.74% <ø> (ø)
bridge-filesystem-azure 90.45% <ø> (ø)
bridge-monolog-http 96.82% <ø> (ø)
bridge-monolog-telemetry 94.11% <ø> (ø)
bridge-openapi-specification 92.07% <ø> (ø)
symfony-http-foundation 78.57% <ø> (ø)
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr3-telemetry 97.84% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 89.89% <ø> (ø)
bridge-symfony-http-foundation-telemetry 89.47% <ø> (ø)
bridge-symfony-filesystem-bundle 90.66% <ø> (ø)
bridge-symfony-filesystem-cache 98.14% <ø> (ø)
bridge-symfony-postgresql-bundle 93.83% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 80.77% <ø> (-0.03%) ⬇️
adapter-chartjs 84.05% <ø> (ø)
adapter-csv 91.16% <ø> (ø)
adapter-doctrine 90.79% <ø> (ø)
adapter-google-sheet 99.18% <ø> (ø)
adapter-http 72.34% <ø> (ø)
adapter-json 88.63% <ø> (ø)
adapter-logger 50.00% <ø> (ø)
adapter-parquet 77.70% <ø> (ø)
adapter-text 74.13% <ø> (ø)
adapter-xml 83.40% <ø> (ø)
adapter-avro 0.00% <ø> (ø)
adapter-excel 94.21% <ø> (ø)
adapter-postgresql 91.06% <89.47%> (-0.05%) ⬇️
adapter-seal 85.42% <ø> (ø)
bridge-phpunit-postgresql 75.30% <ø> (ø)
bridge-phpunit-telemetry 80.08% <ø> (ø)
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…priority

Drop the redundant equality guard in TypeStrategy::compare() (<=> already returns 0 for equal priorities) and replace the magic 99999 fallback with a named TypePriorities::UNKNOWN_TYPE_PRIORITY constant set to PHP_INT_MAX.
Comment thread src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/functions.php Outdated
Comment thread src/core/etl/src/Flow/ETL/DSL/functions.php Outdated
Comment thread src/core/etl/src/Flow/ETL/DSL/functions.php Outdated
Comment thread src/core/etl/src/Flow/ETL/DSL/functions.php Outdated
Comment thread src/core/etl/src/Flow/ETL/DSL/functions.php Outdated
Comment thread src/core/etl/src/Flow/ETL/Schema/SortingStrategy/TypePriorities.php Outdated

@norberttech norberttech left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 💪
Just few minor namespaces and function names cleanups are required before merge

MrHDOLEK added 2 commits June 18, 2026 16:50
Apply review feedback from flow-php#2459: prefix core sorting DSL helpers with schema_ (schema_sort_by_name/type/type_and_name/metadata), rename pgsql_sort_strategy to pgsql_schema_sort_by_type, and move the PostgreSQL strategy to Flow\ETL\Adapter\PostgreSql\Schema\SortingStrategy\TypeStrategy.
Move Flow\ETL\Schema\SortingStrategy\TypePriorities to Flow\ETL\Schema\SortingStrategy\TypeStrategy\TypePriorities per review feedback on flow-php#2459.
@norberttech norberttech merged commit 2cfe391 into flow-php:1.x Jun 18, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants