#!/usr/bin/env python3
import pymysql

conn = pymysql.connect(
    host="192.168.200.4",
    port=3307,
    user="developer",
    password="DEVEL!now1",
    database="astara_pdb_demo_hy",
    charset="utf8mb4",
)
cur = conn.cursor(pymysql.cursors.DictCursor)
cur.execute("SHOW TABLES")
tables = [list(r.values())[0] for r in cur.fetchall()]
for t in tables:
    if "col" in t.lower() or "kol" in t.lower() or "barw" in t.lower() or "lack" in t.lower():
        print("table:", t)
        cur.execute(f"DESCRIBE `{t}`")
        for row in cur.fetchall():
            print(" ", row)

# Also check if niedostepny_w is used elsewhere with examples
cur.execute("SELECT DISTINCT niedostepny_w FROM con_colors WHERE niedostepny_w IS NOT NULL LIMIT 20")
print("niedostepny samples:", cur.fetchall())
conn.close()
