diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-06-13 11:46:28 -0400 |
---|---|---|
committer | mike bayer <mike_mp@zzzcomputing.com> | 2022-06-21 16:32:10 +0000 |
commit | f9f1e8b6c5890eb17b6ba055ff563087cac20d0e (patch) | |
tree | d75c859067cbae695ea9dae1d0f17b94c8eede75 /lib/sqlalchemy/ext/automap.py | |
parent | 017fd9ae0645eaf2a0fbdd067d10c721505b018c (diff) | |
download | sqlalchemy-f9f1e8b6c5890eb17b6ba055ff563087cac20d0e.tar.gz |
rework ORM mapping docs
prepare docs for newly incoming mapper styles, including
new dataclass mapping. move the existing dataclass/attrs
docs all into their own section and try to improve organization
and wording into the relatively recent "mapping styles"
document.
Change-Id: I0b5e2a5b6a70db65ab19b5bb0a2bb7df20e0b498
Diffstat (limited to 'lib/sqlalchemy/ext/automap.py')
-rw-r--r-- | lib/sqlalchemy/ext/automap.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/sqlalchemy/ext/automap.py b/lib/sqlalchemy/ext/automap.py index 19dadf29c..6d441c9e3 100644 --- a/lib/sqlalchemy/ext/automap.py +++ b/lib/sqlalchemy/ext/automap.py @@ -10,8 +10,6 @@ r"""Define an extension to the :mod:`sqlalchemy.ext.declarative` system which automatically generates mapped classes and relationships from a database schema, typically though not necessarily one which is reflected. -.. versionadded:: 0.9.1 Added :mod:`sqlalchemy.ext.automap`. - It is hoped that the :class:`.AutomapBase` system provides a quick and modernized solution to the problem that the very famous `SQLSoup <https://sqlsoup.readthedocs.io/en/latest/>`_ @@ -22,6 +20,15 @@ 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 + "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 + including explicit relationship definitions in conjunction with reflection + of tables, the :class:`.DeferredReflection` class, described at + :ref:`orm_declarative_reflected_deferred_reflection`, is a better choice. + + Basic Use ========= @@ -123,6 +130,9 @@ explicit table declaration:: Specifying Classes Explicitly ============================= +.. tip:: If explicit classes are expected to be prominent in an application, + consider using :class:`.DeferredReflection` instead. + The :mod:`.sqlalchemy.ext.automap` extension allows classes to be defined explicitly, in a way similar to that of the :class:`.DeferredReflection` class. Classes that extend from :class:`.AutomapBase` act like regular declarative |