diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-04-23 12:54:45 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-04-23 13:01:56 -0400 |
| commit | 5347efa35e3e80c8092501b4adfe1278260d67f5 (patch) | |
| tree | cd3abe5b9c02c59bdecc7a95206b974abdea497e /lib/sqlalchemy | |
| parent | 08515f23b3ea36bce2f150b8cd82c787c4cf9e5e (diff) | |
| download | sqlalchemy-5347efa35e3e80c8092501b4adfe1278260d67f5.tar.gz | |
remove all labels and links that are no longer locatable
Change-Id: Ic975b8c20bc297d3a04dde0bed143783ae951cd4
Diffstat (limited to 'lib/sqlalchemy')
52 files changed, 190 insertions, 190 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/aiomysql.py b/lib/sqlalchemy/dialects/mysql/aiomysql.py index bc079ba17..19e352245 100644 --- a/lib/sqlalchemy/dialects/mysql/aiomysql.py +++ b/lib/sqlalchemy/dialects/mysql/aiomysql.py @@ -17,13 +17,13 @@ r""" SQLAlchemy’s continuous integration. As of September, 2021 the driver appears to be unmaintained and no longer functions for Python version 3.10, and additionally depends on a significantly outdated version of PyMySQL. - Please refer to the :ref:`asyncmy` dialect for current MySQL/MariaDB asyncio + Please refer to the ref_asyncmy dialect for current MySQL/MariaDB asyncio functionality. The aiomysql dialect is SQLAlchemy's second Python asyncio dialect. Using a special asyncio mediation layer, the aiomysql dialect is usable -as the backend for the :ref:`SQLAlchemy asyncio <asyncio_toplevel>` +as the backend for the ref_asyncio_toplevel extension package. This dialect should normally be used only with the diff --git a/lib/sqlalchemy/dialects/mysql/asyncmy.py b/lib/sqlalchemy/dialects/mysql/asyncmy.py index d3f809e6a..ce245258b 100644 --- a/lib/sqlalchemy/dialects/mysql/asyncmy.py +++ b/lib/sqlalchemy/dialects/mysql/asyncmy.py @@ -14,11 +14,11 @@ r""" :url: https://github.com/long2ice/asyncmy .. note:: The asyncmy dialect as of September, 2021 was added to provide - MySQL/MariaDB asyncio compatibility given that the :ref:`aiomysql` database + MySQL/MariaDB asyncio compatibility given that the ref_aiomysql database driver has become unmaintained, however asyncmy is itself very new. Using a special asyncio mediation layer, the asyncmy dialect is usable -as the backend for the :ref:`SQLAlchemy asyncio <asyncio_toplevel>` +as the backend for the ref_asyncio_toplevel extension package. This dialect should normally be used only with the diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index eb9ccc606..cd10db18c 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -463,7 +463,7 @@ Some limited direct support for MySQL / MariaDB extensions to SQL is currently available. * INSERT..ON DUPLICATE KEY UPDATE: See - :ref:`mysql_insert_on_duplicate_key_update` + ref_mysql_insert_on_duplicate_key_update * SELECT pragma, use :meth:`_expression.Select.prefix_with` and :meth:`_query.Query.prefix_with`:: @@ -810,7 +810,7 @@ reflection will not include foreign keys. For these tables, you may supply a .. seealso:: - :ref:`mysql_storage_engines` + ref_mysql_storage_engines .. _mysql_unique_constraints: diff --git a/lib/sqlalchemy/dialects/mysql/dml.py b/lib/sqlalchemy/dialects/mysql/dml.py index 7c724c6f1..cfab91aee 100644 --- a/lib/sqlalchemy/dialects/mysql/dml.py +++ b/lib/sqlalchemy/dialects/mysql/dml.py @@ -80,7 +80,7 @@ class Insert(StandardInsert): .. seealso:: - :ref:`mysql_insert_on_duplicate_key_update` - example of how + ref_mysql_insert_on_duplicate_key_update - example of how to use :attr:`_expression.Insert.inserted` """ @@ -139,7 +139,7 @@ class Insert(StandardInsert): .. seealso:: - :ref:`mysql_insert_on_duplicate_key_update` + ref_mysql_insert_on_duplicate_key_update """ if args and kw: diff --git a/lib/sqlalchemy/dialects/postgresql/asyncpg.py b/lib/sqlalchemy/dialects/postgresql/asyncpg.py index c879205e4..80ec8f565 100644 --- a/lib/sqlalchemy/dialects/postgresql/asyncpg.py +++ b/lib/sqlalchemy/dialects/postgresql/asyncpg.py @@ -16,7 +16,7 @@ r""" The asyncpg dialect is SQLAlchemy's first Python asyncio dialect. Using a special asyncio mediation layer, the asyncpg dialect is usable -as the backend for the :ref:`SQLAlchemy asyncio <asyncio_toplevel>` +as the backend for the ref_asyncio_toplevel extension package. This dialect should normally be used only with the diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index ad5e346b7..c334d1285 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -198,7 +198,7 @@ Valid values for ``isolation_level`` on most PostgreSQL dialects include: :ref:`dbapi_autocommit` - :ref:`postgresql_readonly_deferrable` + ref_postgresql_readonly_deferrable :ref:`psycopg2_isolation_level` @@ -353,7 +353,7 @@ Remote-Schema Table Introspection and PostgreSQL search_path attribute set up. The PostgreSQL dialect can reflect tables from any schema, as outlined in -:ref:`metadata_reflection_schemas`. +ref_metadata_reflection_schemas. With regards to tables which these :class:`_schema.Table` objects refer to via foreign key constraint, a decision must be made as to how @@ -1067,7 +1067,7 @@ construct, the DBAPI's "autocommit" mode must be used:: .. seealso:: - :ref:`postgresql_isolation_level` + ref_postgresql_isolation_level .. _postgresql_index_reflection: diff --git a/lib/sqlalchemy/dialects/postgresql/dml.py b/lib/sqlalchemy/dialects/postgresql/dml.py index e17b87d1e..190645ec4 100644 --- a/lib/sqlalchemy/dialects/postgresql/dml.py +++ b/lib/sqlalchemy/dialects/postgresql/dml.py @@ -77,7 +77,7 @@ class Insert(StandardInsert): .. seealso:: - :ref:`postgresql_insert_on_conflict` - example of how + ref_postgresql_insert_on_conflict - example of how to use :attr:`_expression.Insert.excluded` """ @@ -149,7 +149,7 @@ class Insert(StandardInsert): .. seealso:: - :ref:`postgresql_insert_on_conflict` + ref_postgresql_insert_on_conflict """ self._post_values_clause = OnConflictDoUpdate( @@ -186,7 +186,7 @@ class Insert(StandardInsert): .. seealso:: - :ref:`postgresql_insert_on_conflict` + ref_postgresql_insert_on_conflict """ self._post_values_clause = OnConflictDoNothing( diff --git a/lib/sqlalchemy/dialects/postgresql/ext.py b/lib/sqlalchemy/dialects/postgresql/ext.py index c79e90034..be2b066cd 100644 --- a/lib/sqlalchemy/dialects/postgresql/ext.py +++ b/lib/sqlalchemy/dialects/postgresql/ext.py @@ -198,14 +198,14 @@ class ExcludeConstraint(ColumnCollectionConstraint): :param ops: Optional dictionary. Used to define operator classes for the elements; works the same way as that of the - :ref:`postgresql_ops <postgresql_operator_classes>` + ref_postgresql_operator_classes parameter specified to the :class:`_schema.Index` construct. .. versionadded:: 1.3.21 .. seealso:: - :ref:`postgresql_operator_classes` - general description of how + ref_postgresql_operator_classes - general description of how PostgreSQL operator classes are specified. """ diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py index 3f01b00e8..7eafad3e4 100644 --- a/lib/sqlalchemy/dialects/postgresql/pg8000.py +++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py @@ -85,7 +85,7 @@ of the :ref:`psycopg2 <psycopg2_isolation_level>` dialect: .. seealso:: - :ref:`postgresql_isolation_level` + ref_postgresql_isolation_level :ref:`psycopg2_isolation_level` diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index e28bd8fda..3e758f989 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -52,7 +52,7 @@ may be passed to :func:`_sa.create_engine()`, and include the following: .. seealso:: - :ref:`psycopg2_executemany_mode` + ref_psycopg2_executemany_mode .. tip:: @@ -376,7 +376,7 @@ The psycopg2 dialect fully supports SAVEPOINT and two-phase commit operations. Psycopg2 Transaction Isolation Level ------------------------------------- -As discussed in :ref:`postgresql_isolation_level`, +As discussed in ref_postgresql_isolation_level, all PostgreSQL dialects support setting of transaction isolation level both via the ``isolation_level`` parameter passed to :func:`_sa.create_engine` , @@ -398,7 +398,7 @@ The psycopg2 dialect supports these constants for isolation level: .. seealso:: - :ref:`postgresql_isolation_level` + ref_postgresql_isolation_level :ref:`pg8000_isolation_level` diff --git a/lib/sqlalchemy/dialects/postgresql/types.py b/lib/sqlalchemy/dialects/postgresql/types.py index edab23935..fbe54a829 100644 --- a/lib/sqlalchemy/dialects/postgresql/types.py +++ b/lib/sqlalchemy/dialects/postgresql/types.py @@ -244,7 +244,7 @@ class TSVECTOR(sqltypes.TypeEngine[str]): .. seealso:: - :ref:`postgresql_match` + ref_postgresql_match """ diff --git a/lib/sqlalchemy/dialects/sqlite/aiosqlite.py b/lib/sqlalchemy/dialects/sqlite/aiosqlite.py index f9c60efc1..a0ca5135d 100644 --- a/lib/sqlalchemy/dialects/sqlite/aiosqlite.py +++ b/lib/sqlalchemy/dialects/sqlite/aiosqlite.py @@ -24,7 +24,7 @@ databases are not socket-based. However it does provide a working asyncio interface that's useful for testing and prototyping purposes. Using a special asyncio mediation layer, the aiosqlite dialect is usable -as the backend for the :ref:`SQLAlchemy asyncio <asyncio_toplevel>` +as the backend for the ref_asyncio_toplevel extension package. This dialect should normally be used only with the diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index 6200cee5a..53ac3ca86 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -214,7 +214,7 @@ by *not even emitting BEGIN* until the first write operation. SQLite's transactional scope is impacted by unresolved issues in the pysqlite driver, which defers BEGIN statements to a greater - degree than is often feasible. See the section :ref:`pysqlite_serializable` + degree than is often feasible. See the section ref_pysqlite_serializable for techniques to work around this behavior. .. seealso:: @@ -274,7 +274,7 @@ won't work at all with pysqlite unless workarounds are taken. SQLite's SAVEPOINT feature is impacted by unresolved issues in the pysqlite driver, which defers BEGIN statements to a greater - degree than is often feasible. See the section :ref:`pysqlite_serializable` + degree than is often feasible. See the section ref_pysqlite_serializable for techniques to work around this behavior. Transactional DDL @@ -290,7 +290,7 @@ workarounds are required. SQLite's transactional DDL is impacted by unresolved issues in the pysqlite driver, which fails to emit BEGIN and additionally forces a COMMIT to cancel any transaction when DDL is encountered. - See the section :ref:`pysqlite_serializable` + See the section ref_pysqlite_serializable for techniques to work around this behavior. .. _sqlite_foreign_keys: @@ -349,7 +349,7 @@ ON CONFLICT support for constraints .. seealso:: This section describes the :term:`DDL` version of "ON CONFLICT" for SQLite, which occurs within a CREATE TABLE statement. For "ON CONFLICT" as - applied to an INSERT statement, see :ref:`sqlite_on_conflict_insert`. + applied to an INSERT statement, see ref_sqlite_on_conflict_insert. SQLite supports a non-standard DDL clause known as ON CONFLICT which can be applied to primary key, unique, check, and not null constraints. In DDL, it is @@ -459,7 +459,7 @@ INSERT...ON CONFLICT (Upsert) .. seealso:: This section describes the :term:`DML` version of "ON CONFLICT" for SQLite, which occurs within an INSERT statement. For "ON CONFLICT" as - applied to a CREATE TABLE statement, see :ref:`sqlite_on_conflict_ddl`. + applied to a CREATE TABLE statement, see ref_sqlite_on_conflict_ddl. From version 3.24.0 onwards, SQLite supports "upserts" (update or insert) of rows into a table via the ``ON CONFLICT`` clause of the ``INSERT`` diff --git a/lib/sqlalchemy/dialects/sqlite/dml.py b/lib/sqlalchemy/dialects/sqlite/dml.py index 3f829076b..296a1d40c 100644 --- a/lib/sqlalchemy/dialects/sqlite/dml.py +++ b/lib/sqlalchemy/dialects/sqlite/dml.py @@ -53,7 +53,7 @@ class Insert(StandardInsert): .. seealso:: - :ref:`sqlite_on_conflict_insert` + ref_sqlite_on_conflict_insert """ diff --git a/lib/sqlalchemy/dialects/sqlite/pysqlcipher.py b/lib/sqlalchemy/dialects/sqlite/pysqlcipher.py index 28b900ea5..1eeafd445 100644 --- a/lib/sqlalchemy/dialects/sqlite/pysqlcipher.py +++ b/lib/sqlalchemy/dialects/sqlite/pysqlcipher.py @@ -80,7 +80,7 @@ Pooling Behavior ---------------- The driver makes a change to the default pool behavior of pysqlite -as described in :ref:`pysqlite_threading_pooling`. The pysqlcipher driver +as described in ref_pysqlite_threading_pooling. The pysqlcipher driver has been observed to be significantly slower on connection than the pysqlite driver, most likely due to the encryption overhead, so the dialect here defaults to using the :class:`.SingletonThreadPool` diff --git a/lib/sqlalchemy/engine/cursor.py b/lib/sqlalchemy/engine/cursor.py index aaf2c1918..b9cce9edf 100644 --- a/lib/sqlalchemy/engine/cursor.py +++ b/lib/sqlalchemy/engine/cursor.py @@ -1576,11 +1576,11 @@ class CursorResult(Result[_T]): .. note:: As indicated below, in current SQLAlchemy versions this accessor is only useful beyond what's already supplied by :attr:`_engine.CursorResult.inserted_primary_key` when using the - :ref:`postgresql_psycopg2` dialect. Future versions hope to + psycopg2 dialect. Future versions hope to generalize this feature to more dialects. This accessor is added to support dialects that offer the feature - that is currently implemented by the :ref:`psycopg2_executemany_mode` + that is currently implemented by the ref_psycopg2_executemany_mode feature, currently **only the psycopg2 dialect**, which provides for many rows to be INSERTed at once while still retaining the behavior of being able to return server-generated primary key values. diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 8992334ee..635173392 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -2150,7 +2150,7 @@ class DefaultExecutionContext(ExecutionContext): """A dictionary of parameters applied to the current row. This attribute is only available in the context of a user-defined default - generation function, e.g. as described at :ref:`context_default_functions`. + generation function, e.g. as described at ref_context_default_functions. It consists of a dictionary which includes entries for each column/value pair that is to be part of the INSERT or UPDATE statement. The keys of the dictionary will be the key value of each :class:`_schema.Column`, @@ -2167,7 +2167,7 @@ class DefaultExecutionContext(ExecutionContext): :meth:`.DefaultExecutionContext.get_current_parameters` - :ref:`context_default_functions` + ref_context_default_functions """ @@ -2176,7 +2176,7 @@ class DefaultExecutionContext(ExecutionContext): This method can only be used in the context of a user-defined default generation function, e.g. as described at - :ref:`context_default_functions`. When invoked, a dictionary is + ref_context_default_functions. When invoked, a dictionary is returned which includes entries for each column/value pair that is part of the INSERT or UPDATE statement. The keys of the dictionary will be the key value of each :class:`_schema.Column`, @@ -2201,7 +2201,7 @@ class DefaultExecutionContext(ExecutionContext): :attr:`.DefaultExecutionContext.current_parameters` - :ref:`context_default_functions` + ref_context_default_functions """ try: diff --git a/lib/sqlalchemy/engine/events.py b/lib/sqlalchemy/engine/events.py index c1b182a0a..1ce2cfbd0 100644 --- a/lib/sqlalchemy/engine/events.py +++ b/lib/sqlalchemy/engine/events.py @@ -940,13 +940,13 @@ class DialectEvents(event.Events[Dialect]): .. seealso:: - :ref:`mssql_pyodbc_setinputsizes` + ref_mssql_pyodbc_setinputsizes .. versionadded:: 1.2.9 .. seealso:: - :ref:`cx_oracle_setinputsizes` + ref_cx_oracle_setinputsizes """ pass diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index 0216c155d..74ba176d1 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -3388,7 +3388,7 @@ class AdaptedConnection: .. seealso:: - :ref:`asyncio_events_run_async` + ref_asyncio_events_run_async """ return await_only(fn(self._connection)) diff --git a/lib/sqlalchemy/event/api.py b/lib/sqlalchemy/event/api.py index bb1dbea0f..6822cd7e2 100644 --- a/lib/sqlalchemy/event/api.py +++ b/lib/sqlalchemy/event/api.py @@ -68,7 +68,7 @@ def listen( internal list upon discovery. This feature is not typically used or recommended by the SQLAlchemy maintainers, but is provided to ensure certain user defined functions can run before others, such as when - :ref:`Changing the sql_mode in MySQL <mysql_sql_mode>`. + ref_mysql_sql_mode. :param bool named: When using named argument passing, the names listed in the function argument specification will be used as keys in the diff --git a/lib/sqlalchemy/ext/associationproxy.py b/lib/sqlalchemy/ext/associationproxy.py index 243c140f8..863611448 100644 --- a/lib/sqlalchemy/ext/associationproxy.py +++ b/lib/sqlalchemy/ext/associationproxy.py @@ -156,13 +156,13 @@ def association_proxy( :ref:`cascade_scalar_deletes` - complete usage example - :param init: Specific to :ref:`orm_declarative_native_dataclasses`, + :param init: Specific to ref_orm_declarative_native_dataclasses, specifies if the mapped attribute should be part of the ``__init__()`` method as generated by the dataclass process. .. versionadded:: 2.0.0b4 - :param repr: Specific to :ref:`orm_declarative_native_dataclasses`, + :param repr: Specific to ref_orm_declarative_native_dataclasses, specifies if the attribute established by this :class:`.AssociationProxy` should be part of the ``__repr__()`` method as generated by the dataclass process. @@ -170,20 +170,20 @@ def association_proxy( .. versionadded:: 2.0.0b4 :param default_factory: Specific to - :ref:`orm_declarative_native_dataclasses`, specifies a default-value + ref_orm_declarative_native_dataclasses, specifies a default-value generation function that will take place as part of the ``__init__()`` method as generated by the dataclass process. .. versionadded:: 2.0.0b4 :param compare: Specific to - :ref:`orm_declarative_native_dataclasses`, indicates if this field + ref_orm_declarative_native_dataclasses, indicates if this field should be included in comparison operations when generating the ``__eq__()`` and ``__ne__()`` methods for the mapped class. .. versionadded:: 2.0.0b4 - :param kw_only: Specific to :ref:`orm_declarative_native_dataclasses`, + :param kw_only: Specific to ref_orm_declarative_native_dataclasses, indicates if this field should be marked as keyword-only when generating the ``__init__()`` method as generated by the dataclass process. diff --git a/lib/sqlalchemy/ext/asyncio/engine.py b/lib/sqlalchemy/ext/asyncio/engine.py index 6dfca463f..201009510 100644 --- a/lib/sqlalchemy/ext/asyncio/engine.py +++ b/lib/sqlalchemy/ext/asyncio/engine.py @@ -69,7 +69,7 @@ def create_async_engine(url: Union[str, URL], **kw: Any) -> AsyncEngine: Arguments passed to :func:`_asyncio.create_async_engine` are mostly identical to those passed to the :func:`_sa.create_engine` function. The specified dialect must be an asyncio-compatible dialect - such as :ref:`dialect-postgresql-asyncpg`. + such as ref_dialect-postgresql-asyncpg. .. versionadded:: 1.4 @@ -93,7 +93,7 @@ def async_engine_from_config( This function is analogous to the :func:`_sa.engine_from_config` function in SQLAlchemy Core, except that the requested dialect must be an - asyncio-compatible dialect such as :ref:`dialect-postgresql-asyncpg`. + asyncio-compatible dialect such as ref_dialect-postgresql-asyncpg. The argument signature of the function is identical to that of :func:`_sa.engine_from_config`. @@ -117,7 +117,7 @@ def create_async_pool_from_url(url: Union[str, URL], **kwargs: Any) -> Pool: Arguments passed to :func:`_asyncio.create_async_pool_from_url` are mostly identical to those passed to the :func:`_sa.create_pool_from_url` function. The specified dialect must be an asyncio-compatible dialect - such as :ref:`dialect-postgresql-asyncpg`. + such as ref_dialect-postgresql-asyncpg. .. versionadded:: 2.0.10 diff --git a/lib/sqlalchemy/ext/asyncio/scoping.py b/lib/sqlalchemy/ext/asyncio/scoping.py index 52eeb0828..f7c50d926 100644 --- a/lib/sqlalchemy/ext/asyncio/scoping.py +++ b/lib/sqlalchemy/ext/asyncio/scoping.py @@ -109,7 +109,7 @@ _T = TypeVar("_T", bound=Any) class async_scoped_session(Generic[_AS]): """Provides scoped management of :class:`.AsyncSession` objects. - See the section :ref:`asyncio_scoped_session` for usage details. + See the section ref_asyncio_scoped_session for usage details. .. versionadded:: 1.4.19 @@ -610,7 +610,7 @@ class async_scoped_session(Generic[_AS]): .. seealso:: - :ref:`session_expire` - introductory material + ref_session_expire - introductory material :meth:`.Session.expire` @@ -657,7 +657,7 @@ class async_scoped_session(Generic[_AS]): .. seealso:: - :ref:`session_expire` - introductory material + ref_session_expire - introductory material :meth:`.Session.expire` diff --git a/lib/sqlalchemy/ext/asyncio/session.py b/lib/sqlalchemy/ext/asyncio/session.py index dabe1824e..f8f071c5a 100644 --- a/lib/sqlalchemy/ext/asyncio/session.py +++ b/lib/sqlalchemy/ext/asyncio/session.py @@ -987,7 +987,7 @@ class AsyncSession(ReversibleProxy[Session]): .. seealso:: - :ref:`session_expire` - introductory material + ref_session_expire - introductory material :meth:`.Session.expire` @@ -1028,7 +1028,7 @@ class AsyncSession(ReversibleProxy[Session]): .. seealso:: - :ref:`session_expire` - introductory material + ref_session_expire - introductory material :meth:`.Session.expire` diff --git a/lib/sqlalchemy/ext/automap.py b/lib/sqlalchemy/ext/automap.py index f378f729a..8ca14a3fb 100644 --- a/lib/sqlalchemy/ext/automap.py +++ b/lib/sqlalchemy/ext/automap.py @@ -19,7 +19,7 @@ Declarative class techniques, :class:`.AutomapBase` seeks to provide a well-integrated approach to the issue of expediently auto-generating ad-hoc mappings. -.. tip:: The :ref:`automap_toplevel` extension is geared towards a +.. tip:: The ref_automap_toplevel extension is geared towards a "zero declaration" approach, where a complete ORM model including classes and pre-named relationships can be generated on the fly from a database schema. For applications that still want to use explicit class declarations @@ -991,7 +991,7 @@ class AutomapBase: .. seealso:: - :ref:`automap_toplevel` + ref_automap_toplevel """ @@ -1034,7 +1034,7 @@ class AutomapBase: .. seealso:: - :ref:`automap_by_module` + ref_automap_by_module """ @@ -1133,7 +1133,7 @@ class AutomapBase: .. seealso:: - :ref:`automap_by_module` + ref_automap_by_module :param name_for_scalar_relationship: callable function which will be used to produce relationship names for scalar relationships. Defaults @@ -1165,7 +1165,7 @@ class AutomapBase: For an overview of multiple-schema automap including the use of additional naming conventions to resolve table name - conflicts, see the section :ref:`automap_by_module`. + conflicts, see the section ref_automap_by_module. .. versionadded:: 2.0 :meth:`.AutomapBase.prepare` supports being directly invoked any number of times, keeping track of tables diff --git a/lib/sqlalchemy/ext/declarative/extensions.py b/lib/sqlalchemy/ext/declarative/extensions.py index 2cb55a5ae..b33c8e18d 100644 --- a/lib/sqlalchemy/ext/declarative/extensions.py +++ b/lib/sqlalchemy/ext/declarative/extensions.py @@ -190,7 +190,7 @@ class AbstractConcreteBase(ConcreteBase): Using this approach, we can specify columns and properties that will take place on mapped subclasses, in the way that - we normally do as in :ref:`declarative_mixins`:: + we normally do as in ref_declarative_mixins:: from sqlalchemy.ext.declarative import AbstractConcreteBase diff --git a/lib/sqlalchemy/ext/horizontal_shard.py b/lib/sqlalchemy/ext/horizontal_shard.py index e1741fe52..ac800917c 100644 --- a/lib/sqlalchemy/ext/horizontal_shard.py +++ b/lib/sqlalchemy/ext/horizontal_shard.py @@ -10,7 +10,7 @@ Defines a rudimental 'horizontal sharding' system which allows a Session to distribute queries and persistence operations across multiple databases. -For a usage example, see the :ref:`examples_sharding` example included in +For a usage example, see the ref_examples_sharding example included in the source distribution. .. deepalchemy:: The horizontal sharding extension is an advanced feature, diff --git a/lib/sqlalchemy/ext/hybrid.py b/lib/sqlalchemy/ext/hybrid.py index 4e0fd4604..5b058a4d8 100644 --- a/lib/sqlalchemy/ext/hybrid.py +++ b/lib/sqlalchemy/ext/hybrid.py @@ -171,7 +171,7 @@ The use of :attr:`.hybrid_property.inplace` indicates that the :meth:`.hybrid_property.expression` modifier should mutate the existing hybrid object at ``Interval.radius`` in place, without creating a new object. Notes on this modifier and its -rationale are discussed in the next section :ref:`hybrid_pep484_naming`. +rationale are discussed in the next section ref_hybrid_pep484_naming. The use of ``@classmethod`` is optional, and is strictly to give typing tools a hint that ``cls`` in this case is expected to be the ``Interval`` class, and not an instance of ``Interval``. @@ -501,7 +501,7 @@ We can, of course, forego being dependent on the enclosing query's usage of joins in favor of the correlated subquery, which can portably be packed into a single column expression. A correlated subquery is more portable, but often performs more poorly at the SQL level. Using the same technique -illustrated at :ref:`mapper_column_property_sql_expressions`, +illustrated at ref_mapper_column_property_sql_expressions, we can adjust our ``SavingsAccount`` example to aggregate the balances for *all* accounts, and use a correlated subquery for the column expression:: @@ -1018,7 +1018,7 @@ class hybrid_method(interfaces.InspectionAttrInfo, Generic[_P, _R]): .. seealso:: - :ref:`hybrid_pep484_naming` + ref_hybrid_pep484_naming """ return self @@ -1255,7 +1255,7 @@ class hybrid_property(interfaces.InspectionAttrInfo, ORMDescriptor[_T]): .. seealso:: - :ref:`hybrid_pep484_naming` + ref_hybrid_pep484_naming """ return hybrid_property._InPlace(self) diff --git a/lib/sqlalchemy/ext/instrumentation.py b/lib/sqlalchemy/ext/instrumentation.py index 688c762e7..22e60b343 100644 --- a/lib/sqlalchemy/ext/instrumentation.py +++ b/lib/sqlalchemy/ext/instrumentation.py @@ -20,7 +20,7 @@ on the class. their own instrumentation. It is not intended for general use. For examples of how the instrumentation extension is used, -see the example :ref:`examples_instrumentation`. +see the example ref_examples_instrumentation. """ import weakref diff --git a/lib/sqlalchemy/ext/mutable.py b/lib/sqlalchemy/ext/mutable.py index 7d23f9fda..b8159714e 100644 --- a/lib/sqlalchemy/ext/mutable.py +++ b/lib/sqlalchemy/ext/mutable.py @@ -233,14 +233,14 @@ Establishing Mutability on Composites Composites are a special ORM feature which allow a single scalar attribute to be assigned an object value which represents information "composed" from one or more columns from the underlying mapped table. The usual example is that of -a geometric "point", and is introduced in :ref:`mapper_composite`. +a geometric "point", and is introduced in ref_mapper_composite. As is the case with :class:`.Mutable`, the user-defined composite class subclasses :class:`.MutableComposite` as a mixin, and detects and delivers change events to its parents via the :meth:`.MutableComposite.changed` method. In the case of a composite class, the detection is usually via the usage of the special Python method ``__setattr__()``. In the example below, we expand upon the ``Point`` -class introduced in :ref:`mapper_composite` to include +class introduced in ref_mapper_composite to include :class:`.MutableComposite` in its bases and to route attribute set events via ``__setattr__`` to the :meth:`.MutableComposite.changed` method:: diff --git a/lib/sqlalchemy/orm/_orm_constructors.py b/lib/sqlalchemy/orm/_orm_constructors.py index 563fef3c5..207c4410d 100644 --- a/lib/sqlalchemy/orm/_orm_constructors.py +++ b/lib/sqlalchemy/orm/_orm_constructors.py @@ -228,7 +228,7 @@ def mapped_column( :param default: Passed directly to the :paramref:`_schema.Column.default` parameter if the :paramref:`_orm.mapped_column.insert_default` parameter is not present. - Additionally, when used with :ref:`orm_declarative_native_dataclasses`, + Additionally, when used with ref_orm_declarative_native_dataclasses, indicates a default Python value that should be applied to the keyword constructor within the generated ``__init__()`` method. @@ -274,26 +274,26 @@ def mapped_column( .. versionadded:: 2.0.10 - :param init: Specific to :ref:`orm_declarative_native_dataclasses`, + :param init: Specific to ref_orm_declarative_native_dataclasses, specifies if the mapped attribute should be part of the ``__init__()`` method as generated by the dataclass process. - :param repr: Specific to :ref:`orm_declarative_native_dataclasses`, + :param repr: Specific to ref_orm_declarative_native_dataclasses, specifies if the mapped attribute should be part of the ``__repr__()`` method as generated by the dataclass process. :param default_factory: Specific to - :ref:`orm_declarative_native_dataclasses`, + ref_orm_declarative_native_dataclasses, specifies a default-value generation function that will take place as part of the ``__init__()`` method as generated by the dataclass process. :param compare: Specific to - :ref:`orm_declarative_native_dataclasses`, indicates if this field + ref_orm_declarative_native_dataclasses, indicates if this field should be included in comparison operations when generating the ``__eq__()`` and ``__ne__()`` methods for the mapped class. .. versionadded:: 2.0.0b4 :param kw_only: Specific to - :ref:`orm_declarative_native_dataclasses`, indicates if this field + ref_orm_declarative_native_dataclasses, indicates if this field should be marked as keyword-only when generating the ``__init__()``. :param \**kw: All remaining keyword arguments are passed through to the @@ -435,7 +435,7 @@ def column_property( .. seealso:: - :ref:`mapper_column_property_sql_expressions` - general use of + ref_mapper_column_property_sql_expressions - general use of :func:`_orm.column_property` to map SQL expressions :ref:`orm_imperative_table_column_options` - usage of @@ -619,7 +619,7 @@ def composite( ) -> Composite[Any]: r"""Return a composite column-based property for use with a Mapper. - See the mapping documentation section :ref:`mapper_composite` for a + See the mapping documentation section ref_mapper_composite for a full usage example. The :class:`.MapperProperty` returned by :func:`.composite` @@ -664,27 +664,27 @@ def composite( :param info: Optional data dictionary which will be populated into the :attr:`.MapperProperty.info` attribute of this object. - :param init: Specific to :ref:`orm_declarative_native_dataclasses`, + :param init: Specific to ref_orm_declarative_native_dataclasses, specifies if the mapped attribute should be part of the ``__init__()`` method as generated by the dataclass process. - :param repr: Specific to :ref:`orm_declarative_native_dataclasses`, + :param repr: Specific to ref_orm_declarative_native_dataclasses, specifies if the mapped attribute should be part of the ``__repr__()`` method as generated by the dataclass process. :param default_factory: Specific to - :ref:`orm_declarative_native_dataclasses`, + ref_orm_declarative_native_dataclasses, specifies a default-value generation function that will take place as part of the ``__init__()`` method as generated by the dataclass process. :param compare: Specific to - :ref:`orm_declarative_native_dataclasses`, indicates if this field + ref_orm_declarative_native_dataclasses, indicates if this field should be included in comparison operations when generating the ``__eq__()`` and ``__ne__()`` methods for the mapped class. .. versionadded:: 2.0.0b4 :param kw_only: Specific to - :ref:`orm_declarative_native_dataclasses`, indicates if this field + ref_orm_declarative_native_dataclasses, indicates if this field should be marked as keyword-only when generating the ``__init__()``. """ @@ -871,7 +871,7 @@ def with_loader_criteria( .. seealso:: - :ref:`examples_session_orm_events` - includes examples of using + ref_examples_session_orm_events - includes examples of using :func:`_orm.with_loader_criteria`. :ref:`do_orm_execute_global_criteria` - basic example on how to @@ -1009,7 +1009,7 @@ def relationship( .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. - See :ref:`declarative_relationship_eval` for details on + See ref_declarative_relationship_eval for details on declarative evaluation of :func:`_orm.relationship` arguments. The :paramref:`_orm.relationship.secondary` keyword argument is @@ -1031,7 +1031,7 @@ def relationship( :ref:`self_referential_many_to_many` - Specifics on using many-to-many in a self-referential case. - :ref:`declarative_many_to_many` - Additional options when using + ref_declarative_many_to_many - Additional options when using Declarative. :ref:`association_pattern` - an alternative to @@ -1070,7 +1070,7 @@ def relationship( .. seealso:: - :ref:`relationships_backref` - notes on using + ref_relationships_backref - notes on using :paramref:`_orm.relationship.backref` :ref:`tutorial_orm_related_objects` - in the :ref:`unified_tutorial`, @@ -1246,7 +1246,7 @@ def relationship( .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. - See :ref:`declarative_relationship_eval` for details on + See ref_declarative_relationship_eval for details on declarative evaluation of :func:`_orm.relationship` arguments. .. seealso:: @@ -1331,7 +1331,7 @@ def relationship( * ``noload`` - no loading should occur at any time. The related collection will remain empty. The ``noload`` strategy is not recommended for general use. For a general use "never load" - approach, see :ref:`write_only_relationship` + approach, see ref_write_only_relationship * ``raise`` - lazy loading is disallowed; accessing the attribute, if its value were not already loaded via eager @@ -1366,13 +1366,13 @@ def relationship( The ``write_only`` loader style is configured automatically when the :class:`_orm.WriteOnlyMapped` annotation is provided on the left hand side within a Declarative mapping. See the section - :ref:`write_only_relationship` for examples. + ref_write_only_relationship for examples. .. versionadded:: 2.0 .. seealso:: - :ref:`write_only_relationship` - in the :ref:`queryguide_toplevel` + ref_write_only_relationship - in the :ref:`queryguide_toplevel` * ``dynamic`` - the attribute will return a pre-configured :class:`_query.Query` object for all read @@ -1382,17 +1382,17 @@ def relationship( The ``dynamic`` loader style is configured automatically when the :class:`_orm.DynamicMapped` annotation is provided on the left hand side within a Declarative mapping. See the section - :ref:`dynamic_relationship` for examples. + ref_dynamic_relationship for examples. .. legacy:: The "dynamic" lazy loader strategy is the legacy form of what is now the "write_only" strategy described in the section - :ref:`write_only_relationship`. + ref_write_only_relationship. .. seealso:: - :ref:`dynamic_relationship` - in the :ref:`queryguide_toplevel` + ref_dynamic_relationship - in the :ref:`queryguide_toplevel` - :ref:`write_only_relationship` - more generally useful approach + ref_write_only_relationship - more generally useful approach for large collections that should not fully load into memory * True - a synonym for 'select' @@ -1448,7 +1448,7 @@ def relationship( .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. - See :ref:`declarative_relationship_eval` for details on + See ref_declarative_relationship_eval for details on declarative evaluation of :func:`_orm.relationship` arguments. :param passive_deletes=False: @@ -1545,7 +1545,7 @@ def relationship( .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. - See :ref:`declarative_relationship_eval` for details on + See ref_declarative_relationship_eval for details on declarative evaluation of :func:`_orm.relationship` arguments. .. seealso:: @@ -1564,7 +1564,7 @@ def relationship( .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. - See :ref:`declarative_relationship_eval` for details on + See ref_declarative_relationship_eval for details on declarative evaluation of :func:`_orm.relationship` arguments. .. seealso:: @@ -1589,7 +1589,7 @@ def relationship( .. seealso:: - :ref:`dynamic_relationship` - Introduction to "dynamic" + ref_dynamic_relationship - Introduction to "dynamic" relationship loaders. :param secondaryjoin: @@ -1606,7 +1606,7 @@ def relationship( .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. - See :ref:`declarative_relationship_eval` for details on + See ref_declarative_relationship_eval for details on declarative evaluation of :func:`_orm.relationship` arguments. .. seealso:: @@ -1730,26 +1730,26 @@ def relationship( .. versionadded:: 1.3 - :param init: Specific to :ref:`orm_declarative_native_dataclasses`, + :param init: Specific to ref_orm_declarative_native_dataclasses, specifies if the mapped attribute should be part of the ``__init__()`` method as generated by the dataclass process. - :param repr: Specific to :ref:`orm_declarative_native_dataclasses`, + :param repr: Specific to ref_orm_declarative_native_dataclasses, specifies if the mapped attribute should be part of the ``__repr__()`` method as generated by the dataclass process. :param default_factory: Specific to - :ref:`orm_declarative_native_dataclasses`, + ref_orm_declarative_native_dataclasses, specifies a default-value generation function that will take place as part of the ``__init__()`` method as generated by the dataclass process. :param compare: Specific to - :ref:`orm_declarative_native_dataclasses`, indicates if this field + ref_orm_declarative_native_dataclasses, indicates if this field should be included in comparison operations when generating the ``__eq__()`` and ``__ne__()`` methods for the mapped class. .. versionadded:: 2.0.0b4 :param kw_only: Specific to - :ref:`orm_declarative_native_dataclasses`, indicates if this field + ref_orm_declarative_native_dataclasses, indicates if this field should be marked as keyword-only when generating the ``__init__()``. @@ -2001,7 +2001,7 @@ def dynamic_loader( relationship(SomeClass, lazy="dynamic") - See the section :ref:`dynamic_relationship` for more details + See the section ref_dynamic_relationship for more details on dynamic loading. """ @@ -2027,7 +2027,7 @@ def backref(name: str, **kwargs: Any) -> ORMBackrefArgument: .. seealso:: - :ref:`relationships_backref` - background on backrefs + ref_relationships_backref - background on backrefs """ diff --git a/lib/sqlalchemy/orm/base.py b/lib/sqlalchemy/orm/base.py index 5d19cf20a..3e178d524 100644 --- a/lib/sqlalchemy/orm/base.py +++ b/lib/sqlalchemy/orm/base.py @@ -798,7 +798,7 @@ class Mapped( The :class:`_orm.Mapped` class represents attributes that are handled directly by the :class:`_orm.Mapper` class. It does not include other Python descriptor classes that are provided as extensions, including - :ref:`hybrids_toplevel` and the :ref:`associationproxy_toplevel`. + ref_hybrids_toplevel and the ref_associationproxy_toplevel. While these systems still make use of ORM-specific superclasses and structures, they are not :term:`instrumented` by the :class:`_orm.Mapper` and instead provide their own functionality @@ -885,7 +885,7 @@ class DynamicMapped(_MappedAnnotationBase[_T]): .. legacy:: The "dynamic" lazy loader strategy is the legacy form of what is now the "write_only" strategy described in the section - :ref:`write_only_relationship`. + ref_write_only_relationship. E.g.:: @@ -896,13 +896,13 @@ class DynamicMapped(_MappedAnnotationBase[_T]): cascade="all,delete-orphan" ) - See the section :ref:`dynamic_relationship` for background. + See the section ref_dynamic_relationship for background. .. versionadded:: 2.0 .. seealso:: - :ref:`dynamic_relationship` - complete background + ref_dynamic_relationship - complete background :class:`.WriteOnlyMapped` - fully 2.0 style version @@ -938,13 +938,13 @@ class WriteOnlyMapped(_MappedAnnotationBase[_T]): cascade="all,delete-orphan" ) - See the section :ref:`write_only_relationship` for background. + See the section ref_write_only_relationship for background. .. versionadded:: 2.0 .. seealso:: - :ref:`write_only_relationship` - complete background + ref_write_only_relationship - complete background :class:`.DynamicMapped` - includes legacy :class:`_orm.Query` support diff --git a/lib/sqlalchemy/orm/decl_api.py b/lib/sqlalchemy/orm/decl_api.py index 2f8289acf..ecb1993bc 100644 --- a/lib/sqlalchemy/orm/decl_api.py +++ b/lib/sqlalchemy/orm/decl_api.py @@ -509,7 +509,7 @@ def declarative_mixin(cls: Type[_T]) -> Type[_T]: The :func:`_orm.declarative_mixin` decorator currently does not modify the given class in any way; it's current purpose is strictly to assist - the :ref:`Mypy plugin <mypy_toplevel>` in being able to identify + the ref_mypy_toplevel in being able to identify SQLAlchemy declarative mixin classes when no other context is present. .. versionadded:: 1.4.6 @@ -518,8 +518,8 @@ def declarative_mixin(cls: Type[_T]) -> Type[_T]: :ref:`orm_mixins_toplevel` - :ref:`mypy_declarative_mixins` - in the - :ref:`Mypy plugin documentation <mypy_toplevel>` + ref_mypy_declarative_mixins - in the + ref_mypy_toplevel """ # noqa: E501 @@ -573,7 +573,7 @@ class MappedAsDataclass(metaclass=DCTransformDeclarative): .. seealso:: - :ref:`orm_declarative_native_dataclasses` - complete background + ref_orm_declarative_native_dataclasses - complete background on SQLAlchemy native dataclass mapping .. versionadded:: 2.0 @@ -1594,7 +1594,7 @@ class registry: .. seealso:: - :ref:`orm_declarative_native_dataclasses` - complete background + ref_orm_declarative_native_dataclasses - complete background on SQLAlchemy native dataclass mapping diff --git a/lib/sqlalchemy/orm/descriptor_props.py b/lib/sqlalchemy/orm/descriptor_props.py index 2e57fd0f4..af94773d7 100644 --- a/lib/sqlalchemy/orm/descriptor_props.py +++ b/lib/sqlalchemy/orm/descriptor_props.py @@ -187,7 +187,7 @@ class CompositeProperty( .. seealso:: - :ref:`mapper_composite` + ref_mapper_composite """ @@ -729,7 +729,7 @@ class CompositeProperty( """Produce boolean, comparison, and other operators for :class:`.Composite` attributes. - See the example in :ref:`composite_operations` for an overview + See the example in ref_composite_operations for an overview of usage , as well as the documentation for :class:`.PropComparator`. .. seealso:: @@ -858,7 +858,7 @@ class Composite(CompositeProperty[_T], _DeclarativeMapped[_T]): .. seealso:: - :ref:`mapper_composite` + ref_mapper_composite """ diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py index 9a1fd569a..538ac8979 100644 --- a/lib/sqlalchemy/orm/events.py +++ b/lib/sqlalchemy/orm/events.py @@ -579,7 +579,7 @@ class InstanceEvents(event.Events[ClassManager[Any]]): :ref:`orm_server_defaults` - :ref:`metadata_defaults_toplevel` + ref_metadata_defaults_toplevel """ @@ -962,7 +962,7 @@ class MapperEvents(event.Events[mapperlib.Mapper[Any]]): .. seealso:: - :ref:`examples_versioning` - an example which illustrates the use + ref_examples_versioning - an example which illustrates the use of the :meth:`_orm.MapperEvents.before_mapper_configured` event to create new mappers to record change-audit histories on objects. @@ -1735,14 +1735,14 @@ class SessionEvents(event.Events[Session]): and parameters as well as an option that allows programmatic invocation of the statement at any point. - :ref:`examples_session_orm_events` - includes examples of using + ref_examples_session_orm_events - includes examples of using :meth:`_orm.SessionEvents.do_orm_execute` - :ref:`examples_caching` - an example of how to integrate + ref_examples_caching - an example of how to integrate Dogpile caching with the ORM :class:`_orm.Session` making use of the :meth:`_orm.SessionEvents.do_orm_execute` event hook. - :ref:`examples_sharding` - the Horizontal Sharding example / + ref_examples_sharding - the Horizontal Sharding example / extension relies upon the :meth:`_orm.SessionEvents.do_orm_execute` event hook to invoke a SQL statement on multiple backends and return a merged result. @@ -2878,7 +2878,7 @@ class AttributeEvents(event.Events[QueryableAttribute[Any]]): we indicate that this value is to be persisted to the database. This supersedes the use of ``SOME_CONSTANT`` in the default generator for the :class:`_schema.Column`. The ``active_column_defaults.py`` - example given at :ref:`examples_instrumentation` illustrates using + example given at ref_examples_instrumentation illustrates using the same approach for a changing default, e.g. a timestamp generator. In this particular example, it is not strictly necessary to do this since ``SOME_CONSTANT`` would be part of the @@ -2939,7 +2939,7 @@ class AttributeEvents(event.Events[QueryableAttribute[Any]]): :class:`.AttributeEvents` - background on listener options such as propagation to subclasses. - :ref:`examples_instrumentation` - see the + ref_examples_instrumentation - see the ``active_column_defaults.py`` example. """ @@ -3070,7 +3070,7 @@ class QueryEvents(event.Events[Query[Any]]): the :meth:`_orm.QueryEvents.before_compile` event is **no longer used** for ORM-level attribute loads, such as loads of deferred or expired attributes as well as relationship loaders. See the - new examples in :ref:`examples_session_orm_events` which + new examples in ref_examples_session_orm_events which illustrate new ways of intercepting and modifying ORM queries for the most common purpose of adding arbitrary filter criteria. @@ -3121,7 +3121,7 @@ class QueryEvents(event.Events[Query[Any]]): :meth:`.QueryEvents.before_compile_delete` - :ref:`baked_with_before_compile` + ref_baked_with_before_compile """ diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 731983ff4..863c0286c 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -432,7 +432,7 @@ class Mapper( be consistent in more scenarios independently of whether or not an orphan object has been flushed yet or not. - See the change note and example at :ref:`legacy_is_orphan_addition` + See the change note and example at ref_legacy_is_orphan_addition for more detail on this change. :param non_primary: Specify that this :class:`_orm.Mapper` @@ -668,7 +668,7 @@ class Mapper( .. seealso:: - :ref:`mapper_version_counter` - discussion of version counting + ref_mapper_version_counter - discussion of version counting and rationale. :param version_id_generator: Define how new version ids should @@ -682,14 +682,14 @@ class Mapper( Alternatively, server-side versioning functions such as triggers, or programmatic versioning schemes outside of the version id generator may be used, by specifying the value ``False``. - Please see :ref:`server_side_version_counter` for a discussion + Please see ref_server_side_version_counter for a discussion of important points when using this option. .. seealso:: - :ref:`custom_version_counter` + ref_custom_version_counter - :ref:`server_side_version_counter` + ref_server_side_version_counter :param with_polymorphic: A tuple in the form ``(<classes>, diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index 916b9d901..97032e070 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -283,7 +283,7 @@ class ColumnProperty( .. seealso:: - :ref:`mapper_column_property_sql_expressions_composed` + ref_mapper_column_property_sql_expressions_composed """ return self.columns[0] diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 5cd7cc117..dcda45bd4 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1761,7 +1761,7 @@ class Query( statement executions, as the :class:`_orm.Session` will not track objects from different schema translate maps within a single session. For multiple schema translate maps within the scope of a - single :class:`_orm.Session`, see :ref:`examples_sharding`. + single :class:`_orm.Session`, see ref_examples_sharding. .. seealso:: @@ -3003,7 +3003,7 @@ class Query( The 'load' argument is the same as that of :meth:`.Session.merge`. For an example of how :meth:`_query.Query.merge_result` is used, see - the source code for the example :ref:`examples_caching`, where + the source code for the example ref_examples_caching, where :meth:`_query.Query.merge_result` is used to efficiently restore state from a cache back into a target :class:`.Session`. diff --git a/lib/sqlalchemy/orm/scoping.py b/lib/sqlalchemy/orm/scoping.py index 19217ec32..4d1bba555 100644 --- a/lib/sqlalchemy/orm/scoping.py +++ b/lib/sqlalchemy/orm/scoping.py @@ -143,11 +143,11 @@ __all__ = ["scoped_session"] class scoped_session(Generic[_S]): """Provides scoped management of :class:`.Session` objects. - See :ref:`unitofwork_contextual` for a tutorial. + See ref_unitofwork_contextual for a tutorial. .. note:: - When using :ref:`asyncio_toplevel`, the async-compatible + When using ref_asyncio_toplevel, the async-compatible :class:`_asyncio.async_scoped_session` class should be used in place of :class:`.scoped_session`. @@ -463,7 +463,7 @@ class scoped_session(Generic[_S]): :ref:`session_begin_nested` - :ref:`pysqlite_serializable` - special workarounds required + ref_pysqlite_serializable - special workarounds required with the SQLite driver in order for SAVEPOINT to work correctly. @@ -545,7 +545,7 @@ class scoped_session(Generic[_S]): :ref:`unitofwork_transaction` - :ref:`asyncio_orm_avoid_lazyloads` + ref_asyncio_orm_avoid_lazyloads """ # noqa: E501 @@ -765,7 +765,7 @@ class scoped_session(Generic[_S]): .. seealso:: - :ref:`session_expire` - introductory material + ref_session_expire - introductory material :meth:`.Session.expire` @@ -806,7 +806,7 @@ class scoped_session(Generic[_S]): .. seealso:: - :ref:`session_expire` - introductory material + ref_session_expire - introductory material :meth:`.Session.expire` @@ -1423,7 +1423,7 @@ class scoped_session(Generic[_S]): This operation cascades to associated instances if the association is mapped with ``cascade="merge"``. - See :ref:`unitofwork_merging` for a detailed discussion of merging. + See ref_unitofwork_merging for a detailed discussion of merging. :param instance: Instance to be merged. :param load: Boolean, when False, :meth:`.merge` switches into @@ -1658,7 +1658,7 @@ class scoped_session(Generic[_S]): .. seealso:: - :ref:`session_expire` - introductory material + ref_session_expire - introductory material :meth:`.Session.expire` diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 792b59e81..3b65e728a 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -1589,7 +1589,7 @@ class Session(_SessionClassMethods, EventTarget): .. tip:: When using SQLite, the SQLite driver included through Python 3.11 does not handle SAVEPOINTs correctly in all cases without workarounds. See the section - :ref:`pysqlite_serializable` for details on current workarounds. + ref_pysqlite_serializable for details on current workarounds. * ``"control_fully"`` - the :class:`_orm.Session` will take control of the given transaction as its own; @@ -1838,7 +1838,7 @@ class Session(_SessionClassMethods, EventTarget): :ref:`session_begin_nested` - :ref:`pysqlite_serializable` - special workarounds required + ref_pysqlite_serializable - special workarounds required with the SQLite driver in order for SAVEPOINT to work correctly. @@ -1895,7 +1895,7 @@ class Session(_SessionClassMethods, EventTarget): :ref:`unitofwork_transaction` - :ref:`asyncio_orm_avoid_lazyloads` + ref_asyncio_orm_avoid_lazyloads """ trans = self._transaction @@ -2972,7 +2972,7 @@ class Session(_SessionClassMethods, EventTarget): .. seealso:: - :ref:`session_expire` - introductory material + ref_session_expire - introductory material :meth:`.Session.expire` @@ -3051,7 +3051,7 @@ class Session(_SessionClassMethods, EventTarget): .. seealso:: - :ref:`session_expire` - introductory material + ref_session_expire - introductory material :meth:`.Session.expire` @@ -3093,7 +3093,7 @@ class Session(_SessionClassMethods, EventTarget): .. seealso:: - :ref:`session_expire` - introductory material + ref_session_expire - introductory material :meth:`.Session.expire` @@ -3704,7 +3704,7 @@ class Session(_SessionClassMethods, EventTarget): This operation cascades to associated instances if the association is mapped with ``cascade="merge"``. - See :ref:`unitofwork_merging` for a detailed discussion of merging. + See ref_unitofwork_merging for a detailed discussion of merging. :param instance: Instance to be merged. :param load: Boolean, when False, :meth:`.merge` switches into diff --git a/lib/sqlalchemy/orm/state.py b/lib/sqlalchemy/orm/state.py index 708939531..75ecb2bbe 100644 --- a/lib/sqlalchemy/orm/state.py +++ b/lib/sqlalchemy/orm/state.py @@ -221,7 +221,7 @@ class InstanceState(interfaces.InspectionAttrInfo, Generic[_O]): .. seealso:: - :ref:`session_object_states` + ref_session_object_states """ return self.key is None and not self._attached @@ -233,7 +233,7 @@ class InstanceState(interfaces.InspectionAttrInfo, Generic[_O]): .. seealso:: - :ref:`session_object_states` + ref_session_object_states """ return self.key is None and self._attached @@ -263,7 +263,7 @@ class InstanceState(interfaces.InspectionAttrInfo, Generic[_O]): .. seealso:: - :ref:`session_object_states` + ref_session_object_states """ return self.key is not None and self._attached and self._deleted @@ -284,7 +284,7 @@ class InstanceState(interfaces.InspectionAttrInfo, Generic[_O]): :func:`.orm.util.was_deleted` - standalone function - :ref:`session_object_states` + ref_session_object_states """ return self._deleted @@ -299,7 +299,7 @@ class InstanceState(interfaces.InspectionAttrInfo, Generic[_O]): .. seealso:: - :ref:`session_object_states` + ref_session_object_states """ return self.key is not None and self._attached and not self._deleted @@ -310,7 +310,7 @@ class InstanceState(interfaces.InspectionAttrInfo, Generic[_O]): .. seealso:: - :ref:`session_object_states` + ref_session_object_states """ return self.key is not None and not self._attached @@ -377,7 +377,7 @@ class InstanceState(interfaces.InspectionAttrInfo, Generic[_O]): .. seealso:: - :ref:`asyncio_toplevel` + ref_asyncio_toplevel """ if _async_provider is None: diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index d3e36a494..62d800745 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -679,7 +679,7 @@ class AliasedClass( same attribute and method interface as the original mapped class, allowing :class:`.AliasedClass` to be compatible with any attribute technique which works on the original class, - including hybrid attributes (see :ref:`hybrids_toplevel`). + including hybrid attributes (see ref_hybrids_toplevel). The :class:`.AliasedClass` can be inspected for its underlying :class:`_orm.Mapper`, aliased selectable, and other information @@ -885,7 +885,7 @@ class AliasedInsp( .. seealso:: - :ref:`inspection_toplevel` + ref_inspection_toplevel """ diff --git a/lib/sqlalchemy/orm/writeonly.py b/lib/sqlalchemy/orm/writeonly.py index a362750f6..9f7de7446 100644 --- a/lib/sqlalchemy/orm/writeonly.py +++ b/lib/sqlalchemy/orm/writeonly.py @@ -500,13 +500,13 @@ class WriteOnlyCollection(AbstractCollectionWriter[_T]): The :class:`.WriteOnlyCollection` is used in a mapping by using the ``"write_only"`` lazy loading strategy with :func:`_orm.relationship`. For background on this configuration, - see :ref:`write_only_relationship`. + see ref_write_only_relationship. .. versionadded:: 2.0 .. seealso:: - :ref:`write_only_relationship` + ref_write_only_relationship """ diff --git a/lib/sqlalchemy/pool/impl.py b/lib/sqlalchemy/pool/impl.py index 99779d54f..30efd8602 100644 --- a/lib/sqlalchemy/pool/impl.py +++ b/lib/sqlalchemy/pool/impl.py @@ -327,7 +327,7 @@ class SingletonThreadPool(Pool): :class:`.SingletonThreadPool` is used by the SQLite dialect automatically when a memory-based database is used. - See :ref:`sqlite_toplevel`. + See ref_sqlite_toplevel. """ diff --git a/lib/sqlalchemy/sql/_elements_constructors.py b/lib/sqlalchemy/sql/_elements_constructors.py index 99a839cc9..a2f9564bd 100644 --- a/lib/sqlalchemy/sql/_elements_constructors.py +++ b/lib/sqlalchemy/sql/_elements_constructors.py @@ -667,7 +667,7 @@ def bindparam( :meth:`.ColumnOperators.in_` - :ref:`baked_in` - with baked queries + ref_baked_in - with baked queries .. note:: The "expanding" feature does not support "executemany"- style parameter sets. diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py index 911061640..2ea3b3b34 100644 --- a/lib/sqlalchemy/sql/dml.py +++ b/lib/sqlalchemy/sql/dml.py @@ -1257,7 +1257,7 @@ class Insert(ValuesBase): correspond. :param include_defaults: if True, non-server default values and SQL expressions as specified on :class:`_schema.Column` objects - (as documented in :ref:`metadata_defaults_toplevel`) not + (as documented in ref_metadata_defaults_toplevel) not otherwise specified in the list of names will be rendered into the INSERT and SELECT statements, so that these values are also included in the data to be inserted. diff --git a/lib/sqlalchemy/sql/events.py b/lib/sqlalchemy/sql/events.py index b34d07412..1cd0aabdf 100644 --- a/lib/sqlalchemy/sql/events.py +++ b/lib/sqlalchemy/sql/events.py @@ -446,10 +446,10 @@ class DDLEvents(event.Events[SchemaEventTarget]): :ref:`mapper_automated_reflection_schemes` - in the ORM mapping documentation - :ref:`automap_intercepting_columns` - - in the :ref:`automap_toplevel` documentation + ref_automap_intercepting_columns - + in the ref_automap_toplevel documentation - :ref:`metadata_reflection_dbagnostic_types` - in - the :ref:`metadata_reflection_toplevel` documentation + ref_metadata_reflection_dbagnostic_types - in + the ref_metadata_reflection_toplevel documentation """ diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index 30ef0b7e3..0b8fd626c 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -276,7 +276,7 @@ class FunctionElement(Executable, ColumnElement[_T], FromClause, Generative): :ref:`tutorial_functions_table_valued` - in the :ref:`unified_tutorial` - :ref:`postgresql_table_valued` - in the :ref:`postgresql_toplevel` documentation + ref_postgresql_table_valued - in the :ref:`postgresql_toplevel` documentation :meth:`_functions.FunctionElement.scalar_table_valued` - variant of :meth:`_functions.FunctionElement.table_valued` which delivers the @@ -336,7 +336,7 @@ class FunctionElement(Executable, ColumnElement[_T], FromClause, Generative): :ref:`tutorial_functions_column_valued` - in the :ref:`unified_tutorial` - :ref:`postgresql_column_valued` - in the :ref:`postgresql_toplevel` documentation + ref_postgresql_column_valued - in the :ref:`postgresql_toplevel` documentation :meth:`_functions.FunctionElement.table_valued` @@ -840,7 +840,7 @@ class _FunctionGenerator: Functions which are interpreted as "generic" functions know how to calculate their return type automatically. For a listing of known generic - functions, see :ref:`generic_functions`. + functions, see ref_generic_functions. .. note:: diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index 352e5b62d..fbc0153f6 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -1521,7 +1521,7 @@ class ColumnOperators(Operators): .. versionchanged:: 2.0 ``plainto_tsquery()`` is used instead of ``to_tsquery()`` for PostgreSQL now; for compatibility with - other forms, see :ref:`postgresql_match`. + other forms, see ref_postgresql_match. * MySQL - renders ``MATCH (x) AGAINST (y IN BOOLEAN MODE)`` diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 192096469..fa2110947 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -590,11 +590,11 @@ class Table( .. seealso:: - :ref:`metadata_reflection_toplevel` + ref_metadata_reflection_toplevel :meth:`_events.DDLEvents.column_reflect` - :ref:`metadata_reflection_dbagnostic_types` + ref_metadata_reflection_dbagnostic_types :param extend_existing: When ``True``, indicates that if this :class:`_schema.Table` is already present in the given @@ -662,7 +662,7 @@ class Table( In modern SQLAlchemy there is generally no reason to alter this setting, except for some backend specific cases - (see :ref:`mssql_triggers` in the SQL Server dialect documentation + (see ref_mssql_triggers in the SQL Server dialect documentation for one such example). :param include_columns: A list of strings indicating a subset of @@ -1699,7 +1699,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]): to render the special SQLite keyword ``AUTOINCREMENT`` is not included as this is unnecessary and not recommended by the database vendor. See the section - :ref:`sqlite_autoincrement` for more background. + ref_sqlite_autoincrement for more background. * Oracle - The Oracle dialect has no default "autoincrement" feature available at this time, instead the :class:`.Identity` construct is recommended to achieve this (the :class:`.Sequence` @@ -1755,7 +1755,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]): .. seealso:: - :ref:`metadata_defaults_toplevel` + ref_metadata_defaults_toplevel :param doc: optional String that can be used by the ORM or similar to document attributes on the Python side. This attribute does @@ -1852,7 +1852,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]): .. seealso:: - :ref:`metadata_defaults` - complete discussion of onupdate + ref_metadata_defaults - complete discussion of onupdate :param primary_key: If ``True``, marks this column as a primary key column. Multiple columns can have this flag set to specify @@ -1915,7 +1915,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]): .. seealso:: - :ref:`server_defaults` - complete discussion of server side + ref_server_defaults - complete discussion of server side defaults :param server_onupdate: A :class:`.FetchedValue` instance @@ -1929,12 +1929,12 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]): .. warning:: This directive **does not** currently produce MySQL's "ON UPDATE CURRENT_TIMESTAMP()" clause. See - :ref:`mysql_timestamp_onupdate` for background on how to + ref_mysql_timestamp_onupdate for background on how to produce this clause. .. seealso:: - :ref:`triggered_columns` + ref_triggered_columns :param quote: Force quoting of this column's name on or off, corresponding to ``True`` or ``False``. When left at its default @@ -3681,7 +3681,7 @@ class Sequence(HasSchemaAttr, IdentityOptions, DefaultGenerator): .. seealso:: - :ref:`defaults_sequences` + ref_defaults_sequences :class:`.CreateSequence` @@ -3955,7 +3955,7 @@ class FetchedValue(SchemaEventTarget): .. seealso:: - :ref:`triggered_columns` + ref_triggered_columns """ @@ -5140,13 +5140,13 @@ class Index( :ref:`schema_indexes` - General information on :class:`.Index`. - :ref:`postgresql_indexes` - PostgreSQL-specific options available for + ref_postgresql_indexes - PostgreSQL-specific options available for the :class:`.Index` construct. - :ref:`mysql_indexes` - MySQL-specific options available for the + ref_mysql_indexes - MySQL-specific options available for the :class:`.Index` construct. - :ref:`mssql_indexes` - MSSQL-specific options available for the + ref_mssql_indexes - MSSQL-specific options available for the :class:`.Index` construct. """ @@ -5676,13 +5676,13 @@ class MetaData(HasSchemaAttr): .. seealso:: - :ref:`metadata_reflection_toplevel` + ref_metadata_reflection_toplevel :meth:`_events.DDLEvents.column_reflect` - Event used to customize the reflected columns. Usually used to generalize the types using :meth:`_types.TypeEngine.as_generic` - :ref:`metadata_reflection_dbagnostic_types` - describes how to + ref_metadata_reflection_dbagnostic_types - describes how to reflect tables using general types. """ diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index 4e7514e38..60ca40a50 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -1775,7 +1775,7 @@ class PickleType(TypeDecorator[object]): a serialized binary field. To allow ORM change events to propagate for elements associated - with :class:`.PickleType`, see :ref:`mutable_toplevel`. + with :class:`.PickleType`, see ref_mutable_toplevel. """ diff --git a/lib/sqlalchemy/sql/type_api.py b/lib/sqlalchemy/sql/type_api.py index 5af12cb93..e031c5efa 100644 --- a/lib/sqlalchemy/sql/type_api.py +++ b/lib/sqlalchemy/sql/type_api.py @@ -863,7 +863,7 @@ class TypeEngine(Visitable, Generic[_T]): .. seealso:: - :ref:`metadata_reflection_dbagnostic_types` - describes the + ref_metadata_reflection_dbagnostic_types - describes the use of :meth:`_types.TypeEngine.as_generic` in conjunction with the :meth:`_sql.DDLEvents.column_reflect` event, which is its intended use. |
