]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
16 months agoMerge "use a private return class for the "catch all" relationship" into main
Michael Bayer [Fri, 22 Mar 2024 13:30:47 +0000 (13:30 +0000)] 
Merge "use a private return class for the "catch all" relationship" into main

16 months agoMerge "assign variant mapping on adapt()" into main
Michael Bayer [Fri, 22 Mar 2024 13:23:18 +0000 (13:23 +0000)] 
Merge "assign variant mapping on adapt()" into main

16 months agoMerge "A scalar subquery that returns bool is now correctly typed" into main
Michael Bayer [Fri, 22 Mar 2024 13:22:43 +0000 (13:22 +0000)] 
Merge "A scalar subquery that returns bool is now correctly typed" into main

16 months agoensure ARRAY.__init__ documents before Comparator
Mike Bayer [Thu, 21 Mar 2024 06:13:22 +0000 (02:13 -0400)] 
ensure ARRAY.__init__ documents before Comparator

also add note for zero_indexes to generic and PG ARRAY
types

References: https://github.com/sqlalchemy/sqlalchemy/discussions/11100
Change-Id: I2087da695787a930f325cfb2fa4156d19c8e8f31

16 months agoA scalar subquery that returns bool is now correctly typed
Federico Caselli [Wed, 20 Mar 2024 21:18:35 +0000 (22:18 +0100)] 
A scalar subquery that returns bool is now correctly typed

Fixes: #10937
Change-Id: Iba4986be14fefd4210b727ddb7ae7e9291ab7f7f

16 months agouse a private return class for the "catch all" relationship
Mike Bayer [Thu, 9 Nov 2023 15:27:19 +0000 (10:27 -0500)] 
use a private return class for the "catch all" relationship

Fixed Declarative issue where typing a relationship using
:class:`_orm.Relationship` rather than :class:`_orm.Mapped` would
inadvertently pull in the "dynamic" relationship loader strategy for that
attribute.

Fixes: #10611
Change-Id: Ie4421050b583827fdf96c27ae9d7fe7ca596e77e

16 months agoassign variant mapping on adapt()
Mike Bayer [Wed, 20 Mar 2024 14:23:41 +0000 (10:23 -0400)] 
assign variant mapping on adapt()

Fixed regression from the 1.4 series where the refactor of the
:meth:`_types.TypeEngine.with_variant` method introduced at
:ref:`change_6980` failed to accommodate for the ``.copy()`` method, which
will lose the variant mappings that are set up. This becomes an issue for
the very specific case of a "schema" type, which includes types such as
:class:`.Enum` and :class:`.ARRAY`, when they are then used in the context
of an ORM Declarative mapping with mixins where copying of types comes into
play.  The variant mapping is now copied as well.

Fixes: #11176
Change-Id: Icf1a2752f60fce863c87ead8b0fe298b0f3d3766

16 months agowork around boldface concerns
Mike Bayer [Tue, 19 Mar 2024 14:51:01 +0000 (10:51 -0400)] 
work around boldface concerns

Change-Id: I99ed117bb0f1bdc1a8750bd13db5a69d5c398ae0

16 months agoMerge "do not convert uuid to string in postgresql and mssql" into main
Michael Bayer [Tue, 19 Mar 2024 14:43:51 +0000 (14:43 +0000)] 
Merge "do not convert uuid to string in postgresql and mssql" into main

16 months agoMerge "document improvement for load_only" into main
Michael Bayer [Tue, 19 Mar 2024 14:42:28 +0000 (14:42 +0000)] 
Merge "document improvement for load_only" into main

16 months agoadd notes clarifying the role of "$user" in pg search_path
Mike Bayer [Tue, 19 Mar 2024 12:35:00 +0000 (08:35 -0400)] 
add notes clarifying the role of "$user" in pg search_path

references: https://github.com/sqlalchemy/alembic/discussions/1447
Change-Id: I2ef55813699f84ac7fbca6de7522f0d3d78e6029

16 months agodo not convert uuid to string in postgresql and mssql
Federico Caselli [Mon, 18 Mar 2024 21:01:00 +0000 (22:01 +0100)] 
do not convert uuid to string in postgresql and mssql

Change-Id: Ic3c87d8c654926f7ef28ba9ec6dd21c50a1171cf

16 months agofix typo from d8174392dce20004d9158a90949b4ff11b830247
Federico Caselli [Mon, 18 Mar 2024 20:52:41 +0000 (21:52 +0100)] 
fix typo from d8174392dce20004d9158a90949b4ff11b830247

Change-Id: If76715abf6de8fc85580080a73aa5faa138aa968

16 months agodocument improvement for load_only
Federico Caselli [Mon, 18 Mar 2024 20:50:35 +0000 (21:50 +0100)] 
document improvement for load_only

mention that load_only can be used to control what
populate existing refreses.

Change-Id: I9bd6fbe8674005d9f32f9d1bc263bf860b53c3ec

