-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Pass "path" to pdo-sqlite drivers from DriverManager instead of "dbname" #2267
Pass "path" to pdo-sqlite drivers from DriverManager instead of "dbname" #2267
Conversation
…the 'path' key the driver expects instead of the 'dbname' key other drivers expect.
$nameKey = isset($url['scheme']) && strpos($url['scheme'], 'sqlite') !== false | ||
? 'path' // pdo_sqlite driver uses 'path' instead of 'dbname' key | ||
: 'dbname'; | ||
|
||
if (!isset($url['scheme']) || (strpos($url['scheme'], 'sqlite') !== false && $url['path'] == ':memory:')) { |
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.
Can we somehow try to avoid duplicate checks on whether the path is a sqlite path here?
Also I think it would be a good idea to consider setting memory
parameter instead of path
parameter, if the URL path refers to in-memory (it makes no difference for the driver but could be useful in userland when checking for specific parameters IMO).
Otherwise this patch looks good to me.
👍 |
Pass "path" to pdo-sqlite drivers from DriverManager instead of "dbname"
Merged manually, added evaluation of |
@deeky666 do you have an ETA for a 2.5.5 release including this fix ? This would allow symfony/demo#297 (comment) to work. |
We need it as well as soon as possible 😄 Thanks. |
When doctrine DBAl version 2.5.5 is released the change can be reverted, till then we need the commit doctrine/dbal@2c34559 from the PR doctrine/dbal#2267
This fixes a bug when using a sqlite connection string [1]. [1]: doctrine/dbal#2267
This fixes #1106. Any input on the correct way to do this per Doctrine coding standards is welcome.