public function replaceDatabase(
        Connection $connection,
        string $databaseName,
        string $searchTerm,
        string $replaceTerm,
        int $batchSize = 100
    ): \Generator {
        $databaseMetadata = (new MetadataFactory())->getDatabaseMetadata($connection, $databaseName);

        foreach ($databaseMetadata->getAllTableMetadata() as $tableMetadata) {
            $rowResultList = $this->replaceTable(
                $connection,
                $databaseName,
                $tableMetadata->getTableName(),
                $searchTerm,
                $replaceTerm,
                $batchSize
            );

            foreach ($rowResultList as $rowResult) {
                yield $rowResult;
            }
        }
    }
public function replaceDatabase(
        Connection $connection,
        string $databaseName,
        string $searchTerm,
        string $replaceTerm,
        int $batchSize = 100
    ): \Generator {
        $databaseMetadata = (new MetadataFactory())->getDatabaseMetadata($connection, $databaseName);

        foreach ($databaseMetadata->getAllTableMetadata() as $tableMetadata) {
            $rowResultList = $this->replaceTable(
                $connection,
                $databaseName,
                $tableMetadata->getTableName(),
                $searchTerm,
                $replaceTerm,
                $batchSize
            );

            foreach ($rowResultList as $rowResult) {
                yield $rowResult;
            }
        }
    }
public function replaceDatabase ( Connection $ connection , string $ databaseName , string $ searchTerm , string $ replaceTerm , int $ batchSize = 100 ) : \ Generator { $ databaseMetadata = ( new MetadataFactory ( ) ) -> getDatabaseMetadata ( $ connection , $ databaseName ) ; foreach ( $ databaseMetadata -> getAllTableMetadata ( ) as $ tableMetadata ) { $ rowResultList = $ this -> replaceTable ( $ connection , $ databaseName , $ tableMetadata -> getTableName ( ) , $ searchTerm , $ replaceTerm , $ batchSize ) ; foreach ( $ rowResultList as $ rowResult ) { yield $ rowResult ; } } }
Performs a search on all tables in the the provided database, batching queries to the specified batch size.

@return \Generator|RowReplaceResult[]
Performs a search on all tables in the the provided database batching queries to the specified batch size .