16 months agoMerge "Add impyla to external dialect list" into main
Federico Caselli [Mon, 18 Mar 2024 20:31:46 +0000 (20:31 +0000)] 
Merge "Add impyla to external dialect list" into main

16 months agoMerge "remove sentinel_value_resolvers and use pre-bind values" into main
Michael Bayer [Mon, 18 Mar 2024 18:17:07 +0000 (18:17 +0000)] 
Merge "remove sentinel_value_resolvers and use pre-bind values" into main

16 months agoadd missing cache_ok directive to MyEpochType
Mike Bayer [Mon, 18 Mar 2024 14:22:06 +0000 (10:22 -0400)] 
add missing cache_ok directive to MyEpochType

Change-Id: Ic4da52b02a4ba36d87d73974fe428b91d9d7915c

16 months agoremove sentinel_value_resolvers and use pre-bind values
Mike Bayer [Fri, 15 Mar 2024 14:51:02 +0000 (10:51 -0400)] 
remove sentinel_value_resolvers and use pre-bind values

Made a change to the adjustment made in version 2.0.10 for :ticket:`9618`,
which added the behavior of reconciling RETURNING rows from a bulk INSERT
to the parameters that were passed to it.  This behavior included a
comparison of already-DB-converted bound parameter values against returned
row values that was not always "symmetrical" for SQL column types such as
UUIDs, depending on specifics of how different DBAPIs receive such values
versus how they return them, necessitating the need for additional
"sentinel value resolver" methods on these column types.  Unfortunately
this broke third party column types such as UUID/GUID types in libraries
like SQLModel which did not implement this special method, raising an error
"Can't match sentinel values in result set to parameter sets".  Rather than
attempt to further explain and document this implementation detail of the
"insertmanyvalues" feature including a public version of the new
method, the approach is intead revised to no longer need this extra
conversion step, and the logic that does the comparison now works on the
pre-converted bound parameter value compared to the post-result-processed
value, which should always be of a matching datatype.  In the unusual case
that a custom SQL column type that also happens to be used in a "sentinel"
column for bulk INSERT is not receiving and returning the same value type,
the "Can't match" error will be raised, however the mitigation is
straightforward in that the same Python datatype should be passed as that
returned.

Fixes: #11160
Change-Id: Ica62571e923ad9545eb90502e6732b11875b164a

16 months agoAdd impyla to external dialect list
Gord Thompson [Mon, 18 Mar 2024 13:26:17 +0000 (07:26 -0600)] 
Add impyla to external dialect list

Change-Id: I5a85db43a11c2c993597d0fa737377ee460b7629

16 months agoMerge "mysql: Add new reserved words from MySQL 8.3." into main
Federico Caselli [Fri, 15 Mar 2024 21:02:04 +0000 (21:02 +0000)] 
Merge "mysql: Add new reserved words from MySQL 8.3." into main

16 months agofix mypy on python<3.10
Federico Caselli [Fri, 15 Mar 2024 19:42:16 +0000 (20:42 +0100)] 
fix mypy on python<3.10

Change-Id: Ice16ff3685f89c64607ef37a906e17c53a5324fd

16 months agomysql: Add new reserved words from MySQL 8.3.
Sean Bright [Fri, 15 Mar 2024 17:57:28 +0000 (13:57 -0400)] 
mysql: Add new reserved words from MySQL 8.3.

Adds the following new keywords from MySQL 8.3:

* `intersect`
* `parallel`
* `qualify`

Sourced from https://dev.mysql.com/doc/refman/8.3/en/keywords.html

Fixes: #11166
<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
<!-- Describe your changes in detail -->

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11167
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11167
Pull-request-sha: adc789cdc6ea66d73925e2a819ea70e60ec282e4

Change-Id: I4441389a4ebec02cdb8372051b6fab1280bcf198

16 months agoaccommodate schema_translate_map in _deliver_insertmanyvalues_batches
Mike Bayer [Wed, 13 Mar 2024 22:23:07 +0000 (18:23 -0400)] 
accommodate schema_translate_map in _deliver_insertmanyvalues_batches

Fixed issue in :ref:`engine_insertmanyvalues` feature where using a primary
key column with an "inline execute" default generator such as an explicit
:class:`.Sequence` with an explcit schema name, while at the same time
using the
:paramref:`_engine.Connection.execution_options.schema_translate_map`
feature would fail to render the sequence or the parameters properly,
leading to errors.

Fixes: #11157
Change-Id: I35666af46d40996aff35d3d39f48c150d838e6e4

16 months agoMerge "Make instrumented attribute covariant as well" into main
Michael Bayer [Wed, 13 Mar 2024 16:02:28 +0000 (16:02 +0000)] 
Merge "Make instrumented attribute covariant as well" into main

16 months agoMerge "add doctests to asyncio tutorial" into main
Michael Bayer [Wed, 13 Mar 2024 16:00:58 +0000 (16:00 +0000)] 
Merge "add doctests to asyncio tutorial" into main

