How many peers are there in the db?

def atlasdb_num_peers( con=None, path=None ):
    """
    How many peers are there in the db?
    """
    with AtlasDBOpen(con=con, path=path) as dbcon:

        sql = "SELECT MAX(peer_index) FROM peers;"
        args = ()

        cur = dbcon.cursor()
        res = atlasdb_query_execute( cur, sql, args )

        ret = []
        for row in res:
            tmp = {}
            tmp.update(row)
            ret.append(tmp)

        assert len(ret) == 1

    return ret[0]['MAX(peer_index)']