Skip to content

Commit

Permalink
Merge pull request #141 from aik099/use-yield-methods-for-db
Browse files Browse the repository at this point in the history
Use "ExtendedPdo:yield*" methods instead of to-be-removed iterators
  • Loading branch information
aik099 authored Mar 28, 2024
2 parents 18ac11f + f5b214e commit 40cff27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/SVNBuddy/Repository/RevisionLog/Plugin/BugsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


use Aura\Sql\ExtendedPdoInterface;
use Aura\Sql\Iterator\AllIterator;
use ConsoleHelpers\SVNBuddy\Repository\Connector\Connector;
use ConsoleHelpers\SVNBuddy\Repository\Parser\LogMessageParserFactory;
use ConsoleHelpers\SVNBuddy\Repository\RevisionLog\RepositoryFiller;
Expand Down Expand Up @@ -337,10 +336,10 @@ protected function getCommitsGroupedByProject($from_revision, $to_revision)
FROM CommitProjects cp
JOIN Commits c ON c.Revision = cp.Revision
WHERE cp.Revision BETWEEN :from_revision AND :to_revision';
$commits = new AllIterator($this->database->perform($sql, array(
$commits = $this->database->yieldAll($sql, array(
'from_revision' => $from_revision,
'to_revision' => $to_revision,
)));
));

$ret = array();
$processed_revisions = array();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
namespace ConsoleHelpers\SVNBuddy\Repository\RevisionLog\Plugin;


use Aura\Sql\Iterator\ColIterator;

class ProjectsPlugin extends AbstractDatabaseCollectorPlugin
{

Expand Down Expand Up @@ -101,7 +99,7 @@ protected function createRepositoryWideProject()

$sql = 'SELECT Revision
FROM Commits';
$all_commits = new ColIterator($this->database->perform($sql));
$all_commits = $this->database->yieldCol($sql);

foreach ( $all_commits as $revision ) {
$this->repositoryFiller->addCommitToProject($revision, $project_id);
Expand Down

0 comments on commit 40cff27

Please sign in to comment.