38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
import sqlite3
|
|
|
|
def check_mindmap_nodes():
|
|
try:
|
|
conn = sqlite3.connect('database/systades.db')
|
|
cursor = conn.cursor()
|
|
|
|
# Check if the table exists
|
|
cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='mind_map_node';")
|
|
table_exists = cursor.fetchone()
|
|
|
|
if not table_exists:
|
|
print("Die Tabelle 'mind_map_node' existiert nicht!")
|
|
return
|
|
|
|
# Check for the "Wissen" node
|
|
cursor.execute("SELECT * FROM mind_map_node WHERE name = 'Wissen';")
|
|
wissen_node = cursor.fetchone()
|
|
|
|
if wissen_node:
|
|
print(f"'Wissen'-Knoten gefunden: {wissen_node}")
|
|
else:
|
|
print("'Wissen'-Knoten NICHT gefunden!")
|
|
|
|
# Get all nodes
|
|
cursor.execute("SELECT id, name FROM mind_map_node LIMIT 10;")
|
|
nodes = cursor.fetchall()
|
|
|
|
print(f"\nVorhandene Knoten (max. 10):")
|
|
for node in nodes:
|
|
print(f" - {node}")
|
|
|
|
conn.close()
|
|
except Exception as e:
|
|
print(f"Fehler: {e}")
|
|
|
|
if __name__ == "__main__":
|
|
check_mindmap_nodes() |