All three were missing the transient-connection retry that sql_update and run_sql_select already had. On OperationalError (stale/dropped connection), each now retries once with a fresh engine.connect() without disposing the pool. IntegrityError (duplicate key, FK violation, NOT NULL) continues to return None without retrying — the same data would fail again and None signals a data conflict to callers, distinct from False (error) or an int (success). sql_insert_or_update retry is safe because ON DUPLICATE KEY UPDATE is idempotent. sql_insert retry is safe because OperationalError means MariaDB rolled back. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 KiB
17 KiB