diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-04-09 10:02:35 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-04-09 10:02:35 -0400 |
commit | 1eeded1687aef3132b2a1d5995321fb20b2b8dfc (patch) | |
tree | be49aea1719d1d0db2cedf89e16df68f1513ea81 /lib/sqlalchemy/ext/compiler.py | |
parent | 952383f9ee04649282519b3287241c1336502fe5 (diff) | |
download | sqlalchemy-1eeded1687aef3132b2a1d5995321fb20b2b8dfc.tar.gz |
update DDL examples removing execute_if
Fixes: #7924
Change-Id: I684bf3720010ffe34dbdd39ec8c7e0c4af94e620
Diffstat (limited to 'lib/sqlalchemy/ext/compiler.py')
-rw-r--r-- | lib/sqlalchemy/ext/compiler.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/sqlalchemy/ext/compiler.py b/lib/sqlalchemy/ext/compiler.py index f087b7f7a..b8265e88e 100644 --- a/lib/sqlalchemy/ext/compiler.py +++ b/lib/sqlalchemy/ext/compiler.py @@ -229,12 +229,19 @@ A synopsis is as follows: raise TypeError("coalesce only supports two arguments on Oracle") return "nvl(%s)" % compiler.process(element.clauses, **kw) -* :class:`~sqlalchemy.schema.DDLElement` - The root of all DDL expressions, - like CREATE TABLE, ALTER TABLE, etc. Compilation of ``DDLElement`` - subclasses is issued by a ``DDLCompiler`` instead of a ``SQLCompiler``. - ``DDLElement`` also features ``Table`` and ``MetaData`` event hooks via the - ``execute_at()`` method, allowing the construct to be invoked during CREATE - TABLE and DROP TABLE sequences. +* :class:`.DDLElement` - The root of all DDL expressions, + like CREATE TABLE, ALTER TABLE, etc. Compilation of :class:`.DDLElement` + subclasses is issued by a :class:`.DDLCompiler` instead of a + :class:`.SQLCompiler`. :class:`.DDLElement` can also be used as an event hook + in conjunction with event hooks like :meth:`.DDLEvents.before_create` and + :meth:`.DDLEvents.after_create`, allowing the construct to be invoked + automatically during CREATE TABLE and DROP TABLE sequences. + + .. seealso:: + + :ref:`metadata_ddl_toplevel` - contains examples of associating + :class:`.DDL` objects (which are themselves :class:`.DDLElement` + instances) with :class:`.DDLEvents` event hooks. * :class:`~sqlalchemy.sql.expression.Executable` - This is a mixin which should be used with any expression class that represents a "standalone" |