def select_all_tasks(conn): """ Query all rows in the tasks table :param conn: the Connection object :return: """ cur = conn.cursor() cur.execute("SELECT * FROM tasks") rows = cur.fetchall() for row in rows: print(row)
def select_task_by_priority(conn, priority): """ Query tasks by priority :param conn: the Connection object :param priority: :return: """ cur = conn.cursor() cur.execute("SELECT * FROM tasks WHERE priority=?", (priority,)) rows = cur.fetchall() for row in rows: print(row)
References
https://www.sqlitetutorial.net/sqlite-python/sqlite-python-select/