MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _requires_quotes

Method _requires_quotes

lib/sqlalchemy/sql/compiler.py:8030–8038  ·  view source on GitHub ↗

Return True if the given identifier requires quoting.

(self, value: str)

Source from the content-addressed store, hash-verified

8028 )
8029
8030 def _requires_quotes(self, value: str) -> bool:
8031 """Return True if the given identifier requires quoting."""
8032 lc_value = value.lower()
8033 return (
8034 lc_value in self.reserved_words
8035 or value[0] in self.illegal_initial_characters
8036 or not self.legal_characters.match(str(value))
8037 or (lc_value != value)
8038 )
8039
8040 def _requires_quotes_illegal_chars(self, value):
8041 """Return True if the given identifier requires quoting, but

Callers 3

quoteMethod · 0.95
format_savepointMethod · 0.95
visit_cteMethod · 0.80

Calls 2

lowerMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected