#!/usr/bin/env python
"""Quick verification of Grazuri users"""
import pymysql

conn = pymysql.connect(
    host='localhost',
    user='root',
    password='password',
    database='xygbfpsg_graz',
    charset='utf8mb4'
)

cursor = conn.cursor()

# Check user table
cursor.execute("SHOW TABLES LIKE 'user'")
if cursor.fetchone():
    cursor.execute("SELECT COUNT(*) FROM user")
    count = cursor.fetchone()[0]
    print(f"Users in Grazuri table: {count}")
    
    if count > 0:
        cursor.execute("SELECT userid, name, username, role FROM user LIMIT 10")
        print("\nSample users:")
        for user in cursor.fetchall():
            print(f"  {user[0]}: {user[1]} (@{user[2]}) - {user[3]}")
        print(f"\n✅ System can fetch users flawlessly!")
    else:
        print("⚠️  Table is empty - need to import populated SQL file")
else:
    print("❌ User table doesn't exist")

conn.close()
