]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
restore the deprecated docs
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Sep 2010 14:25:58 +0000 (10:25 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Sep 2010 14:25:58 +0000 (10:25 -0400)
doc/build/reference/sqlalchemy/schema.rst
lib/sqlalchemy/interfaces.py
lib/sqlalchemy/schema.py

index 32ebaa6169a2ead82da136346ea1826ae369b2ad..3352cb1a2aa41737584ba57c72cd7ced1927ba7b 100644 (file)
@@ -102,8 +102,13 @@ Default Generators and Markers
 
 .. _schema_api_ddl:
 
-DDL Generation
---------------
+DDL Generation and Events
+--------------------------
+
+.. autoclass:: DDLEvents
+    :members:
+    :undoc-members:
+    :show-inheritance:
 
 .. autoclass:: DDLElement
     :members:
@@ -155,15 +160,3 @@ DDL Generation
     :undoc-members:
     :show-inheritance:
 
-Internals
----------
-
-.. autoclass:: SchemaItem
-    :members:
-    :undoc-members:
-    :show-inheritance:
-
-.. autoclass:: SchemaVisitor
-    :members:
-    :undoc-members:
-    :show-inheritance:
index 2c16935ce47cec6eef9f9d8dad31add1df258954..ff29f1969e296949f1c717808d9141980dd591c9 100644 (file)
@@ -13,7 +13,7 @@ class PoolListener(object):
 
     .. note:: :class:`PoolListener` is deprecated.   Please
        refer to :func:`event.listen` as well as 
-       :attr:`.Pool.events`.
+       :class:`.PoolEvents`.
     
     Usage::
     
index 4882c0d150f92440ce1e92b33cc8092741f9103e..3e7cad70e4ee960e5b78fc8649c2b01460cc93c8 100644 (file)
@@ -2170,11 +2170,33 @@ class DDLElement(expression.Executable, expression.ClauseElement):
             bind.engine.logger.info(
                         "DDL execution skipped, criteria not met.")
 
+    @util.deprecated("0.7", "See :class:`.DDLEvents`, as well as "
+        ":meth:`.DDLEvent.execute_if`.")
     def execute_at(self, event_name, target):
         """Link execution of this DDL to the DDL lifecycle of a SchemaItem.
         
-        Deprecated.  See :class:`.DDLEvents`, as well as
-        :meth:`.DDLEvent.execute_if`.
+        Links this ``DDLElement`` to a ``Table`` or ``MetaData`` instance,
+        executing it when that schema item is created or dropped. The DDL
+        statement will be executed using the same Connection and transactional
+        context as the Table create/drop itself. The ``.bind`` property of
+        this statement is ignored.
+        
+        :param event:
+          One of the events defined in the schema item's ``.ddl_events``;
+          e.g. 'before-create', 'after-create', 'before-drop' or 'after-drop'
+
+        :param target:
+          The Table or MetaData instance for which this DDLElement will
+          be associated with.
+
+        A DDLElement instance can be linked to any number of schema items. 
+
+        ``execute_at`` builds on the ``append_ddl_listener`` interface of
+        :class:`MetaData` and :class:`Table` objects.
+
+        Caveat: Creating or dropping a Table in isolation will also trigger
+        any DDL set to ``execute_at`` that Table's MetaData.  This may change
+        in a future release.
         
         """
         
@@ -2323,6 +2345,42 @@ class DDL(DDLElement):
         :param on:
           Deprecated.  See :meth:`.DDLElement.execute_if`.
 
+          Optional filtering criteria.  May be a string, tuple or a callable
+          predicate.  If a string, it will be compared to the name of the
+          executing database dialect::
+
+            DDL('something', on='postgresql')
+
+          If a tuple, specifies multiple dialect names::
+
+            DDL('something', on=('postgresql', 'mysql'))
+
+          If a callable, it will be invoked with four positional arguments
+          as well as optional keyword arguments:
+            
+            :ddl:
+              This DDL element.
+              
+            :event:
+              The name of the event that has triggered this DDL, such as
+              'after-create' Will be None if the DDL is executed explicitly.
+
+            :target:
+              The ``Table`` or ``MetaData`` object which is the target of 
+              this event. May be None if the DDL is executed explicitly.
+
+            :connection:
+              The ``Connection`` being used for DDL execution
+
+            :tables:  
+              Optional keyword argument - a list of Table objects which are to
+              be created/ dropped within a MetaData.create_all() or drop_all()
+              method call.
+
+              
+          If the callable returns a true value, the DDL statement will be
+          executed.
+
         :param context:
           Optional dictionary, defaults to None.  These values will be
           available for use in string substitutions on the DDL statement.