diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-02-12 19:54:49 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-02-12 19:54:49 +0000 |
commit | d0d5f792404126f2f3f62cb850e6b887c246178e (patch) | |
tree | 05d7718d9500c6bcd43e6f74b9365e895f609191 /lib/sqlalchemy/ext/compiler.py | |
parent | 85d335b01bf64a27e99cee915205afd99e7191b5 (diff) | |
download | sqlalchemy-d0d5f792404126f2f3f62cb850e6b887c246178e.tar.gz |
- Made sqlalchemy.sql.expressions.Executable part of public
API, used for any expression construct that can be sent to
execute(). FunctionElement now inherits Executable so that
it gains execution_options(), which are also propagated
to the select() that's generated within execute().
Executable in turn subclasses _Generative which marks
any ClauseElement that supports the @_generative
decorator - these may also become "public" for the benefit
of the compiler extension at some point.
Diffstat (limited to 'lib/sqlalchemy/ext/compiler.py')
-rw-r--r-- | lib/sqlalchemy/ext/compiler.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/compiler.py b/lib/sqlalchemy/ext/compiler.py index 7861096f9..3226b0efd 100644 --- a/lib/sqlalchemy/ext/compiler.py +++ b/lib/sqlalchemy/ext/compiler.py @@ -64,7 +64,9 @@ in-progress compilation, including ``compiler.dialect``, and :class:`~sqlalchemy.sql.compiler.DDLCompiler` both include a ``process()`` method which can be used for compilation of embedded attributes:: - class InsertFromSelect(ClauseElement): + from sqlalchemy.sql.expression import Executable, ClauseElement + + class InsertFromSelect(Executable, ClauseElement): def __init__(self, table, select): self.table = table self.select = select @@ -154,6 +156,11 @@ A big part of using the compiler extension is subclassing SQLAlchemy expression ``execute_at()`` method, allowing the construct to be invoked during CREATE TABLE and DROP TABLE sequences. +* :class:`~sqlalchemy.sql.expression.Executable` - This is a mixin which should be + used with any expression class that represents a "standalone" SQL statement that + can be passed directly to an ``execute()`` method. It is already implicit + within ``DDLElement`` and ``FunctionElement``. + """ def compiles(class_, *specs): |