25 lines
683 B
Python
Executable File
25 lines
683 B
Python
Executable File
|
|
import os
|
|
import psycopg2
|
|
|
|
def check_count():
|
|
try:
|
|
db_url = os.environ.get('DATABASE_URL', 'postgresql://suggestbet:SuGGesT2026SecuRe@localhost:15432/boilerplate_db')
|
|
conn = psycopg2.connect(db_url)
|
|
cursor = conn.cursor()
|
|
|
|
cursor.execute("SELECT COUNT(*) FROM matches")
|
|
total = cursor.fetchone()[0]
|
|
|
|
cursor.execute("SELECT COUNT(*) FROM matches WHERE ht_score_home IS NOT NULL")
|
|
ht_count = cursor.fetchone()[0]
|
|
|
|
print(f"Total Matches: {total}")
|
|
print(f"Matches with HT: {ht_count}")
|
|
|
|
except Exception as e:
|
|
print(e)
|
|
|
|
if __name__ == "__main__":
|
|
check_count()
|