#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1028
Task: Write a Python function that reads /Eden/DATA/omega_evolution.db, counts total rows, and prints the schema
Generated: 2026-02-12T17:34:30.252027
"""

import sqlite3

def analyze_database(db_path):
    conn = sqlite3.connect(db_path)
    cursor = conn.cursor()
    
    # Get list of tables
    cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%';")
    tables = [row[0] for row in cursor.fetchall()]
    
    total_rows = 0
    for table in tables:
        cursor.execute(f"SELECT COUNT(*) FROM {table};")
        count = cursor.fetchone()[0]
        total_rows += count
    
    # Print schema for each table
    for table in tables:
        cursor.execute(f"PRAGMA table_info({table});")
        columns = cursor.fetchall()
        print(f"Schema for {table}:")
        for col in columns:
            print(f"  {col[1]} {col[2]}")
    
    print(f"Total rows: {total_rows}")
    conn.close()

if __name__ == '__main__':
    analyze_database("/Eden/DATA/omega_evolution.db")