Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey folks! 👋
It's been more than 4 years since a version 3
bentools/etl
was drafted, but never got out of the alpha stability, mostly because of a lack of time but also, I have to admit, uncertainties about design directions taken.Introducing
bentools/etl
v4PHP 8 and a lot of projects on my side came in between, and I recently got the need of this library, but I wanted to keep the good ideas of the v3, and remove the bad ones as well.
So, I decided that a stable v3 will never sunrise, and because lots of classes have been renamed, most of them became immutable, here's a brand new v4 version.
What's new?
This version requires PHP 8.2 as a minimum, is 100% covered by tests (this wasn't the case before), and uses PHPStan to ensure types consistency at the highest level. A Github Actions CI has also been set up.
It introduces a new
EtlState
object, which is instantiated at the beginning of the ETL process, and passed through the different steps and event listeners. TheEtlExecutor
(previously theEtl
class) is no longer mutable, since it basically holds the Extractor, the Transformer and the Loader objects, fires events and provides you with the state you need with theEtlState
.The
EtlState
is mostly readonly, but you can still call$state->skip()
to skip items,$state->stop()
to stop the process,$state->flush()
to request an early flush, and you can use the$state->context
array to pass arbitrary data between the different steps and events during the whole workflow.How does it work?
Here's an example of the new API:
I hope you'll enjoy this release as much as I enjoyed coding it! 😃