From c1221b7cd3392104a2ad0b183a4b44485d3166c4 Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Thu, 27 Sep 2007 17:23:41 +0000 Subject: - The IdentifierPreprarer's _requires_quotes test is now regex based. Any out-of-tree dialects that provide custom sets of legal_characters or illegal_initial_characters will need to move to regexes or override _requires_quotes. --- lib/sqlalchemy/sql/compiler.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 4fca6b2ec..6d22da1de 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -36,10 +36,8 @@ RESERVED_WORDS = util.Set([ 'then', 'to', 'trailing', 'true', 'union', 'unique', 'user', 'using', 'verbose', 'when', 'where']) -LEGAL_CHARACTERS = util.Set(string.ascii_lowercase + - string.ascii_uppercase + - string.digits + '_$') -ILLEGAL_INITIAL_CHARACTERS = util.Set(string.digits + '$') +LEGAL_CHARACTERS = re.compile(r'^[A-Z0-9_$]+$', re.I) +ILLEGAL_INITIAL_CHARACTERS = re.compile(r'[0-9$]') BIND_PARAMS = re.compile(r'(?