rel_2_0_0b3
版本发布时间: 2022-11-05 05:14:50
sqlalchemy/sqlalchemy最新发布版本:rel_2_0_36(2024-10-16 03:41:54)
2.0.0b3
Released: November 4, 2022
orm declarative
-
[orm] [declarative] [bug] Added support in ORM declarative annotations for class names specified for
_orm.relationship()
, as well as the name of the_orm.Mapped
symbol itself, to be different names than their direct class name, to support scenarios such as where_orm.Mapped
is imported asfrom sqlalchemy.orm import Mapped as M
, or where related class names are imported with an alternate name in a similar fashion. Additionally, a target class name given as the lead argument for_orm.relationship()
will always supersede the name given in the left hand annotation, so that otherwise un-importable names that also don't match the class name can still be used in annotations.References: #8759
-
[orm] [declarative] [bug] Improved support for legacy 1.4 mappings that use annotations which don't include
Mapped[]
, by ensuring the__allow_unmapped__
attribute can be used to allow such legacy annotations to pass through Annotated Declarative without raising an error and without being interpreted in an ORM runtime context. Additionally improved the error message generated when this condition is detected, and added more documentation for how this situation should be handled. Unfortunately the 1.4 WARN_SQLALCHEMY_20 migration warning cannot detect this particular configurational issue at runtime with its current architecture.References: #8692
-
[orm] [declarative] [bug] Changed a fundamental configuration behavior of
Mapper
, where_schema.Column
objects that are explicitly present in the_orm.Mapper.properties
dictionary, either directly or enclosed within a mapper property object, will now be mapped within the order of how they appear within the mappedTable
(or other selectable) itself (assuming they are in fact part of that table's list of columns), thereby maintaining the same order of columns in the mapped selectable as is instrumented on the mapped class, as well as what renders in an ORM SELECT statement for that mapper. Previously (where "previously" means since version 0.0.1),Column
objects in the_orm.Mapper.properties
dictionary would always be mapped first, ahead of when the other columns in the mappedTable
would be mapped, causing a discrepancy in the order in which the mapper would assign attributes to the mapped class as well as the order in which they would render in statements.The change most prominently takes place in the way that Declarative assigns declared columns to the
Mapper
, specifically howColumn
(or_orm.mapped_column()
) objects are handled when they have a DDL name that is explicitly different from the mapped attribute name, as well as when constructs such as_orm.deferred()
etc. are used. The new behavior will see the column ordering within the mappedTable
being the same order in which the attributes are mapped onto the class, assigned within theMapper
itself, and rendered in ORM statements such as SELECT statements, independent of how the_schema.Column
was configured against theMapper
.References: #8705
-
[orm] [declarative] [bug] Fixed issue in new dataclass mapping feature where a column declared on the decalrative base / abstract base / mixin would leak into the constructor for an inheriting subclass under some circumstances.
References: #8718
-
[bug] [orm declarative] Fixed issues within the declarative typing resolver (i.e. which resolves
ForwardRef
objects) where types that were declared for columns in one particular source file would raiseNameError
when the ultimate mapped class were in another source file. The types are now resolved in terms of the module for each class in which the types are used.References: #8742
engine
-
[engine] [feature] To better support the use case of iterating
Result
andAsyncResult
objects where user-defined exceptions may interrupt the iteration, both objects as well as variants such asScalarResult
,MappingResult
,AsyncScalarResult
,AsyncMappingResult
now support context manager usage, where the result will be closed at the end of the context manager block.In addition, ensured that all the above mentioned
Result
objects include aResult.close()
method as well asResult.closed
accessors, includingScalarResult
andMappingResult
which previously did not have a.close()
method.References: #8710
-
[engine] [usecase] Added new parameter
PoolEvents.reset.reset_state
parameter to thePoolEvents.reset()
event, with deprecation logic in place that will continue to accept event hooks using the previous set of arguments. This indicates various state information about how the reset is taking place and is used to allow custom reset schemes to take place with full context given.Within this change a fix that's also backported to 1.4 is included which re-enables the
PoolEvents.reset()
event to continue to take place under all circumstances, including whenConnection
has already "reset" the connection.The two changes together allow custom reset schemes to be implemented using the
PoolEvents.reset()
event, instead of thePoolEvents.checkin()
event (which continues to function as it always has).References: #8717
typing
- [typing] [bug] Corrected various typing issues within the engine and async engine packages.
postgresql
-
[postgresql] [feature] Added new methods
_postgresql.Range.contains()
and_postgresql.Range.contained_by()
to the newRange
data object, which mirror the behavior of the PostgreSQL@>
and<@
operators, as well as the_postgresql.AbstractRange.comparator_factory.contains()
and_postgresql.AbstractRange.comparator_factory.contained_by()
SQL operator methods. Pull request courtesy Lele Gaifax.References: #8706
-
[postgresql] [usecase] Refined the new approach to range objects described at
change_7156
to accommodate driver-specific range and multirange objects, to better accommodate both legacy code as well as when passing results from raw SQL result sets back into new range or multirange expressions.References: #8690
1、 SQLAlchemy-2.0.0b3-cp310-cp310-macosx_10_9_x86_64.whl 1.82MB
2、 SQLAlchemy-2.0.0b3-cp310-cp310-macosx_11_0_arm64.whl 1.81MB
3、 SQLAlchemy-2.0.0b3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 2.54MB
4、 SQLAlchemy-2.0.0b3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.54MB
5、 SQLAlchemy-2.0.0b3-cp310-cp310-musllinux_1_1_aarch64.whl 2.56MB
6、 SQLAlchemy-2.0.0b3-cp310-cp310-musllinux_1_1_x86_64.whl 2.56MB
7、 SQLAlchemy-2.0.0b3-cp310-cp310-win32.whl 1.8MB
8、 SQLAlchemy-2.0.0b3-cp310-cp310-win_amd64.whl 1.81MB
9、 SQLAlchemy-2.0.0b3-cp311-cp311-macosx_10_9_x86_64.whl 1.82MB
10、 SQLAlchemy-2.0.0b3-cp311-cp311-macosx_11_0_arm64.whl 1.81MB
11、 SQLAlchemy-2.0.0b3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 2.59MB
12、 SQLAlchemy-2.0.0b3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.59MB
13、 SQLAlchemy-2.0.0b3-cp311-cp311-musllinux_1_1_aarch64.whl 2.59MB
14、 SQLAlchemy-2.0.0b3-cp311-cp311-musllinux_1_1_x86_64.whl 2.59MB
15、 SQLAlchemy-2.0.0b3-cp311-cp311-win32.whl 1.79MB
16、 SQLAlchemy-2.0.0b3-cp311-cp311-win_amd64.whl 1.81MB
17、 SQLAlchemy-2.0.0b3-cp37-cp37m-macosx_10_9_x86_64.whl 1.82MB
18、 SQLAlchemy-2.0.0b3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 2.5MB
19、 SQLAlchemy-2.0.0b3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.5MB
20、 SQLAlchemy-2.0.0b3-cp37-cp37m-musllinux_1_1_aarch64.whl 2.52MB
21、 SQLAlchemy-2.0.0b3-cp37-cp37m-musllinux_1_1_x86_64.whl 2.51MB
22、 SQLAlchemy-2.0.0b3-cp37-cp37m-win32.whl 1.8MB
23、 SQLAlchemy-2.0.0b3-cp37-cp37m-win_amd64.whl 1.81MB
24、 SQLAlchemy-2.0.0b3-cp38-cp38-macosx_10_9_x86_64.whl 1.82MB
25、 SQLAlchemy-2.0.0b3-cp38-cp38-macosx_11_0_arm64.whl 1.81MB
26、 SQLAlchemy-2.0.0b3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 2.6MB
27、 SQLAlchemy-2.0.0b3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.6MB
28、 SQLAlchemy-2.0.0b3-cp38-cp38-musllinux_1_1_aarch64.whl 2.65MB
29、 SQLAlchemy-2.0.0b3-cp38-cp38-musllinux_1_1_x86_64.whl 2.64MB
30、 SQLAlchemy-2.0.0b3-cp38-cp38-win32.whl 1.8MB
31、 SQLAlchemy-2.0.0b3-cp38-cp38-win_amd64.whl 1.82MB
32、 SQLAlchemy-2.0.0b3-cp39-cp39-macosx_10_9_x86_64.whl 1.82MB
33、 SQLAlchemy-2.0.0b3-cp39-cp39-macosx_11_0_arm64.whl 1.81MB
34、 SQLAlchemy-2.0.0b3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 2.59MB
35、 SQLAlchemy-2.0.0b3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.58MB
36、 SQLAlchemy-2.0.0b3-cp39-cp39-musllinux_1_1_aarch64.whl 2.6MB
37、 SQLAlchemy-2.0.0b3-cp39-cp39-musllinux_1_1_x86_64.whl 2.59MB
38、 SQLAlchemy-2.0.0b3-cp39-cp39-win32.whl 1.8MB
39、 SQLAlchemy-2.0.0b3-cp39-cp39-win_amd64.whl 1.82MB
40、 SQLAlchemy-2.0.0b3-py3-none-any.whl 1.66MB