pomm-project / Foundation

Foundation package for the Pomm database framework.
MIT License
70 stars 36 forks source link

Use generator in iterator extraction #97

Open chanmix51 opened 7 years ago

chanmix51 commented 7 years ago

The extract() method in result iterator stores all the result in an array, this uses a lot of memory. It would be better to use a generator here (PHP 5.5).

chanmix51 commented 5 years ago

To sum it up: the result iterator proposes a extract() method to materialize the result set as an array (to use mainly with json_encode). Why then use extract if an iterator (or a generator) is needed? Why not directly use the iterator?