-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Drop support for DBAL 2 #1570
Drop support for DBAL 2 #1570
Conversation
035658c
to
a63dfa9
Compare
@@ -128,17 +125,6 @@ private function explainSQLServerPlatform(Connection $connection, array $query): | |||
|
|||
$stmt = $connection->executeQuery($sql, $params, $query['types']); | |||
|
|||
// DBAL 2.13 "forward compatibility" BC break handling | |||
if ($stmt instanceof Result) { |
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.
so I guess with DBAL 3 this never worked 🤔
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.
Then let's just throw exception in this function to make it clear this is not supported for SQLSRV? Because I'm pretty sure it ccannot work without nextRowset()
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.
removed + added an exception
|
||
class ConnectionFactoryTest extends TestCase | ||
{ | ||
use VerifyDeprecations; | ||
|
||
public function testContainer(): void |
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.
I don't understand what this test actually tests. That exception throwing logic all seems DBAL related.
reading #673 I don't think its relevant anymore.
11ae4fe
to
e0dded4
Compare
b50fcd8
to
436be82
Compare
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.
nice work, few minor stuff
$hasPath = isset($params['path']); | ||
$name = $hasPath ? $params['path'] : ($params['dbname'] ?? false); | ||
if (! $name) { | ||
throw new InvalidArgumentException("Connection does not contain a 'path' or 'dbname' parameter and cannot be created."); | ||
} | ||
|
||
// Need to get rid of _every_ occurrence of dbname from connection configuration and we have already extracted all relevant info from url | ||
/** @psalm-suppress InvalidArrayOffset */ |
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.
What was the error here? Does it complain about url
key? Because that looks correct to me, $connection->getParams()
cannot really return url
key, can it? Same in DropDatabaseDoctrineCommand
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.
Yes exactly. The error was about the url
key.
$connection->getParams() cannot really return url key, can it?
Actually it can 😢 I tested it. If I configure a DBAL connection using url
in the bundle config then that key is also present in connection params.
@@ -128,17 +125,6 @@ private function explainSQLServerPlatform(Connection $connection, array $query): | |||
|
|||
$stmt = $connection->executeQuery($sql, $params, $query['types']); | |||
|
|||
// DBAL 2.13 "forward compatibility" BC break handling | |||
if ($stmt instanceof Result) { |
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.
Then let's just throw exception in this function to make it clear this is not supported for SQLSRV? Because I'm pretty sure it ccannot work without nextRowset()
In composer.json, we can drop older PHPUnit versions: "phpunit/phpunit": "^9.5.26 || ^10.0", |
Thank you, @dmaicher! |
Closes #1550