Connection
Base URL, credentials and a reachable server.
Inspect foreign_keys.py for transaction timing and enforcement, keeping existing orphan reports separate from data repair.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
import sqlite3
def enable_foreign_keys(db):
if not isinstance(db, sqlite3.Connection) or db.in_transaction:
raise ValueError("foreign_keys.connection")
db.execute("PRAGMA foreign_keys = ON")
if db.execute("PRAGMA foreign_keys").fetchone() != (1,):
raise RuntimeError("foreign_keys.unavailable")
return db.execute("PRAGMA foreign_key_check").fetchall()