Files
iddaai-be/scripts/check_subtypes.py
T
fahricansecer 2f0b85a0c7
Deploy Iddaai Backend / build-and-deploy (push) Failing after 18s
first (part 2: other directories)
2026-04-16 15:11:25 +03:00

21 lines
662 B
Python
Executable File

import os
import psycopg2
from psycopg2.extras import RealDictCursor
try:
db_url = os.environ.get('DATABASE_URL', 'postgresql://suggestbet:SuGGesT2026SecuRe@localhost:15432/boilerplate_db')
conn = psycopg2.connect(db_url)
cursor = conn.cursor(cursor_factory=RealDictCursor)
cursor.execute("SELECT event_subtype, COUNT(*) as count FROM match_player_events GROUP BY event_subtype ORDER BY count DESC LIMIT 20")
results = cursor.fetchall()
print("\n--- Event Subtypes ---")
for row in results:
print(f"{row['event_subtype']}: {row['count']}")
conn.close()
except Exception as e:
print(f"Error: {e}")