laravel-doctrine / orm

An integration library for Laravel and Doctrine ORM
MIT License
828 stars 178 forks source link

[FEATURE] DBAL 3 #541

Closed keithbrink closed 1 year ago

keithbrink commented 1 year ago

Following on the work of #519 and #520, I went through the code to fix all the breaking changes related to DBAL 3, as well as some deprecations that came up.

I would prefer to target a new 2.0 branch with this, since there are many breaking changes.

dpslwk commented 1 year ago

Any reason you did no start with #520 ?? We were close on that PR and just a few tweaks requested, was goin to pick it up myself later in the month to finish off

keithbrink commented 1 year ago

@dpslwk Didn't see it! I'll have a look at it now.

keithbrink commented 1 year ago

Working on converting the caches over, marked as draft for now.

dpslwk commented 1 year ago

MasterSlaveConnection was not remove so much as changed to PrimaryReadReplicaConnection we had a request to make the same changes https://github.com/laravel-doctrine/orm/pull/520#discussion_r973195088 in #520

keithbrink commented 1 year ago

MasterSlaveConnection was not remove so much as changed to PrimaryReadReplicaConnection we had a request to make the same changes #520 (comment) in #520

Yeah, to be more precise, the new PrimaryReadReplica was already supported in Laravel Doctrine, but it also supported the old MasterSlaveConnection for backwards compatibility. This has now been completely removed from DBAL 3: https://github.com/doctrine/dbal/blob/3.5.x/UPGRADE.md#removed-masterslaveconnection

codecov-commenter commented 1 year ago

Codecov Report

Base: 53.56% // Head: 57.94% // Increases project coverage by +4.37% :tada:

Coverage data is based on head (ff3ea4c) compared to base (d2c8bc0). Patch coverage: 78.78% of modified lines in pull request are covered.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## 2.0 #541 +/- ## ============================================ + Coverage 53.56% 57.94% +4.37% + Complexity 828 660 -168 ============================================ Files 101 92 -9 Lines 2662 2197 -465 ============================================ - Hits 1426 1273 -153 + Misses 1236 924 -312 ``` | [Impacted Files](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [src/Configuration/CustomTypeManager.php](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL0NvbmZpZ3VyYXRpb24vQ3VzdG9tVHlwZU1hbmFnZXIucGhw) | `100.00% <ø> (ø)` | | | [src/Console/ClearMetadataCacheCommand.php](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL0NvbnNvbGUvQ2xlYXJNZXRhZGF0YUNhY2hlQ29tbWFuZC5waHA=) | `0.00% <0.00%> (ø)` | | | [src/Console/ClearQueryCacheCommand.php](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL0NvbnNvbGUvQ2xlYXJRdWVyeUNhY2hlQ29tbWFuZC5waHA=) | `0.00% <0.00%> (ø)` | | | [src/Console/ClearResultCacheCommand.php](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL0NvbnNvbGUvQ2xlYXJSZXN1bHRDYWNoZUNvbW1hbmQucGhw) | `0.00% <0.00%> (ø)` | | | [src/Console/InfoCommand.php](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL0NvbnNvbGUvSW5mb0NvbW1hbmQucGhw) | `0.00% <ø> (ø)` | | | [src/Console/MappingImportCommand.php](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL0NvbnNvbGUvTWFwcGluZ0ltcG9ydENvbW1hbmQucGhw) | `0.00% <0.00%> (ø)` | | | [src/DoctrineManager.php](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL0RvY3RyaW5lTWFuYWdlci5waHA=) | `85.71% <ø> (-1.25%)` | :arrow_down: | | [src/DoctrineServiceProvider.php](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL0RvY3RyaW5lU2VydmljZVByb3ZpZGVyLnBocA==) | `0.00% <ø> (ø)` | | | [src/Extensions/ExtensionManager.php](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL0V4dGVuc2lvbnMvRXh0ZW5zaW9uTWFuYWdlci5waHA=) | `94.59% <ø> (ø)` | | | [src/Queue/FailedJobsServiceProvider.php](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL1F1ZXVlL0ZhaWxlZEpvYnNTZXJ2aWNlUHJvdmlkZXIucGhw) | `0.00% <0.00%> (ø)` | | | ... and [9 more](https://codecov.io/gh/laravel-doctrine/orm/pull/541?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

keithbrink commented 1 year ago

Using this branch within my application and all seems to be good - ready for review.

dpslwk commented 1 year ago

Could you add an UPGRADE.md with notes on moving to 2.x version of laravel-doctrine/orm

keithbrink commented 1 year ago

Could you add an UPGRADE.md with notes on moving to 2.x version of laravel-doctrine/orm

Done.

eigan commented 1 year ago

Did some research into the namespaces thing.

Basically the namespace support doesn't seem to have any effect at all. The entities doesn't need to be in any of the namespaces.

eigan commented 1 year ago

@keithbrink I merged 1.7 into 1.8 and noticed the cs-fixer things was already handled there. Sorry about that 🤦🏻‍♂️

keithbrink commented 1 year ago

@eigan No problem, I rebased on 1.8.

eigan commented 1 year ago

@keithbrink Thank you! This is a good starting point for 2.0. Going to update the other laravel-doctrine packages to allow this version soon. Will try to get this out to our staging env tomorrow, then production next friday.

keithbrink commented 1 year ago

@eigan Thanks for getting this across the finish line!