diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-10-24 15:37:06 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-10-24 15:37:06 -0400 |
commit | 07d7c4905d65b7f28c1ffcbd33f81ee52c9fd847 (patch) | |
tree | a9c1213e4db2f905d65ae5cef2eed101560fe9be /lib/sqlalchemy/engine/interfaces.py | |
parent | e656bf4f47cf3c06975c6207ea6e54131b292bf7 (diff) | |
download | sqlalchemy-07d7c4905d65b7f28c1ffcbd33f81ee52c9fd847.tar.gz |
Fixed bug where keyword arguments passed to
:meth:`.Compiler.process` wouldn't get propagated
to the column expressions present in the columns
clause of a SELECT statement. In particular this would
come up when used by custom compilation schemes that
relied upon special flags. [ticket:2593]
Diffstat (limited to 'lib/sqlalchemy/engine/interfaces.py')
-rw-r--r-- | lib/sqlalchemy/engine/interfaces.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index e9e0da436..c60120166 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -673,7 +673,8 @@ class Compiled(object): defaults. """ - def __init__(self, dialect, statement, bind=None): + def __init__(self, dialect, statement, bind=None, + compile_kwargs=util.immutabledict()): """Construct a new ``Compiled`` object. :param dialect: ``Dialect`` to compile against. @@ -682,6 +683,9 @@ class Compiled(object): :param bind: Optional Engine or Connection to compile this statement against. + + :param compile_kwargs: additional kwargs that will be + passed to the initial call to :meth:`.Compiled.process`. """ self.dialect = dialect @@ -689,7 +693,7 @@ class Compiled(object): if statement is not None: self.statement = statement self.can_execute = statement.supports_execution - self.string = self.process(self.statement) + self.string = self.process(self.statement, **compile_kwargs) @util.deprecated("0.7", ":class:`.Compiled` objects now compile " "within the constructor.") |