def list_all_folder_dirs_for_experiment(cursor, experiment_id): cursor.execute( "SELECT folders.folder_dir " "FROM folders " " JOIN folders_all_upstream_ids " " ON folders.folder_id = folders_all_upstream_ids.folder_id " "WHERE experiment_id=%s;", (experiment_id, )) return util.list_from_cursor(cursor.fetchall())
def list_all_blind_trials_full_paths_for_reviewer_experiment( cursor, reviewer_id, experiment_id): cursor.execute( "SELECT full_path " "FROM blind_trials " " JOIN blind_trials_all_upstream_ids " " ON blind_trials.trial_id = blind_trials_all_upstream_ids.trial_id;", (reviewer_id, experiment_id)) return util.list_from_cursor(cursor.fetchall())
def list_all_blind_names_for_reviewer_experiment(cursor, reviewer_id, experiment_id): cursor.execute( "SELECT blind_name " "FROM blind_folders " " JOIN blind_folders_all_upstream_ids " " ON blind_folders.blind_folder_id = blind_folders_all_upstream_ids.blind_folder_id " "WHERE blind_folders_all_upstream_ids.reviewer_id=%s AND experiment_id=%s;", (reviewer_id, experiment_id)) return util.list_from_cursor(cursor.fetchall())
def list_blind_folder_id(cursor, reviewer_id, folder_id): cursor.execute( "SELECT blind_folder_id from blind_folders WHERE reviewer_id = %s AND folder_id = %s;", (reviewer_id, folder_id)) return util.list_from_cursor(cursor.fetchall())
def list_all_experiment_names(cursor): cursor.execute( construct_basic_select(column_name='experient_name', table_name='experiments')) return util.list_from_cursor(cursor.fetchall())
def list_trial_ids_for_folder(cursor, folder_id): cursor.execute("SELECT trial_id FROM trials WHERE folder_id = %s;", (folder_id, )) return util.list_from_cursor(cursor.fetchall())
def list_all_folder_ids_for_blind_folders_of_experiment(cursor, experiment_id): cursor.execute( "SELECT folder_id FROM blind_folders_all_upstream_ids WHERE experiment_id = %s;", (experiment_id, )) return util.list_from_cursor(cursor.fetchall())
def list_all_detail_ids(cursor): cursor.execute("SELECT detail_id FROM participant_details;") return util.list_from_cursor(cursor.fetchall())
def list_all_session_dirs_for_mouse(cursor, mouse_id, experiment_id): cursor.execute( "SELECT session_dir FROM sessions WHERE mouse_id = %s AND experiment_id = %s;", (mouse_id, experiment_id)) return util.list_from_cursor(cursor.fetchall())
def list_all_folder_dirs(cursor): cursor.execute("SELECT folder_dir FROM folders;") return util.list_from_cursor(cursor.fetchall())
def list_all_blind_names(cursor): cursor.execute("SELECT blind_name FROM blind_folders;") return util.list_from_cursor(cursor.fetchall())
def list_all_session_dir_for_for_experiment(cursor, experiment_id): cursor.execute( "SELECT session_dir " "FROM sessions " "WHERE experiment_id=%s;", (experiment_id, )) return util.list_from_cursor(cursor.fetchall())
def list_all_mouse_eartags(cursor): cursor.execute("SELECT eartag FROM mouse;") return util.list_from_cursor(cursor.fetchall())
def list_all_trial_dirs_for_experiment(cursor, experiment_id): cursor.execute("SELECT trial_dir FROM trials WHERE experiment_id=%s;", (experiment_id, )) return util.list_from_cursor(cursor.fetchall())
def list_all_reviewer_scored_dirs(cursor): cursor.execute("SELECT scored_dir FROM reviewers;") return util.list_from_cursor(cursor.fetchall())
def list_all_reviewer_ids(cursor): cursor.execute("SELECT reviewer_id FROM reviewers;") return util.list_from_cursor(cursor.fetchall())
def list_all_session_dirs(cursor): cursor.execute("SELECT session_dir FROM sessions;") return util.list_from_cursor(cursor.fetchall())
def list_all_experiment_ids(cursor): select = construct_basic_select(column_name='experiment_id', table_name='experiments') cursor.execute(select) return util.list_from_cursor(cursor.fetchall())
def list_all_trial_dirs(cursor): cursor.execute("SELECT trial_dir FROM trials;") return util.list_from_cursor(cursor.fetchall())
def select(column_name: Column_Name_List, table_name: str): with Cursor() as cursor: cursor.execute(construct_basic_select(column_names=column_name, table_name=table_name)) return util.list_from_cursor(cursor.fetchall())