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;
            }
        }
    }