import sqlite3


def get_contig_blast_hits(cxn, iteration):
    """Get all blast hits for the iteration."""
    sql = """
        SELECT iteration, contig_id, description, bit_score, len,
               query_from, query_to, query_strand,
               hit_from, hit_to, hit_strand
          FROM aux.contig_blast_hits
         WHERE iteration = ?
        """

    cxn.row_factory = sqlite3.Row
    return cxn.execute(sql, (iteration, ))