import sqlite3
import os

db_path = 'backend/db/memos.db'
if not os.path.exists(db_path):
    print(f"DB not found at {db_path}")
    exit(1)

conn = sqlite3.connect(db_path)
cursor = conn.cursor()

print("--- RECENT MEMOS ---")
cursor.execute("SELECT id, creator_id, content, visibility FROM cuccu_memos ORDER BY id DESC LIMIT 5")
for row in cursor.fetchall():
    print(row)

print("\n--- RECENT USERS ---")
cursor.execute("SELECT id, username FROM cuccu_users ORDER BY id DESC LIMIT 5")
for row in cursor.fetchall():
    print(row)

conn.close()
