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 compatibility with DBAL develop #7065

Merged
merged 1 commit into from
Feb 18, 2018

Conversation

Majkl578
Copy link
Contributor

@Majkl578 Majkl578 commented Feb 14, 2018

  • ResultStatement signature BC break
  • PDO::FETCH_* -> FetchMode::*
  • PDO::PARAM_* -> ParameterType::*
  • AbstractPlatform::DATE_INTERVAL_UNIT_* -> DateIntervalUnit::*
  • AbstractPlatform::TRIM_* -> TrimMode::*

Changes from doctrine/dbal#2958 & doctrine/dbal#2998.

/cc @morozov

@Majkl578 Majkl578 added this to the 3.0 milestone Feb 14, 2018
@morozov
Copy link
Member

morozov commented Feb 14, 2018

@Majkl578 I see there are some leftovers of PDO in the codebase and documentation:

↪ git grep PDO
docs/en/reference/architecture.rst:top of PDO but is not strongly bound to PDO. The purpose of this
docs/en/reference/dql-doctrine-query-language.rst:            return $this->stmt->fetchAll(PDO::FETCH_ASSOC);
docs/en/reference/query-builder.rst:the third argument to ``setParameter()`` explicitly. It accepts either a PDO
docs/en/reference/transactions-and-concurrency.rst:abstraction layers like PDO by default operate in auto-commit mode,
tests/Doctrine/Performance/EntityManagerFactory.php:use Doctrine\DBAL\Driver\PDOSqlite\Driver;
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php:        } catch (\PDOException $e) {
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php:        } catch (\PDOException $e) {
  1. The documentation shouldn't suggest using PDO symbols.
  2. In the tests, if needed at all, the code should be catching a DBAL-level exception, not a PDO one.
  3. The EntityManagerFactory class relies on the PDO SQLite driver being available which is not always the case.

@Majkl578
Copy link
Contributor Author

Totally missed the docs references. Updated two of them, the other seem legit.
PDOSqlite is used in performance tests to create specific driver, should be fine.
Removed those catches in tests entirely, seems to be a dead code (createSchema catches \Throwable and re-throws ToolsException).

* ResultStatement signature BC break
* PDO::FETCH_* -> FetchMode::*
* PDO::PARAM_* -> ParameterType::*
* AbstractPlatform::DATE_INTERVAL_UNIT_* -> DateIntervalUnit::*
* AbstractPlatform::TRIM_* -> TrimMode::*
@lcobucci lcobucci merged commit f351f5a into doctrine:master Feb 18, 2018
@lcobucci lcobucci self-assigned this Feb 18, 2018
@Majkl578 Majkl578 deleted the dev/dbal-compat branch February 18, 2018 01:30
@greg0ire greg0ire removed this from the 3.0.0 milestone Jun 27, 2021
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.

4 participants