1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00
phorge-phorge/src
epriestley 7aa12f192a Add PhabricatorQueryIterator, for buffered iteration over a CursorPagedPolicyAwareQuery
Summary:
See D19446. This should make it easier to process larger, more complex result sets in constant memory.

Today, `LiskMigrationIterator` takes constant memory but can't apply `needX()` reqeusts or `withY(...)` constraints.

Using a raw `Query` can handle this stuff, but requires memory proportional to the size of the result set.

Offer the best of both worlds: constant memory and full access to the power of `Query` classes.

Test Plan:
Used this script to iterate over every commit, saw sensible behavior:

```name=list-commits.php
<?php

require_once 'scripts/init/init-script.php';

$viewer = PhabricatorUser::getOmnipotentUser();

$query = id(new DiffusionCommitQuery())
  ->setViewer($viewer);

$iterator = new PhabricatorQueryIterator($query);
foreach ($iterator as $commit) {
  echo $commit->getID()."\n";
}
```

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D19450
2018-05-14 12:13:51 -07:00
..
__tests__ Use PhutilClassMapQuery instead of PhutilSymbolLoader 2015-08-14 07:49:01 +10:00
aphront Fix excessively severe CSP URI error during first-time setup 2018-04-21 09:43:46 -07:00
applications Fix a fatal during breadcrumb construction when viewing a dashboard you don't have permission to view 2018-05-14 12:06:56 -07:00
docs Improve UI and documentation for "Ignore Attributes" in Owners slightly 2018-05-08 14:03:30 -07:00
extensions
infrastructure Add PhabricatorQueryIterator, for buffered iteration over a CursorPagedPolicyAwareQuery 2018-05-14 12:13:51 -07:00
view Allow navigation breadcrumbs to be marked as "always visible" so they show up on phones 2018-05-09 13:21:47 -07:00
__phutil_library_init__.php
__phutil_library_map__.php Add PhabricatorQueryIterator, for buffered iteration over a CursorPagedPolicyAwareQuery 2018-05-14 12:13:51 -07:00