import sqlite3


def fetch_naming_prefix(database):
    """ Get naming prefix from the database run_info table """
    conn = sqlite3.connect(database)
    conn.row_factory = sqlite3.Row
    cursor = conn.cursor()
    cursor.execute("SELECT value FROM run_info WHERE item = 'idprefix'")
    prefix = cursor.fetchone()[0]

    conn.close()
    return prefix