import pymysql

DB_CONFIG = {
    "host": "rm-f8ze60yirdj8786u2.mysql.rds.aliyuncs.com",
    "port": 3306,
    "user": "root",
    "password": "csqz@20255",
    "db": "csqz-client",
    "charset": "utf8mb4",
    "cursorclass": pymysql.cursors.DictCursor
}

def check():
    conn = pymysql.connect(**DB_CONFIG)
    try:
        with conn.cursor() as cursor:
            # Check family_relation_info
            print("--- family_relation_info ---")
            try:
                cursor.execute("DESCRIBE family_relation_info")
                for col in cursor.fetchall():
                    print(f"{col['Field']}: {col['Type']}")
            except Exception as e:
                print(f"Error: {e}")

            # Check family_member_info
            print("\n--- family_member_info ---")
            try:
                cursor.execute("DESCRIBE family_member_info")
                for col in cursor.fetchall():
                    print(f"{col['Field']}: {col['Type']}")
            except Exception as e:
                print(f"Error: {e}")

    finally:
        conn.close()

if __name__ == "__main__":
    check()