MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _escape_identifier

Method _escape_identifier

lib/sqlalchemy/sql/compiler.py:7980–7990  ·  view source on GitHub ↗

Escape an identifier. Subclasses should override this to provide database-dependent escaping behavior.

(self, value: str)

Source from the content-addressed store, hash-verified

7978 return re.sub(r"(__\[SCHEMA_([^\]]+)\])", replace, statement)
7979
7980 def _escape_identifier(self, value: str) -> str:
7981 """Escape an identifier.
7982
7983 Subclasses should override this to provide database-dependent
7984 escaping behavior.
7985 """
7986
7987 value = value.replace(self.escape_quote, self.escape_to_quote)
7988 if self._double_percents:
7989 value = value.replace("%", "%%")
7990 return value
7991
7992 def _unescape_identifier(self, value: str) -> str:
7993 """Canonicalize an escaped identifier.

Callers 2

quote_identifierMethod · 0.95
_r_identifiersMethod · 0.95

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected