import sqlite3


def _read_antenna_database(station, database):
    """
    Get antenna information for the given ARA station from the database.

    Parameters
    ----------
    station : str
        Name of the station's table in the database.
    database : str
        Name of the sqlite database containing antenna information.

    Returns
    -------
    names : list of str
        List of antenna names (consisting of their borehole and antenna type).
    positions : list of tuple
        List of antenna positions (m) in the local station coordinates.

    """
    names = []
    positions = []
    conn = sqlite3.connect(database)
    conn.row_factory = sqlite3.Row
    c = conn.cursor()
    for row in c.execute("SELECT * FROM "+str(station)):
        names.append(row['holeName']+' '+row['antName'])
        positions.append((row['antLocationX'],
                          row['antLocationY'],
                          row['antLocationZ']))
    conn.close()
    return names, positions