mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-31 04:01:24 +08:00
11 lines
355 B
Python
11 lines
355 B
Python
"""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("'", "''")
|