avoided in favor of :meth:`_asyncio.AsyncSession.refresh`, and that
appropriate loader options should be employed for :func:`_orm.deferred`
columns as well as for :func:`_orm.relationship` constructs.
+The full list of available loaders is documented in the section
+:doc:`/orm/loading_relationships`.
In the example above the :class:`_asyncio.AsyncSession` is instantiated with an
:class:`_asyncio.AsyncEngine` associated with a particular database URL.
If the same engine must be shared between different loop, it should be configured
to disable pooling using :class:`~sqlalchemy.pool.NullPool`, preventing the Engine
-from using any connection more than once:
+from using any connection more than once::
from sqlalchemy.pool import NullPool
engine = create_async_engine(
An introduction to raise loading is at :ref:`prevent_lazy_with_raiseload`.
* **no loading** - available via ``lazy='noload'``, or the :func:`.noload`
- option; this loading style turns the attribute into an empty attribute that
+ option; this loading style turns the attribute into an empty attribute (``None``) that
will never load or have any loading effect. "noload" is a fairly
uncommon loader option.
def noload(loadopt, attr):
"""Indicate that the given relationship attribute should remain unloaded.
+ The relationship attribute will return ``None`` when accessed without
+ producing any loading effect.
+
This function is part of the :class:`_orm.Load` interface and supports
both method-chained and standalone operation.
:func:`_orm.noload` applies to :func:`_orm.relationship` attributes; for
column-based attributes, see :func:`_orm.defer`.
+ .. note:: Setting this loading strategy as the default strategy
+ for a relationship using the :paramref:`.orm.relationship.lazy`
+ parameter may cause issues with flushes, such if a delete operation
+ needs to load related objects and instead ``None`` was returned.
+
.. seealso::
:ref:`loading_toplevel`