feat: alternar_ativo em CLIENTE e limpar em LOG_PAINEL (camada de banco)

This commit is contained in:
Gustavo
2026-08-20 10:49:43 -03:00
parent 0fdf4ab4e3
commit 0c82170c26
4 changed files with 48 additions and 0 deletions
+13
View File
@@ -65,3 +65,16 @@ def contar() -> int:
return cur.fetchone()["total"]
finally:
conn.close()
def limpar() -> None:
"""Apaga todo o histórico de LOG_PAINEL. Quem chama (o router) grava
uma entrada nova logo depois disso, registrando quem limpou — nunca
chamar isso sem seguir com um registrar() depois, senão o rastro da
própria limpeza se perde."""
conn = get_connection()
try:
with conn.cursor() as cur:
cur.execute("DELETE FROM LOG_PAINEL")
finally:
conn.close()