from Backend.DBController.DBConnection import DBConnection

def deleteAuction (receivedAuctionId, db_handler: DBConnection):
    #db_handler._DEBUG_dbCursor.execute(f"CREATE OR REPLACE VIEW COPY_ITEMS as select * from ITEMS;")
    #db_handler._DEBUG_dbCursor.execute(f"CREATE OR REPLACE TRIGGER DELETE_ITEM INSTEAD OF delete ON COPY_ITEMS BEGIN delete from TAGS where item_id =:OLD.item_id; delete from ITEMS where item_id =:OLD.item_id;END;")
    #result = db_handler._DEBUG_dbCursor.execute(f"delete from COPY_ITEMS where item_id='{receivedAuctionId}'")
    #db_handler.execute('commit')
    result = db_handler._DEBUG_dbCursor.execute(f"delete from copy_items where item_id='{receivedAuctionId}'")
    db_handler.execute('commit')
    print(result)
    if result != []:
        message="DELETE SUCCCES"
    else:
        message="FAIL"

    return message.encode()
6a0ad3279166c4aa68f85043aeb5651597060bc7
<mask token>

<mask token>


def deleteAuction(receivedAuctionId, db_handler: DBConnection):
    result = db_handler._DEBUG_dbCursor.execute(
        f"delete from copy_items where item_id='{receivedAuctionId}'")
    db_handler.execute('commit')
    print(result)
    if result != []:
        message = 'DELETE SUCCCES'
    else:
        message = 'FAIL'
    return message.encode()

from Backend.DBController.DBConnection import DBConnection


def deleteAuction(receivedAuctionId, db_handler: DBConnection):
    result = db_handler._DEBUG_dbCursor.execute(
        f"delete from copy_items where item_id='{receivedAuctionId}'")
    db_handler.execute('commit')
    print(result)
    if result != []:
        message = 'DELETE SUCCCES'
    else:
        message = 'FAIL'
    return message.encode()

from Backend.DBController.DBConnection import DBConnection

def deleteAuction (receivedAuctionId, db_handler: DBConnection):
    #db_handler._DEBUG_dbCursor.execute(f"CREATE OR REPLACE VIEW COPY_ITEMS as select * from ITEMS;")
    #db_handler._DEBUG_dbCursor.execute(f"CREATE OR REPLACE TRIGGER DELETE_ITEM INSTEAD OF delete ON COPY_ITEMS BEGIN delete from TAGS where item_id =:OLD.item_id; delete from ITEMS where item_id =:OLD.item_id;END;")
    #result = db_handler._DEBUG_dbCursor.execute(f"delete from COPY_ITEMS where item_id='{receivedAuctionId}'")
    #db_handler.execute('commit')
    result = db_handler._DEBUG_dbCursor.execute(f"delete from copy_items where item_id='{receivedAuctionId}'")
    db_handler.execute('commit')
    print(result)
    if result != []:
        message="DELETE SUCCCES"
    else:
        message="FAIL"

    return message.encode()