import sqlite3


def get_db_table_fields(db, table):
    """given a database path and a table name, return a list of the field names
    in the table.

    Arguments:
    - `db`: full path to sqlite database
    - `table`: which table do want the names for?

    """

    con = sqlite3.connect(db)
    with con:
        cur = con.cursor()
        cur.execute("pragma table_info([{}])".format(table))
        rows = cur.fetchall()
    fields = [x[1] for x in rows]
    return fields