rel_2_0_4
版本发布时间: 2023-02-18 00:01:33
sqlalchemy/sqlalchemy最新发布版本:rel_2_0_29(2024-03-24 05:53:32)
2.0.4
Released: February 17, 2023
orm
-
[orm] [usecase] The
_orm.Session.refresh()
method will now immediately load a relationship-bound attribute that is explicitly named within the_orm.Session.refresh.attribute_names
collection even if it is currently linked to the "select" loader, which normally is a "lazy" loader that does not fire off during a refresh. The "lazy loader" strategy will now detect that the operation is specifically a user-initiated_orm.Session.refresh()
operation which named this attribute explicitly, and will then call upon the "immediateload" strategy to actually emit SQL to load the attribute. This should be helpful in particular for some asyncio situations where the loading of an unloaded lazy-loaded attribute must be forced, without using the actual lazy-loading attribute pattern not supported in asyncio.References: #9298
-
[orm] [bug] [regression] Fixed regression introduced in version 2.0.2 due to #9217 where using DML RETURNING statements, as well as
_sql.Select.from_statement()
constructs as was "fixed" in #9217, in conjunction with ORM mapped classes that used expressions such as with_orm.column_property()
, would lead to an internal error within Core where it would attempt to match the expression by name. The fix repairs the Core issue, and also adjusts the fix in #9217 to not take effect for the DML RETURNING use case, where it adds unnecessary overhead.References: #9273
-
[orm] [bug] Marked the internal
EvaluatorCompiler
module as private to the ORM, and renamed it to_EvaluatorCompiler
. For users that may have been relying upon this, the nameEvaluatorCompiler
is still present, however this use is not supported and will be removed in a future release. -
[orm] [use_case] To accommodate a change in column ordering used by ORM Declarative in SQLAlchemy 2.0, a new parameter
_orm.mapped_column.sort_order
has been added that can be used to control the order of the columns defined in the table by the ORM, for common use cases such as mixins with primary key columns that should appear first in tables. The change notes atchange_9297
illustrate the default change in ordering behavior (which is part of all SQLAlchemy 2.0 releases) as well as use of the_orm.mapped_column.sort_order
to control column ordering when using mixins and multiple classes (new in 2.0.4).References: #9297
orm declarative
-
[usecase] [orm declarative] Added new parameter
dataclasses_callable
to both the_orm.MappedAsDataclass
class as well as the_orm.registry.mapped_as_dataclass()
method which allows an alternative callable to Pythondataclasses.dataclass
to be used in order to produce dataclasses. The use case here is to drop in Pydantic's dataclass function instead. Adjustments have been made to the mixin support added for #9179 in version 2.0.1 so that the__annotations__
collection of the mixin is rewritten to not include the_orm.Mapped
container, in the same way as occurs with mapped classes, so that the Pydantic dataclasses constructor is not exposed to unknown types.References: #9266
sql
-
[sql] [bug] Fixed issue where element types of a tuple value would be hardcoded to take on the types from a compared-to tuple, when the comparison were using the
ColumnOperators.in_()
operator. This was inconsistent with the usual way that types are determined for a binary expression, which is that the actual element type on the right side is considered first before applying the left-hand-side type.References: #9313
-
[sql] Added public property
_schema.Table.autoincrement_column
that returns the column identified as autoincrementing in the column.References: #9277
typing
-
[typing] [usecase] Improved the typing support for the
hybrids_toplevel
extension, updated all documentation to use ORM Annotated Declarative mappings, and added a new modifier calledhybrid_property.inplace
. This modifier provides a way to alter the state of ahybrid_property
in place, which is essentially what very early versions of hybrids did, before SQLAlchemy version 1.2.0 #3912 changed this to remove in-place mutation. This in-place mutation is now restored on an opt-in basis to allow a single hybrid to have multiple methods set up, without the need to name all the methods the same and without the need to carefully "chain" differently-named methods in order to maintain the composition. Typing tools such as Mypy and Pyright do not allow same-named methods on a class, so with this change a succinct method of setting up hybrids with typing support is restored.References: #9321
oracle
-
[oracle] [bug] Adjusted the behavior of the
thick_mode
parameter for theoracledb
dialect to correctly acceptFalse
as a value. Previously, onlyNone
would indicate that thick mode should be disabled.References: #9295
1、 SQLAlchemy-2.0.4-cp310-cp310-macosx_10_9_x86_64.whl 1.87MB
2、 SQLAlchemy-2.0.4-cp310-cp310-macosx_11_0_arm64.whl 1.86MB
3、 SQLAlchemy-2.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.59MB
4、 SQLAlchemy-2.0.4-cp310-cp310-musllinux_1_1_x86_64.whl 2.61MB
5、 SQLAlchemy-2.0.4-cp310-cp310-win32.whl 1.84MB
6、 SQLAlchemy-2.0.4-cp310-cp310-win_amd64.whl 1.86MB
7、 SQLAlchemy-2.0.4-cp311-cp311-macosx_10_9_x86_64.whl 1.86MB
8、 SQLAlchemy-2.0.4-cp311-cp311-macosx_11_0_arm64.whl 1.85MB
9、 SQLAlchemy-2.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.64MB
10、 SQLAlchemy-2.0.4-cp311-cp311-musllinux_1_1_x86_64.whl 2.64MB
11、 SQLAlchemy-2.0.4-cp311-cp311-win32.whl 1.84MB
12、 SQLAlchemy-2.0.4-cp311-cp311-win_amd64.whl 1.86MB
13、 SQLAlchemy-2.0.4-cp37-cp37m-macosx_10_9_x86_64.whl 1.86MB
14、 SQLAlchemy-2.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.55MB
15、 SQLAlchemy-2.0.4-cp37-cp37m-musllinux_1_1_x86_64.whl 2.56MB
16、 SQLAlchemy-2.0.4-cp37-cp37m-win32.whl 1.85MB
17、 SQLAlchemy-2.0.4-cp37-cp37m-win_amd64.whl 1.86MB
18、 SQLAlchemy-2.0.4-cp38-cp38-macosx_10_9_x86_64.whl 1.87MB
19、 SQLAlchemy-2.0.4-cp38-cp38-macosx_11_0_arm64.whl 1.86MB
20、 SQLAlchemy-2.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.65MB
21、 SQLAlchemy-2.0.4-cp38-cp38-musllinux_1_1_x86_64.whl 2.69MB
22、 SQLAlchemy-2.0.4-cp38-cp38-win32.whl 1.85MB
23、 SQLAlchemy-2.0.4-cp38-cp38-win_amd64.whl 1.87MB
24、 SQLAlchemy-2.0.4-cp39-cp39-macosx_10_9_x86_64.whl 1.87MB
25、 SQLAlchemy-2.0.4-cp39-cp39-macosx_11_0_arm64.whl 1.86MB
26、 SQLAlchemy-2.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 2.63MB
27、 SQLAlchemy-2.0.4-cp39-cp39-musllinux_1_1_x86_64.whl 2.64MB
28、 SQLAlchemy-2.0.4-cp39-cp39-win32.whl 1.85MB
29、 SQLAlchemy-2.0.4-cp39-cp39-win_amd64.whl 1.87MB
30、 SQLAlchemy-2.0.4-py3-none-any.whl 1.71MB