diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-09 10:24:15 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-09 11:01:01 -0400 |
| commit | 5ed90cb05a1526c854e3e8f84a5c29d0379bfa95 (patch) | |
| tree | cf687557b0cb22375ca481ba2eedc8d6b937062e /lib/sqlalchemy/sql | |
| parent | 28138ee6fbc1273f1bf16699927e09db81ae7870 (diff) | |
| download | sqlalchemy-5ed90cb05a1526c854e3e8f84a5c29d0379bfa95.tar.gz | |
Repair documentation issues
Fixes some remaining issues detailed at #5428.
Fixes: #5428
Change-Id: I942a64411766fc82f30791eee570747a218af77d
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/ddl.py | 40 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/selectable.py | 8 |
2 files changed, 41 insertions, 7 deletions
diff --git a/lib/sqlalchemy/sql/ddl.py b/lib/sqlalchemy/sql/ddl.py index 3c23b50ca..67c11f6c7 100644 --- a/lib/sqlalchemy/sql/ddl.py +++ b/lib/sqlalchemy/sql/ddl.py @@ -94,9 +94,11 @@ class DDLElement(roles.DDLRole, Executable, _DDLCompiles): :param target: Optional, defaults to None. The target :class:`_schema.SchemaItem` - for the execute call. Will be passed to the ``on`` callable if any, - and may also provide string expansion data for the statement. - See ``execute_at`` for more information. + for the execute call. This is equivalent to passing the + :class:`_schema.SchemaItem` to the :meth:`.DDLElement.against` + method and then invoking :meth:`_schema.DDLElement.execute` + upon the resulting :class:`_schema.DDLElement` object. See + :meth:`.DDLElement.against` for further detail. """ @@ -110,7 +112,37 @@ class DDLElement(roles.DDLRole, Executable, _DDLCompiles): @_generative def against(self, target): - """Return a copy of this DDL against a specific schema item.""" + """Return a copy of this :class:`_schema.DDLElement` which will include + the given target. + + This essentially applies the given item to the ``.target`` attribute + of the returned :class:`_schema.DDLElement` object. This target + is then usable by event handlers and compilation routines in order to + provide services such as tokenization of a DDL string in terms of a + particular :class:`_schema.Table`. + + When a :class:`_schema.DDLElement` object is established as an event + handler for the :meth:`_events.DDLEvents.before_create` or + :meth:`_events.DDLEvents.after_create` events, and the event + then occurs for a given target such as a :class:`_schema.Constraint` + or :class:`_schema.Table`, that target is established with a copy + of the :class:`_schema.DDLElement` object using this method, which + then proceeds to the :meth:`_schema.DDLElement.execute` method + in order to invoke the actual DDL instruction. + + :param target: a :class:`_schema.SchemaItem` that will be the subject + of a DDL operation. + + :return: a copy of this :class:`_schema.DDLElement` with the + ``.target`` attribute assigned to the given + :class:`_schema.SchemaItem`. + + .. seealso:: + + :class:`_schema.DDL` - uses tokenization against the "target" when + processing the DDL string. + + """ self.target = target diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index ea3bb0512..0c808e7a7 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -4108,9 +4108,11 @@ class Select( column with its parent table's (or aliases) name so that name conflicts between columns in different tables don't occur. The format of the label is ``<tablename>_<column>``. The "c" - collection of the resulting :class:`_expression.Select` - object will use these - names as well for targeting column members. + collection of a :class:`_expression.Subquery` created + against this :class:`_expression.Select` + object, as well as the :attr:`_expression.Select.selected_columns` + collection of the :class:`_expression.Select` itself, will use these + names for targeting column members. This parameter can also be specified on an existing :class:`_expression.Select` object using the |
