remove all clients

This commit is contained in:
KingKDot
2026-03-28 22:18:33 -05:00
parent 67616e78f3
commit 5a40164962
4 changed files with 102 additions and 0 deletions
+5
View File
@@ -265,6 +265,11 @@ export function deleteClientRow(id: string) {
db.run(`DELETE FROM clients WHERE id=?`, id);
}
export function deleteOfflineClientRows(): number {
const result = db.run(`DELETE FROM clients WHERE online=0`);
return (result as any)?.changes || 0;
}
export function getClientOnlineState(id: string): boolean | null {
const row = db.query<{ online: number }>(`SELECT online FROM clients WHERE id=?`).get(id);
if (!row) return null;