afv-library/skills/investigating-agentforce-architecture/scripts/_shared/sql.py

11 lines
355 B
Python
Raw Normal View History

2026-06-12 18:55:46 +08:00
"""SQL-escaping helpers for SOQL string literals.
"""
from __future__ import annotations
def _escape_sql_literal(s: str) -> str:
"""Double single quotes per SOQL escaping rule. Handles O'Brien →
O''Brien, `'; DROP --` → `''; DROP --` (still harmless because it's
wrapped in surrounding single quotes)."""
return s.replace("'", "''")