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

Removed Connection::project() #3823

Merged
merged 1 commit into from
Jan 16, 2020

Conversation

morozov
Copy link
Member

@morozov morozov commented Jan 16, 2020

Q A
Type improvement
BC Break yes

As originally discussed in #3703 (comment), the method has more limitations and caveats than provides real use:

  1. It fetches all data in memory which is often inefficient (see Add iterators for non pdo drivers. #2718).
  2. It fetches rows in memory one by one instead of using fetchAll().
  3. It doesn't allow to specify the statement fetch mode since it's instantiated internally.
  4. It can be easily replaced with:
    foreach ($conn->executeQuery($query, $params, $types) as $value) {
       yield $function($value);
    }

The methods has more limitations and caveats than provides real use:

1. It fetches all data in memory which is often inefficient (see doctrine#2718).
2. It fetches rows in memory one by one instead of using `fetchAll()`.
4. It doesn't allow to specify the statement fetch mode since it's instantiated internally.
5. It can be easily replaced with:
   ```php
   foreach ($conn->executeQuery($query, $params, $types) as $value) {
      yield $function($value);
   }
   ```
@morozov morozov self-assigned this Jan 16, 2020
@morozov morozov merged commit 6ff21f8 into doctrine:master Jan 16, 2020
@morozov morozov deleted the remove-connection-project branch January 16, 2020 17:39
@morozov morozov modified the milestones: 4.0.0, 3.0.0 Nov 17, 2020
beberlei added a commit to beberlei/dbal that referenced this pull request Mar 7, 2021
beberlei added a commit to beberlei/dbal that referenced this pull request Mar 7, 2021
beberlei added a commit to beberlei/dbal that referenced this pull request Mar 11, 2021
beberlei added a commit to beberlei/dbal that referenced this pull request Mar 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2022
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.

2 participants