def get_folder_id(path, c):
    """Query the folder id of the directory."""
    sql = '''
        SELECT folder_id
        FROM folders
        WHERE path = ?
        '''
    c.execute(sql, (path, ))
    return c.fetchone()[0]