summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-06-23 14:03:47 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-06-23 15:58:07 -0400
commite288aff8eae6d08b040ad9026449ff4578104d1b (patch)
tree0b8e7735999f0ca0ad29e1f043d972af9371d59e /lib/sqlalchemy/sql/compiler.py
parent977678a7734d082be9851320bcc737d32ccd88bc (diff)
downloadsqlalchemy-e288aff8eae6d08b040ad9026449ff4578104d1b.tar.gz
The resolution of :class:`.ForeignKey` objects to their
target :class:`.Column` has been reworked to be as immediate as possible, based on the moment that the target :class:`.Column` is associated with the same :class:`.MetaData` as this :class:`.ForeignKey`, rather than waiting for the first time a join is constructed, or similar. This along with other improvements allows earlier detection of some foreign key configuration issues. Also included here is a rework of the type-propagation system, so that it should be reliable now to set the type as ``None`` on any :class:`.Column` that refers to another via :class:`.ForeignKey` - the type will be copied from the target column as soon as that other column is associated, and now works for composite foreign keys as well. [ticket:1765]
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index dd2a6e08c..f1fe53b73 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -2415,7 +2415,9 @@ class GenericTypeCompiler(engine.TypeCompiler):
return self.visit_VARCHAR(type_)
def visit_null(self, type_):
- raise NotImplementedError("Can't generate DDL for the null type")
+ raise exc.CompileError("Can't generate DDL for %r; "
+ "did you forget to specify a "
+ "type on this Column?" % type_)
def visit_type_decorator(self, type_):
return self.process(type_.type_engine(self.dialect))