From a43a0e8b68c28b72404e85e4b4e8999443dd3fc5 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 23 Oct 2009 01:08:02 +0000 Subject: - insert() and update() constructs can now embed bindparam() objects using names that match the keys of columns. These bind parameters will circumvent the usual route to those keys showing up in the VALUES or SET clause of the generated SQL. [ticket:1579] --- lib/sqlalchemy/sql/compiler.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 4c3130879..5f5b31c68 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -47,7 +47,7 @@ RESERVED_WORDS = set([ 'using', 'verbose', 'when', 'where']) LEGAL_CHARACTERS = re.compile(r'^[A-Z0-9_$]+$', re.I) -ILLEGAL_INITIAL_CHARACTERS = re.compile(r'[0-9$]') +ILLEGAL_INITIAL_CHARACTERS = set(xrange(0, 10)).union(['$']) BIND_PARAMS = re.compile(r'(?