CoolFace
Apppublic

malepati/custom_template_working

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
search_hex.py35 linesDownload Raw Back to root
1import sqlite32 3dbs = [4    r"c:\Users\DELL\Documents\upgrading\Accusaga_slides_presentation\servers\fastapi\app_data\fastapi.db",5    r"c:\Users\DELL\Documents\upgrading\Accusaga_slides_presentation\servers\fastapi\app_data\container.db"6]7 8search_term = "0e56f149122d4a02a5b9c8046b453c59"9 10for db_path in dbs:11    print(f"\n===== Searching {db_path} =====")12    conn = sqlite3.connect(db_path)13    cursor = conn.cursor()14    15    cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")16    tables = [t[0] for t in cursor.fetchall()]17    18    for table in tables:19        try:20            cursor.execute(f"PRAGMA table_info({table});")21            cols = [c[1] for c in cursor.fetchall()]22            23            for col in cols:24                query = f"SELECT * FROM {table} WHERE {col} = ?"25                cursor.execute(query, (search_term,))26                rows = cursor.fetchall()27                if rows:28                    print(f"EXACT MATCH in Table '{table}', Column '{col}':")29                    for r in rows:30                        print(f" - {r}")31        except Exception as e:32            pass33            34    conn.close()35