import sqlite3 conn = sqlite3.connect('db/mileage.db') cur = conn.cursor() # 테이블 목록 cur.execute("SELECT name FROM sqlite_master WHERE type='table'") tables = cur.fetchall() print('=== Tables ===') for t in tables: print(t[0]) # wholesaler/limit/setting 관련 테이블 스키마 확인 for t in tables: tname = t[0].lower() if 'wholesal' in tname or 'limit' in tname or 'setting' in tname or 'config' in tname: print(f'\n=== {t[0]} schema ===') cur.execute(f'PRAGMA table_info({t[0]})') for col in cur.fetchall(): print(col) cur.execute(f'SELECT * FROM {t[0]} LIMIT 5') rows = cur.fetchall() if rows: print('Sample data:') for r in rows: print(r)