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 database detection on SQLite with PORTABILITY_EMPTY_TO_NULL #5617

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

morozov
Copy link
Member

@morozov morozov commented Aug 26, 2022

This is primarily a workaround while there are two fundamental issues:

  1. The DBAL doesn't support databases on the SQLite platform but there is a wrapper-level method Connection::getDatabase() which is used internally. It cannot be properly implemented in a portable way by definition.
  2. When performing its own queries (e.g. database detection or schema introspection), the DBAL should not use user-defined middlewares (because they can be arbitrary) but should use the wrapper-level APIs (because otherwise, it would duplicate the wrapper code). This is what makes us use other hacks like the following across the schema managers' codebase:
    $value = array_change_key_case($value, CASE_LOWER);
    if (! isset($list[$value['constraint_name']])) {

Returning main instead of an empty string as the SQLite database name was originally proposed in #5046.

Fixes #5615.

@morozov morozov merged commit 4204dc6 into doctrine:3.4.x Aug 26, 2022
@morozov morozov deleted the issues/5615 branch August 26, 2022 06:20
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2023
derrabus pushed a commit that referenced this pull request May 3, 2024
…6338)

|      Q       |   A
|------------- | -----------
| Type         | bug
| Fixed issues | n/a

#### Summary

Fix #5617, `''` was changed to `'main'`, but one occurence was missed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error creating a schema instance on sqlite if portability flag EMPTY_TO_NULL is used
2 participants