# 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


# Delete entry from a database table.
def delete_entry_table(table, column, identifier):

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

    cur = conn.cursor()

    cur.execute("PRAGMA foreign_keys = ON;")

    cur.execute(
        f'DELETE FROM {table} WHERE "{column}" = ?',
        (identifier,),
    )

    conn.commit()

    cur.close()

    conn.close()
