From: Mike Bayer Date: Thu, 26 Jul 2007 18:55:57 +0000 (+0000) Subject: - Compiled is just an object now. the ClauseVisitor portion X-Git-Tag: rel_0_4_6~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9310999f341ea4b43304975de2dcb72220d0f9bb;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Compiled is just an object now. the ClauseVisitor portion is now specific to ANSICompiler. --- diff --git a/lib/sqlalchemy/ansisql.py b/lib/sqlalchemy/ansisql.py index 83a05abdd6..22227d56a8 100644 --- a/lib/sqlalchemy/ansisql.py +++ b/lib/sqlalchemy/ansisql.py @@ -102,7 +102,7 @@ class ANSIDialect(default.DefaultDialect): """ return ANSIIdentifierPreparer(self) -class ANSICompiler(engine.Compiled): +class ANSICompiler(engine.Compiled, sql.ClauseVisitor): """Default implementation of Compiled. Compiles ClauseElements into ANSI-compliant SQL strings. diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 4d6cbececd..ad02942556 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -388,7 +388,7 @@ class ExecutionContext(object): raise NotImplementedError() -class Compiled(sql.ClauseVisitor): +class Compiled(object): """Represent a compiled SQL expression. The ``__str__`` method of the ``Compiled`` object should produce @@ -429,7 +429,12 @@ class Compiled(sql.ClauseVisitor): self.parameters = parameters self.bind = bind self.can_execute = statement.supports_execution() - + + def compile(self): + """Produce the internal string representation of this element.""" + + raise NotImplementedError() + def __str__(self): """Return the string text of the generated SQL statement."""