Files
Bjorn/debug_schema.py
infinition b0584a1a8e feat: Add login page with dynamic RGB effects and password toggle functionality
feat: Implement package management utilities with JSON endpoints for listing and uninstalling packages

feat: Create plugin management utilities with endpoints for listing, configuring, and installing plugins

feat: Develop schedule and trigger management utilities with CRUD operations for schedules and triggers
2026-03-19 00:40:04 +01:00

37 lines
1020 B
Python

"""debug_schema.py - Dump RL table schemas to schema_debug.txt for quick inspection."""
import sqlite3
import os
db_path = "bjorn.db"
def check_schema():
if not os.path.exists(db_path):
print(f"Database {db_path} not found.")
return
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
tables = ["rl_training_log", "rl_experiences"]
with open("schema_debug.txt", "w") as f:
for table in tables:
f.write(f"\nSchema for {table}:\n")
try:
cursor.execute(f"PRAGMA table_info({table})")
columns = cursor.fetchall()
if not columns:
f.write(" (Table not found)\n")
else:
for col in columns:
f.write(f" - {col[1]} ({col[2]})\n")
except Exception as e:
f.write(f" Error: {e}\n")
conn.close()
if __name__ == "__main__":
check_schema()
print("Done writing to schema_debug.txt")