feat: migrate displayed historical data to postgres

This commit is contained in:
devRaGonSa
2026-05-21 09:27:08 +02:00
parent c6420d5968
commit 605ab92cf8
17 changed files with 1719 additions and 25 deletions

View File

@@ -669,7 +669,6 @@ def upsert_scoreboard_candidates(
def count_migrated_tables() -> dict[str, int]:
initialize_postgres_rcon_storage()
table_names = (
"rcon_admin_log_events",
"rcon_player_profile_snapshots",
@@ -693,13 +692,11 @@ def count_migrated_tables() -> dict[str, int]:
def _fetchall(sql: str, params: Iterable[object] = ()) -> list[dict[str, object]]:
initialize_postgres_rcon_storage()
with connect_postgres() as connection:
return [dict(row) for row in connection.execute(sql, tuple(params)).fetchall()]
def _fetchone(sql: str, params: Iterable[object] = ()) -> dict[str, object] | None:
initialize_postgres_rcon_storage()
with connect_postgres() as connection:
row = connection.execute(sql, tuple(params)).fetchone()
return dict(row) if row else None