``Annotated`` construct directly in order to re-use pre-established typing
and column configurations.
-Step six - turn mapped classes into dataclasses_
-+++++++++++++++++++++++++++++++++++++++++++++++++
+Optional step - turn mapped classes into dataclasses_
++++++++++++++++++++++++++++++++++++++++++++++++++++++
We can turn mapped classes into dataclasses_, where a key advantage
is that we can build a strictly-typed ``__init__()`` method with explicit
Integrating with Alternate Dataclass Providers such as Pydantic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. warning:: Pydantic's dataclass layer is **not fully compatible with
- SQLAlchemy's class instrumentation without additional internal changes, and
- many features such as related collections may not work correctly.**.
+.. warning:: The dataclass layer of Pydantic version 1.x is **not fully
+ compatible with SQLAlchemy's class instrumentation without additional
+ internal changes, and many features such as related collections may
+ not work correctly.**.
For Pydantic compatibility, please consider the
`SQLModel <https://sqlmodel.tiangolo.com/>` ORM which is built with
* :ref:`session_toplevel`
-* :doc:`/orm/loading_objects`
-
-
-
-
-
+* :doc:`queryguide/index`
)
)
+ The exclude constraint defined in this example requires the
+ ``btree_gist`` extension, that can be created using the
+ command ``CREATE EXTENSION btree_gist;``.
+
:param \*elements:
A sequence of two tuples of the form ``(column, operator)`` where