diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-12 11:30:01 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-12 11:30:01 -0400 |
commit | 2063314232941834a1cde187e5b54fd9e898fb4d (patch) | |
tree | 01f102f0d71c8d6277aa4206be8934e590656715 /lib/sqlalchemy/sql/compiler.py | |
parent | 47ef5ed5f72b9d65a48780ee561ae84e8b05becb (diff) | |
download | sqlalchemy-2063314232941834a1cde187e5b54fd9e898fb4d.tar.gz |
much more descriptive message for bind param name conflict, [ticket:1766]
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 78c65771b..7a1821a70 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -548,9 +548,12 @@ class SQLCompiler(engine.Compiled): ) elif getattr(existing, '_is_crud', False): raise exc.CompileError( - "Bind parameter name '%s' is reserved " - "for the VALUES or SET clause of this insert/update statement." - % bindparam.key + "bindparam() name '%s' is reserved " + "for automatic usage in the VALUES or SET clause of this " + "insert/update statement. Please use a " + "name other than column name when using bindparam() " + "with insert() or update() (for example, 'b_%s')." + % (bindparam.key, bindparam.key) ) self.binds[bindparam.key] = self.binds[name] = bindparam @@ -906,9 +909,12 @@ class SQLCompiler(engine.Compiled): bindparam._is_crud = True if col.key in self.binds: raise exc.CompileError( - "Bind parameter name '%s' is reserved " - "for the VALUES or SET clause of this insert/update statement." - % col.key + "bindparam() name '%s' is reserved " + "for automatic usage in the VALUES or SET clause of this " + "insert/update statement. Please use a " + "name other than column name when using bindparam() " + "with insert() or update() (for example, 'b_%s')." + % (col.key, col.key) ) self.binds[col.key] = bindparam |