Skip to content

Add Doctrine DBAL 4 compatibility#121

Merged
mpdude merged 5 commits intomasterfrom
dbal4-compat
Mar 16, 2026
Merged

Add Doctrine DBAL 4 compatibility#121
mpdude merged 5 commits intomasterfrom
dbal4-compat

Conversation

@mpdude
Copy link
Member

@mpdude mpdude commented Mar 16, 2026

This adds compatiblity with DBAL 4, while also supporting DBAL 3 for an easy transition.

  • The url connection parameter was removed in DBAL 4. Detect whether Doctrine\DBAL\Tools\DsnParser is available and use it to parse the DSN into connection parameters. On DBAL 3 (without DsnParser) the previous ['url' => ...] array is used as a fallback.

  • DBAL 4 removed the EventManager and the DC2Type column comment mechanism along with it. The DummyTypeRegistrationEventSubscriber — which worked around unknown custom types encoded in column comments, see Fill in dummy types to deal with DC2:... column comments #102 — is therefore no longer needed. Its is now conditional, based on class_exists(\Doctrine\DBAL\Events::class), which is only true on DBAL 3.

  • Connection::getSchemaManager() (deprecated in DBAL 3) was replaced with createSchemaManager()

@mpdude mpdude force-pushed the dbal4-compat branch 2 times, most recently from bd7ef30 to 57d3c3c Compare March 16, 2026 08:14
@mpdude mpdude merged commit ac3500a into master Mar 16, 2026
@mpdude mpdude deleted the dbal4-compat branch March 16, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant