-
-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
!!! FEATURE: update to doctrine/dbal
version 3
#2637
Conversation
It seems something is wrong with the (expected) PhpUnit version, and that |
Ugh, okay, I need to continue this with a clear head at another time - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any news, @albe?
doctrine/dbal
version 3
Updates the requirements on [doctrine/dbal](https://github.com/doctrine/dbal) to permit the latest version. - [Release notes](https://github.com/doctrine/dbal/releases) - [Commits](doctrine/dbal@2.13.0...3.2.0) --- updated-dependencies: - dependency-name: doctrine/dbal dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]>
[ci skip] [skip ci]
8b4723e
to
ec0969f
Compare
Rebased on 9.0 so this can be continued but i dont actually what our plan is with all this doctrine stuff // cc @bwaidelich @kitsunet |
Still many deprecations to tackle though |
See #3379 |
Neos.Flow/Classes/Persistence/Doctrine/ObjectValidationAndDeDuplicationListener.php
Show resolved
Hide resolved
We accept DBAL with ^3.1.4 and ORM ^2.14.0
Adation to IterableResult deprecation.
There is still two open points. the whole Platform->getName() deprecation as we use the name currently to generate the folder name for migrations. We would now have to produce it from the classname which can be more specialised (e.g. |
Mh, another configuration option that might get outdated as new db versions are used. $folderName = match (true) {
$platform instanceof MySQLPlatform => 'Mysql',
$platform instanceof PostgreSQLPlatform => 'Posgresql',
$platform instanceof SqlitePlatform => 'Sqlite',
default => throw new \InvalidArgumentException(sprintf('Failed to determine migration folder name from platform "%s". Please specify --folder-name', get_debug_type($platform))),
}; |
Yep what you hardcoded woudl roughly how I thought about the setting, just those 3, but I would be fine to do it like this with the folder name option. Not that this whole migration system is hugely extensible / will be used elsewhere. |
Let's go with that IMHO, pragmatic and should cover all cases... I like it, thanks @bwaidelich |
Alright, migrations down, logging to go... |
Aaaand logging covered. |
Alright I call this done for now, technically I have 2 approvals, but stuff has changed since then.... |
Neos.Flow/Classes/Persistence/Doctrine/EntityManagerFactory.php
Outdated
Show resolved
Hide resolved
I had another look… sorry! 😇 |
No very good, it was late! We definitely used too many different variants of these name comparisons between double and single quotes and strict and loose comparison ^^ |
I think we all just used what Doctrine generated, and that changed over time… 🤷♂️ |
Co-authored-by: Karsten Dambekalns <[email protected]>
@@ -142,51 +136,23 @@ public function findAll(): QueryResultInterface | |||
/** | |||
* Find all objects and return an IterableResult |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw no IterableResult
here *g
but i was actually wondering .. what is the benefit here of using this vs findAll
? isnt findAll
an iterator as well??? I mean we can keep it for b/c ... but i dont know if we need to use it in neos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That depends I guess worth a look at the source, but findAll would return a full array, woudln't it? While this here can be optimized at the driver level to stream the results as single chunks...
update to doctrine/dbal version 3
Flow_Persistence_Doctrine_Metadata
for ORM class metadataRepository::findAllIterator
directly returns an iterable, theRepository::iterate
method is gonemigration-folder
argument that allows to overwrite the "platform name part" in migration resolving (e.g. "Mysql") as the resolving changed and we cannot be sure deducing it from the current connection will work long term for all cases. Currently MySQL/MariaDB (map to "Mysql"), PostgreSQL (maps to "Postgresql" and SQLite (maps to "Sqlite") all work fine automatically still.Related Neos adjustments: neos/neos-development-collection#5161
Upgrade instructions
We require now version 3 of
doctrine/dbal
but still operatedoctrine/orm
in version 2.In case you depend on DBAL directly you should have a look into their upgrade instructions: https://www.doctrine-project.org/2020/11/17/dbal-3.0.0.html