MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _requires_quotes

Method _requires_quotes

lib/sqlalchemy/sql/compiler.py:7745–7753  ·  view source on GitHub ↗

Return True if the given identifier requires quoting.

(self, value: str)

Source from the content-addressed store, hash-verified

7743 )
7744
7745 def _requires_quotes(self, value: str) -> bool:
7746 """Return True if the given identifier requires quoting."""
7747 lc_value = value.lower()
7748 return (
7749 lc_value in self.reserved_words
7750 or value[0] in self.illegal_initial_characters
7751 or not self.legal_characters.match(str(value))
7752 or (lc_value != value)
7753 )
7754
7755 def _requires_quotes_illegal_chars(self, value):
7756 """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