16 months agoMake instrumented attribute covariant as well
Ethan Langevin [Mon, 11 Mar 2024 11:41:58 +0000 (07:41 -0400)] 
Make instrumented attribute covariant as well

<!-- Provide a general summary of your proposed changes in the Title field above -->

Allows mapped relationships to use covariant types which makes it possible to define methods that operate on relationships in a typesafe way

### Description

See: https://github.com/sqlalchemy/sqlalchemy/issues/11112 for a more in depth explanation.

Just changed the type parameter in `InstrumentedAttribute` from `_T` to `_T_co`.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11113
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11113
Pull-request-sha: 3c100f28661f3440769175a17c2763ed25f4b83a

Change-Id: Iff715c24f1556d5604dcd33661a0ee7232b9404b

16 months agoimprove docs for sqlite memory db
Federico Caselli [Tue, 12 Mar 2024 22:05:50 +0000 (23:05 +0100)] 
improve docs for sqlite memory db

Change-Id: Icdbc13bdad3fb5ae69e79605bb7e6cb82d538c80
References: #10968

16 months agoupdate section be qualified for PGBouncer
Mike Bayer [Mon, 11 Mar 2024 23:59:06 +0000 (19:59 -0400)] 
update section be qualified for PGBouncer

the NullPool advice is for PGBouncer only

Change-Id: Ib79cae8965435b78fbde6e2d4de5e35fcd2a2f21

16 months agoadd doctests to asyncio tutorial
Federico Caselli [Mon, 26 Feb 2024 21:16:18 +0000 (22:16 +0100)] 
add doctests to asyncio tutorial

Change-Id: I28c94a7bc1e7ae572af0d206b8e63a110dc6fd7a

16 months agoMerge "Update docs references to .execute() with string literal" into main
Federico Caselli [Mon, 11 Mar 2024 22:35:49 +0000 (22:35 +0000)] 
Merge "Update docs references to .execute() with string literal" into main

16 months agoMention getitem on automap classes property
Federico Caselli [Mon, 11 Mar 2024 22:11:28 +0000 (23:11 +0100)] 
Mention getitem on automap classes property

Fixes #11097

Change-Id: I05198c8288e11fb0c645e9a7d46652fa979b56f7

16 months agoMerge "Fixes: #10933 typing in ColumnExpressionArgument" into main
Federico Caselli [Mon, 11 Mar 2024 22:10:55 +0000 (22:10 +0000)] 
Merge "Fixes: #10933 typing in ColumnExpressionArgument" into main

16 months agoMerge "Allow using AsyncEngine in compile" into main
Michael Bayer [Mon, 11 Mar 2024 22:04:45 +0000 (22:04 +0000)] 
Merge "Allow using AsyncEngine in compile" into main

