Skip to content
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

fix: Quote custom types correctly in SQLFilter #11546

Open
wants to merge 2 commits into
base: 3.2.x
Choose a base branch
from

Conversation

cedricziel
Copy link

@cedricziel cedricziel commented Jul 9, 2024

This enables the connection to quote the parameters correctly according to the type definition.

My scenario:

  • Symfony 7.1 app
  • doctrine/dbal:3.8.2
  • doctrine/orm:3.2.1, currently updating from doctrine/orm:2.19.5
  • I am using the UlidType from the doctrine bridge (using symfony/ulid underneath) as primary key to the Organization entity

My problem:

I'm using a SQLFilter to permanently set the ulid of the organization permanently for users. After updating doctrine/orm, I got an exception that the format of the query parameter wouldn't conform to the expectation of the database.

My solution

On investigation, I found that the SQLFilter doesn't use the column type to quote the value correctly. This change is supposed to ensure that the correct quoting is done

This enables the connection to quote the parameters correctly according to the type definition.
@derrabus
Copy link
Member

derrabus commented Jul 9, 2024

Thank you for your PR. Please always write tests that cover your change.

What problem does this change fix? Note that the type parameter has been removed from DBAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants