Needs review
Project:
Drupal core
Version:
main
Component:
database system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 May 2026 at 08:47 UTC
Updated:
24 Jul 2026 at 19:23 UTC
Jump to comment: Most recent
StatementInterface objects are traversable and the concrete classes implement \Iterator. This is likely an historical extension of the PDOStatement.
However, conceptually statements should not be iterated - that's a property of the result set, that is now represented by ResultBase objects.
In this issue, make ResultBase iterable, and let StatementInterface implementation rely on that for iteration.
Later we may discuss whether we should deprecate and then remove iterability of the statements themselves.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
nicxvan commentedComment #4
mondrakeComment #5
mondrake