Skip to content

Evaluate if we should return iterable instead of array in some cases #60

Description

@jwage
  • Evaluate if we should return iterable instead of array in some cases
  • It may make more sense to add new methods that return iterable instead of changing existing methods. e.g. findAllIterator() or something instead of changing findAll() to return an array.

Activity

  1. added this to the 2.0.0 milestone on Apr 23, 2019
  2. alcaeus commented on Apr 23, 2019

    @alcaeus
    Member

    I don’t think adding methods to the interface is a good idea, as it requires duplicating logic. IMO the only reason not to do it is “it’s a tough BC break”. However, I don’t think that’s a valid argument as breaking BC again is difficult for a package this low in the dependency food chain.

  3. removed this from the 2.0.0 milestone on Dec 18, 2019
  4. drupol commented on Dec 5, 2021

    @drupol
    Contributor

    Hi,

    Just adding my 2 cents here to an old topic.

    I don't see the point of doing this, as long as the PDO Driver doesn't return an iterator.

    When querying a DB, the whole resultset is returned at once and I don't see why we should create an iterator out of it, it's already loaded in the memory.

  5. greg0ire commented on Dec 5, 2021

    @greg0ire
    Member
  6. drupol commented on Dec 5, 2021

    @drupol
    Contributor

    I was not aware of PDOSTatement::fetch() but I think the post make sense if we use it.

    I think the default in Doctrine is PDOSTatement::fetchAll() right, do you confirm ?

  7. greg0ire commented on Dec 5, 2021

    @greg0ire
    Member

    I do not confirm and I reject the burden of proof 😛

  8. drupol commented on Dec 5, 2021

    @drupol
    Contributor

    Then ok, fair enough. I'll investigate a bit this thing. The idea of having an iterator makes a lot of sense to me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions