]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Improve examples, make typing beta, remove beta from asyncio
authorFederico Caselli <cfederico87@gmail.com>
Wed, 25 Jan 2023 20:40:04 +0000 (21:40 +0100)
committerFederico Caselli <cfederico87@gmail.com>
Wed, 25 Jan 2023 20:40:04 +0000 (21:40 +0100)
Change-Id: Icbde11dcaae5fa6f5e83cd50b6a301081a3ab962

doc/build/changelog/whatsnew_20.rst
doc/build/orm/extensions/asyncio.rst

index 9eca9789c5ede0e5fe55546be33180809bd8ce0c..2fe7d78c984ea6f5d2a763acc321f3ccc1536e73 100644 (file)
@@ -71,6 +71,11 @@ where new :ref:`declarative <orm_declarative_mapper_config_toplevel>` forms allo
 for fully typed ORM models that integrate all the way from statement to
 result set.
 
+.. tip:: Typing support should be considered **beta level** software
+   for the 2.0 series. Typing details are subject to change however
+   significant backwards-incompatible changes are not planned.
+
+
 SQL Expression / Statement / Result Set Typing
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -611,19 +616,17 @@ the same type, such as ``str``, may be used which each provide variants
 of :class:`_types.String`, as below where use of an ``Annotated`` ``str`` called
 ``str50`` will indicate ``String(50)``::
 
-  from typing_extensions import Annotated
-  from sqlalchemy.orm import DeclarativeBase
+    from typing_extensions import Annotated
+    from sqlalchemy.orm import DeclarativeBase
 
-  str50 = Annotated[str, 50]
+    str50 = Annotated[str, 50]
 
-  # declarative base with a type-level override, using a type that is
-  # expected to be used in multiple places
-  class Base(DeclarativeBase):
-      registry = registry(
-          type_annotation_map={
-              str50: String(50),
-          }
-      )
+    # declarative base with a type-level override, using a type that is
+    # expected to be used in multiple places
+    class Base(DeclarativeBase):
+        type_annotation_map = {
+            str50: String(50),
+        }
 
 Second, Declarative will extract full
 :func:`_orm.mapped_column` definitions from the left hand type if
@@ -650,11 +653,9 @@ example below adds additional ``Annotated`` types in addition to our
 
 
     class Base(DeclarativeBase):
-        registry = registry(
-            type_annotation_map={
-                str50: String(50),
-            }
-        )
+        type_annotation_map = {
+            str50: String(50),
+        }
 
 
     # set up mapped_column() overrides, using whole column styles that are
index 234104f2e4ab6382c705aac4982a7df14664bc4f..45da8ef36e5b23b51df4a4803f0c8626168c016e 100644 (file)
@@ -11,11 +11,6 @@ included, using asyncio-compatible dialects.
 .. warning:: Please read :ref:`asyncio_install` for important platform
    installation notes for many platforms, including **Apple M1 Architecture**.
 
-.. tip:: The asyncio extension as of SQLAlchemy 1.4.3 can now be considered to
-   be **beta level** software. API details are subject to change however at this
-   point it is unlikely for there to be significant backwards-incompatible
-   changes.
-
 .. seealso::
 
     :ref:`change_3414` - initial feature announcement