16 months agoFixing typos (#11105)
Andreas Deininger [Mon, 11 Mar 2024 21:40:14 +0000 (22:40 +0100)] 
Fixing typos (#11105)

16 months agoFixes: #11083 (#11095)
Daniel Robert [Mon, 11 Mar 2024 21:34:20 +0000 (14:34 -0700)] 
Fixes: #11083 (#11095)
16 months agoadd a docs cross-reference between adding columns & relationships to existing table...
Jens Troeger [Mon, 11 Mar 2024 21:11:45 +0000 (17:11 -0400)] 
add a docs cross-reference between adding columns & relationships to existing table mappings

For context see discussion https://github.com/sqlalchemy/sqlalchemy/discussions/11124. This change adds the requested cross-reference to the documentation.

This pull request is:

- [X] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11133
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11133
Pull-request-sha: f8cc7a9c510f058f75bcb4308f3f398b8ae70de8

Change-Id: Ic683354fa05560d869d47ceda820d88e758e2973

16 months agochore: remove repetitive words (#11134)
acceptacross [Mon, 11 Mar 2024 21:01:42 +0000 (05:01 +0800)] 
chore: remove repetitive words (#11134)

Signed-off-by: acceptacross <csqcqs@gmail.com>
16 months agofix imports in "Self-Referential Many-to-Many Relationship" code example (#11120)
Denis Laxalde [Mon, 11 Mar 2024 20:59:51 +0000 (21:59 +0100)] 
fix imports in "Self-Referential Many-to-Many Relationship" code example (#11120)

Some were unused, some were missing.

16 months agofix usage of kwargs to execute in docs
Federico Caselli [Mon, 11 Mar 2024 20:58:46 +0000 (21:58 +0100)] 
fix usage of kwargs to execute in docs

Change-Id: I033cba49ba6c12113643b88e48c5917f2b70a307

16 months agoAllow using AsyncEngine in compile
Eugene Toder [Mon, 11 Mar 2024 11:42:47 +0000 (07:42 -0400)] 
Allow using AsyncEngine in compile

This works, so only need to update the type annotation.

This pull request is:

- [x] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed

Closes: #11103
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11103
Pull-request-sha: ba9e61a3902d5666a5176aedd50afe8ae7762bff

Change-Id: I3d08b930a8cae0539bf9b436d5e806d8912cdee0

16 months agoFixed typing issues with sync code runners
Francisco R. Del Roio [Sun, 25 Feb 2024 19:37:27 +0000 (14:37 -0500)] 
Fixed typing issues with sync code runners

Fixed typing issue allowing asyncio ``run_sync()`` methods to correctly
type the parameters according to the callable that was passed, making use
of :pep:`612` ``ParamSpec`` variables.  Pull request courtesy Francisco R.
Del Roio.

Closes: #11055
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11055
Pull-request-sha: 712b4382b16e4c07c09ac40a570c4bfb76c28161

Change-Id: I94ec8bbb0688d6c6e1610f8f769abab550179c14

16 months agoadd extra pep695 conversion step
Mike Bayer [Sat, 9 Mar 2024 17:47:01 +0000 (12:47 -0500)] 
add extra pep695 conversion step

Added support for the :pep:`695` ``TypeAliasType`` construct as well as the
python 3.12 native ``type`` keyword to work with ORM Annotated Declarative
form when using these constructs to link to a :pep:`593` ``Annotated``
container, allowing the resolution of the ``Annotated`` to proceed when
these constructs are used in a :class:`_orm.Mapped` typing container.

Fixes: #11130
Change-Id: I9a386943966de2107f15f08dfe6ed2aa84f7e86c

16 months agodocument caveat for #11054
Mike Bayer [Sat, 9 Mar 2024 18:41:05 +0000 (13:41 -0500)] 
document caveat for #11054

Fixes: #11054
Change-Id: I1a5a9586d024d84dacf37742d710baf7b8f7570f

16 months agouse a fixed date that's not near DST switchover
Mike Bayer [Sat, 9 Mar 2024 15:05:03 +0000 (10:05 -0500)] 
use a fixed date that's not near DST switchover

CI has been failing here due to the DST switchover regarding
live dates.

Change-Id: I98b2dbe646180f41f948bec20193fdf3f63501b8

17 months agoMerge "accommodate False conditions for unique / index merge" into main
Michael Bayer [Tue, 5 Mar 2024 14:30:49 +0000 (14:30 +0000)] 
Merge "accommodate False conditions for unique / index merge" into main

17 months agoInline _get_bind_args method.
oleg [Tue, 5 Mar 2024 13:18:36 +0000 (08:18 -0500)] 
Inline _get_bind_args method.

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
_get_bind_args is strange method in query module. It is called only in one place. It takes self(but don't use it) and two args with Any type. I think it must be static method with typehints if it will has more use cases in the future. But now removing is more simple solution.

### Checklist

This pull request is:

- [x] A short code fix

**Have a nice day!**

Closes: #11098
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11098
Pull-request-sha: dc997911a68e455419080a782778c56eceaa76f5

Change-Id: I53b960b3f2864a2db24ffa0058ab0569a721b11a

17 months agoFixes: #10933 typing in ColumnExpressionArgument
Tomasz Nowacki [Mon, 4 Mar 2024 14:52:02 +0000 (09:52 -0500)] 
Fixes: #10933 typing in ColumnExpressionArgument
### Description
Fixes: #10933 typing in ColumnExpressionArgument
### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #10959
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10959
Pull-request-sha: 6fed2cf1d1ba78e9101a3608bd0cf70f2abb3232

Change-Id: I43420add824881e7cc0ec93e3c8b9a04d33e30df

17 months agoaccommodate False conditions for unique / index merge
Mike Bayer [Mon, 4 Mar 2024 14:12:34 +0000 (09:12 -0500)] 
accommodate False conditions for unique / index merge

Fixed issue in ORM annotated declarative where using
:func:`_orm.mapped_column()` with an :paramref:`_orm.mapped_column.index`
or :paramref:`_orm.mapped_column.unique` setting of False would be
overridden by an incoming ``Annotated`` element that featured that
parameter set to ``True``, even though the immediate
:func:`_orm.mapped_column()` element is more specific and should take
precedence.  The logic to reconcile the booleans has been enhanced to
accommodate a local value of ``False`` as still taking precedence over an
incoming ``True`` value from the annotated element.

Fixes: #11091
Change-Id: I15cda4a0a07a289015c0a09bbe3ca2849956604e

17 months agocherry-pick changelog update for 2.0.29 11094/head
Mike Bayer [Mon, 4 Mar 2024 13:41:51 +0000 (08:41 -0500)] 
cherry-pick changelog update for 2.0.29

17 months agocherry-pick changelog from 2.0.28
Mike Bayer [Mon, 4 Mar 2024 13:41:51 +0000 (08:41 -0500)] 
cherry-pick changelog from 2.0.28

17 months agocherry-pick changelog update for 1.4.53
Mike Bayer [Mon, 4 Mar 2024 13:30:05 +0000 (08:30 -0500)] 
cherry-pick changelog update for 1.4.53

17 months agocherry-pick changelog from 1.4.52
Mike Bayer [Mon, 4 Mar 2024 13:30:04 +0000 (08:30 -0500)] 
cherry-pick changelog from 1.4.52

17 months agoMerge "Add support for preserve_rowcount execution_option" into main
Michael Bayer [Mon, 4 Mar 2024 06:08:55 +0000 (06:08 +0000)] 
Merge "Add support for preserve_rowcount execution_option" into main

17 months agoMerge "adjust bound parameters within cache key only, dont deep copy" into main
Michael Bayer [Mon, 4 Mar 2024 06:08:04 +0000 (06:08 +0000)] 
Merge "adjust bound parameters within cache key only, dont deep copy" into main

17 months agosupport pytest 8.1
Mike Bayer [Mon, 4 Mar 2024 04:03:14 +0000 (23:03 -0500)] 
support pytest 8.1

This is a bump in the tox.ini file.   it's possible we
don't need to change anything else as we had help from the pytest
people a few years back to make sure our API use was fairly modern.

Alembic is having problems that appear to be separate.

Change-Id: If0348dc4915522d31d3ab970df31244bbc8b8ca4

17 months agoadjust bound parameters within cache key only, dont deep copy
Mike Bayer [Sat, 2 Mar 2024 05:28:26 +0000 (00:28 -0500)] 
adjust bound parameters within cache key only, dont deep copy

Adjusted the fix made in :ticket:`10570`, released in 2.0.23, where new
logic was added to reconcile possibly changing bound parameter values
across cache key generations used within the :func:`_orm.with_expression`
construct.  The new logic changes the approach by which the new bound
parameter values are associated with the statement, avoiding the need to
deep-copy the statement which can result in a significant performance
penalty for very deep / complex SQL constructs.  The new approach no longer
requires this deep-copy step.

Fixes: #11085
Change-Id: Ia51eb4e949c8f37af135399925a9916b9ed4ad2f

17 months agoAdd support for preserve_rowcount execution_option
Federico Caselli [Wed, 7 Feb 2024 21:11:25 +0000 (22:11 +0100)] 
Add support for preserve_rowcount execution_option

Added new core execution option
paramref:`_engine.Connection.execution_options.preserve_rowcount`
to unconditionally save the ``rowcount`` attribute from the cursor in the
class:`_engine.Result` returned from an execution, regardless of the
statement being executed.
When this option is provided the correct value is also set when
an INSERT makes use of the "insertmanyvalues" mode, that may use
more than one actualy cursor execution.

Fixes: #10974
Change-Id: Icecef6b7539be9f0a1a02b9539864f5f163dcfbc

17 months agoadd 1.4 changelog for #10365
Mike Bayer [Thu, 29 Feb 2024 16:07:22 +0000 (11:07 -0500)] 
add 1.4 changelog for #10365

Change-Id: I3359274337f214132f35d9c4b722c97685b63d72

17 months agofix typos in docs
Federico Caselli [Mon, 26 Feb 2024 21:16:38 +0000 (22:16 +0100)] 
fix typos in docs

Change-Id: Iaba3c5979af626055acb0068cc8aac0c7334b0e0

17 months agofix issue in asincio doc example
Federico Caselli [Mon, 26 Feb 2024 20:11:20 +0000 (21:11 +0100)] 
fix issue in asincio doc example

Change-Id: Idd55c07a57381450ab5c9db99854b6a1668f0382

17 months agoAdded YugabyteDB dialect to the documentation (#11047)
Sfurti-yb [Thu, 22 Feb 2024 19:37:24 +0000 (01:07 +0530)] 
Added YugabyteDB dialect to the documentation (#11047)

* Added YugabyteDB dialect to the documentation

* Update doc/build/dialects/index.rst

Co-authored-by: Federico Caselli <cfederico87@gmail.com>
---------

Co-authored-by: Federico Caselli <cfederico87@gmail.com>
17 months agoReplace non-standard Python plat env marker (#11035)
layday [Wed, 21 Feb 2024 20:13:13 +0000 (22:13 +0200)] 
Replace non-standard Python plat env marker (#11035)

Fixes #11034.

17 months agoDocumenting multiprocessing and events (#10831)
James Braza [Wed, 21 Feb 2024 19:52:14 +0000 (14:52 -0500)] 
Documenting multiprocessing and events (#10831)

* Added documentation on multiprocessing support for event system

* Incorporating zzzeek's PR comments into docs as tip section

* Removed tip and changed section title to 'Events and Multiprocessing'

* Adopting zzzeek's PR comment suggestions

* Tweaked wording to be more concise

17 months agoMerge "implement native uuid for mariadb >= 10.7" into main
Michael Bayer [Wed, 21 Feb 2024 15:57:11 +0000 (15:57 +0000)] 
Merge "implement native uuid for mariadb >= 10.7" into main

17 months agoMerge "raise for asyncio-incompatible pool classes" into main
Michael Bayer [Tue, 20 Feb 2024 15:08:53 +0000 (15:08 +0000)] 
Merge "raise for asyncio-incompatible pool classes" into main

17 months agoimplement native uuid for mariadb >= 10.7
Volodymyr Kochetkov [Fri, 26 Jan 2024 15:54:11 +0000 (10:54 -0500)] 
implement native uuid for mariadb >= 10.7

Modified the MariaDB dialect so that when using the :class:`_sqltypes.Uuid`
datatype with  MariaDB >= 10.7, leaving the
:paramref:`_sqltypes.Uuid.native_uuid` parameter at its default of True,
the native ``UUID`` datatype will be rendered in DDL and used for database
communication, rather than ``CHAR(32)`` (the non-native UUID type) as was
the case previously.   This is a behavioral change since 2.0, where the
generic :class:`_sqltypes.Uuid` datatype delivered ``CHAR(32)`` for all
MySQL and MariaDB variants.   Support for all major DBAPIs is implemented
including support for less common "insertmanyvalues" scenarios where UUID
values are generated in different ways for primary keys.   Thanks much to
Volodymyr Kochetkov for delivering the PR.

To support this fully without hacks, the mariadb dialect now supports
driver-specific mariadb dialects as well, where we add one here for the
mysqlconnector DBAPI that doesn't accept Python UUID objects, whereas
all the other ones do.

Fixes: #10339
Closes: #10849
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10849
Pull-request-sha: 8490b08713f6c19692b11c084ae38d19e60dd396

Change-Id: Ib920871102b9b64f2cba9697f5cb72b6263e4ed8

17 months agoFix mysql dialect text docstring, length is interpreted as byte size
Zhong Zheng [Fri, 16 Feb 2024 17:20:59 +0000 (12:20 -0500)] 
Fix mysql dialect text docstring, length is interpreted as byte size

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
The `Text` and its variant types in MySQL are bytes size limited, not character length, so fixing the doctoring where the upper limit uses the `characters` as the unit instead of `bytes`

https://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html
https://dev.mysql.com/doc/refman/8.0/en/storage-requirements.html

<img width="878" alt="Screenshot 2024-02-15 at 17 27 59" src="https://github.com/sqlalchemy/sqlalchemy/assets/5219229/29731769-f57e-46f9-858b-46feda0ae83c">

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [x] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11018
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11018
Pull-request-sha: 13fa52917efea9a229c7abf19a3be40e24a79cb9

Change-Id: Iea903a6dc4b52ee4b7b5d2d64256c69abbd1f8aa

17 months agoFix typos in 2.1's migration notes (#10992)
Lele Gaifax [Fri, 16 Feb 2024 17:19:00 +0000 (18:19 +0100)] 
Fix typos in 2.1's migration notes (#10992)

17 months agoUpdate Actian entry in External Dialects table (#11014)
Michael Habiger [Fri, 16 Feb 2024 17:16:44 +0000 (11:16 -0600)] 
Update Actian entry in External Dialects table (#11014)

17 months agoraise for asyncio-incompatible pool classes
Mike Bayer [Thu, 15 Feb 2024 02:10:20 +0000 (21:10 -0500)] 
raise for asyncio-incompatible pool classes

An error is raised if a :class:`.QueuePool` or other non-asyncio pool class
is passed to :func:`_asyncio.create_async_engine`.  This engine only
accepts asyncio-compatible pool classes including
:class:`.AsyncAdaptedQueuePool`. Other pool classes such as
:class:`.NullPool` are compatible with both synchronous and asynchronous
engines as they do not perform any locking.

Fixes: #8771
Change-Id: I5843ccea7d824488492d1a9d46207b9f05330ae3

17 months agoMerge "ensure secondary cols not excluded from adaption" into main
Michael Bayer [Thu, 15 Feb 2024 01:04:22 +0000 (01:04 +0000)] 
Merge "ensure secondary cols not excluded from adaption" into main

17 months agoclarify example in orm tutorial
Federico Caselli [Wed, 14 Feb 2024 19:55:57 +0000 (20:55 +0100)] 
clarify example in orm tutorial

Change-Id: Ib6f9a7ce0beacda43ccd6d3c7750778ed3333b38

17 months agoensure secondary cols not excluded from adaption
Mike Bayer [Wed, 14 Feb 2024 14:29:19 +0000 (09:29 -0500)] 
ensure secondary cols not excluded from adaption

Fixed regression caused by :ticket:`9779` where using the "secondary" table
in a relationship ``and_()`` expression would fail to be aliased to match
how the "secondary" table normally renders within a
:meth:`_sql.Select.join` expression, leading to an invalid query.

Fixes: #11010
Change-Id: I535ce8b14f6a779c26b6b50b796ce64e57d7ee3d

17 months agocherry-pick changelog update for 2.0.28
Mike Bayer [Tue, 13 Feb 2024 15:05:54 +0000 (10:05 -0500)] 
cherry-pick changelog update for 2.0.28

17 months agocherry-pick changelog from 2.0.27
Mike Bayer [Tue, 13 Feb 2024 15:05:54 +0000 (10:05 -0500)] 
cherry-pick changelog from 2.0.27

17 months agouse correct exception for terminate catch + test
Mike Bayer [Tue, 13 Feb 2024 13:45:53 +0000 (08:45 -0500)] 
use correct exception for terminate catch + test

Fixed regression caused by just-released fix for :ticket:`10863` where an
invalid exception class were added to the "except" block, which does not
get exercised unless such a catch actually happens.   A mock-style test has
been added to ensure this catch is exercised in unit tests.

Fixes: #11005
Change-Id: I5a65403fb7bb35296ff44ae3cf6a336f8e0bda97

17 months agocherry-pick changelog update for 2.0.27
Mike Bayer [Sun, 11 Feb 2024 15:15:17 +0000 (10:15 -0500)] 
cherry-pick changelog update for 2.0.27

17 months agocherry-pick changelog from 2.0.26
Mike Bayer [Sun, 11 Feb 2024 15:15:17 +0000 (10:15 -0500)] 
cherry-pick changelog from 2.0.26

17 months agofix changelog messages
Mike Bayer [Sun, 11 Feb 2024 15:08:22 +0000 (10:08 -0500)] 
fix changelog messages

Change-Id: I5af8f59ec15820f83210f49aab3006b726484301

17 months agoUpdate docs references to .execute() with string literal
Gord Thompson [Wed, 31 Jan 2024 20:43:46 +0000 (13:43 -0700)] 
Update docs references to .execute() with string literal

.execute("… → .execute(text("…

Change-Id: Icc8f2db9cf3e148812d549f08326a0f2eb8cbfe3

17 months agohandle case where neither side has a cache key
Mike Bayer [Thu, 8 Feb 2024 13:45:22 +0000 (08:45 -0500)] 
handle case where neither side has a cache key

Fixed issue where an assertion within the implementation for
:func:`_orm.with_expression` would raise if a SQL expression that was not
cacheable were used; this was a 2.0 regression since 1.4.

Fixes: #10990
Change-Id: I6541189d29d2e860df7fbab187bfcc6f4dcbfc76

17 months agoMerge "Fix typing generics in PostgreSQL range types." into main
Federico Caselli [Wed, 7 Feb 2024 19:48:57 +0000 (19:48 +0000)] 
Merge "Fix typing generics in PostgreSQL range types." into main

17 months agoFixed typo on ordered_values example. (#10984)
Siloé Garcez [Wed, 7 Feb 2024 18:14:24 +0000 (15:14 -0300)] 
Fixed typo on ordered_values example. (#10984)

17 months agoFix typing generics in PostgreSQL range types.
Jim Bosch [Tue, 14 Nov 2023 21:19:31 +0000 (16:19 -0500)] 
Fix typing generics in PostgreSQL range types.

Correctly type PostgreSQL RANGE and MULTIRANGE types as ``Range[T]``
and ``Sequence[Range[T]]``.
Introduced utility sequence ``MultiRange`` to allow better
interoperability of MULTIRANGE types.

Fixes #9736
Closes: #10625
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10625
Pull-request-sha: 2c17bc5f922a2bdb805a29e458184076ccc08055

Change-Id: I4f91d0233b29fd8101e67bdd4cd0aa2524ab788a

17 months agoMerge "include cls locals in annotation evaluate" into main
Michael Bayer [Wed, 7 Feb 2024 00:45:47 +0000 (00:45 +0000)] 
Merge "include cls locals in annotation evaluate" into main

17 months agoMerge "remove unnecessary string concat in same line" into main
Michael Bayer [Wed, 7 Feb 2024 00:44:19 +0000 (00:44 +0000)] 
Merge "remove unnecessary string concat in same line" into main

17 months agoMerge "remove unneeded constructors for Unicode, UnicodeText" into main
Michael Bayer [Wed, 7 Feb 2024 00:42:39 +0000 (00:42 +0000)] 
Merge "remove unneeded constructors for Unicode, UnicodeText" into main

17 months agorestore uuid_data_type as closed at top level
Mike Bayer [Tue, 6 Feb 2024 23:11:32 +0000 (18:11 -0500)] 
restore uuid_data_type as closed at top level

the supports_native_uuid attribute does NOT indicate
the UUID datatype being present, only that Uuid(native_uuid=True)
would be able to produce something. On SQL Server it produces
UNIQUEIDENTIFIER.  The current use for this requirement is
that of testing the uppercase UUID type that has to match
that exactly.

Change-Id: I050e5d1889f804ee3763b84828f2bd6a47dd265e

17 months agoremove unneeded constructors for Unicode, UnicodeText
Mike Bayer [Tue, 6 Feb 2024 19:11:05 +0000 (14:11 -0500)] 
remove unneeded constructors for Unicode, UnicodeText

References: https://github.com/sqlalchemy/sqlalchemy/pull/10970
Change-Id: I59461bcd6359314c0c0a99923da5e3f3d3ddbfff

17 months agoremove unnecessary string concat in same line
Federico Caselli [Tue, 6 Feb 2024 18:44:47 +0000 (19:44 +0100)] 
remove unnecessary string concat in same line

manually update the files to remove literal string concat on the same line,
since black does not seem to be making progress in handling these

Change-Id: I3c651374c5f3db5b8bc0c700328d67ca03743b7b

17 months agoFix mariadb run tests doc (#10848)
whysage [Tue, 6 Feb 2024 17:57:21 +0000 (19:57 +0200)] 
Fix mariadb run tests doc (#10848)

17 months agoImprove formatting of data_select.rst (#10931)
Umer Zia [Tue, 6 Feb 2024 17:56:09 +0000 (18:56 +0100)] 
Improve formatting of data_select.rst (#10931)

17 months agoAdd bullets (#10973)
Artem Smirnov [Tue, 6 Feb 2024 17:55:41 +0000 (19:55 +0200)] 
Add bullets (#10973)

* Add bullets

* Fix as suggested

17 months agoBump pypa/cibuildwheel from 2.16.2 to 2.16.5 (#10947)
dependabot[bot] [Tue, 6 Feb 2024 17:53:28 +0000 (18:53 +0100)] 
Bump pypa/cibuildwheel from 2.16.2 to 2.16.5 (#10947)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.16.2 to 2.16.5.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.16.2...v2.16.5)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
17 months agoupdate .git-blame-ignore-revs to exclude black update commit
Federico Caselli [Tue, 6 Feb 2024 17:52:07 +0000 (18:52 +0100)] 
update .git-blame-ignore-revs to exclude black update commit

Change-Id: I20ca8ced42b19ec2bf26db743117321e336f4538

17 months agoinclude cls locals in annotation evaluate
Mike Bayer [Thu, 18 Jan 2024 17:47:02 +0000 (12:47 -0500)] 
include cls locals in annotation evaluate

Fixed issue where it was not possible to use a type (such as an enum)
within a :class:`_orm.Mapped` container type if that type were declared
locally within the class body.  The scope of locals used for the eval now
includes that of the class body itself.  In addition, the expression within
:class:`_orm.Mapped` may also refer to the class name itself, if used as a
string or with future annotations mode.

Fixes: #10899
Change-Id: Id4d07499558e457e63b483ff44c0972d9265409d

17 months agoMerge "add additional IMV UUID tests, fix pymssql case" into main
Michael Bayer [Tue, 6 Feb 2024 00:27:50 +0000 (00:27 +0000)] 
Merge "add additional IMV UUID tests, fix pymssql case" into main

17 months agoMerge "Update black to 24.1.1" into main
Michael Bayer [Mon, 5 Feb 2024 23:18:43 +0000 (23:18 +0000)] 
Merge "Update black to 24.1.1" into main

17 months agoadd additional IMV UUID tests, fix pymssql case
Mike Bayer [Mon, 5 Feb 2024 17:02:19 +0000 (12:02 -0500)] 
add additional IMV UUID tests, fix pymssql case

Fixed an issue regarding the use of the :class:`.Uuid` datatype with the
:paramref:`.Uuid.as_uuid` parameter set to False, when using the pymssql
dialect. ORM-optimized INSERT statements (e.g. the "insertmanyvalues"
feature) would not correctly align primary key UUID values for bulk INSERT
statements, resulting in errors.

This change also adds a small degree of generalization to the
Uuid datatype by adding the native/non-native compilation conditional
to the base compiler.

Patch is originally part of Ib920871102b9b64f2cba9697f5cb72b6263e4ed8
which is implementing native UUID for mariadb in 2.1 only.

Change-Id: I96cbec5c0ece312b345206aa5a5db2ffcf732d41

17 months agorun postfetch_post_update for version_id_col even if delete
Mike Bayer [Mon, 5 Feb 2024 21:06:28 +0000 (16:06 -0500)] 
run postfetch_post_update for version_id_col even if delete

Fixed issue where using :meth:`_orm.Session.delete` along with the
:paramref:`_orm.Mapper.version_id_col` feature would fail to use the
correct version identifier in the case that an additional UPDATE were
emitted against the target object as a result of the use of
:paramref:`_orm.relationship.post_update` on the object.  The issue is
similar to :ticket:`10800` just fixed in version 2.0.25 for the case of
updates alone.

Fixes: #10967
Change-Id: I959e9a2cc3e750e86e8de7b12b28ee1e819ed6d8