# Copyright (C) 2026 BoundWare LLC. All rights reserved.
# SnacTrac is licensed under the Apache License, Version 2.0
# See Licenses/LICENSE.txt for details.


import sqlite3


def get_notifications(username):

    conn = sqlite3.connect("Data/Database.db")

    cur = conn.cursor()

    cur.execute(
        """
        SELECT * 
        FROM Notifications
        WHERE username = ?
        ORDER BY priority ASC
        """,
        (username,),
    )

    notifications = cur.fetchall()

    cur.close()

    conn.close()

    return notifications
