Kuby/check_schema.py

19 lines
527 B
Python
Raw Permalink Normal View History

import sqlite3
import os
db_path = "/home/gameurpro12/Documents/Mes_projets/Discord_bot/backup_kuby/config.db"
if os.path.exists(db_path):
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
try:
cursor.execute("PRAGMA table_info(server_configs)")
rows = cursor.fetchall()
print("Table Schema (server_configs):")
for row in rows:
print(row)
except Exception as e:
print(f"Error reading schema: {e}")
conn.close()
else:
print("Database not found")