]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
2 days agoadd missing changelog for #12954 rel_2_0
Mike Bayer [Tue, 4 Nov 2025 21:56:34 +0000 (16:56 -0500)] 
add missing changelog for #12954

Change-Id: I9b779230c236884dc58f79c97e65bd6c983b252e
(cherry picked from commit 1bddbd9e58a2835dbc3539ffc38a93a4cb85a105)

3 days agodouble guard import issue
Mike Bayer [Tue, 4 Nov 2025 14:56:39 +0000 (09:56 -0500)] 
double guard import issue

3.13 has an import issue, 3.14 has a "hey why are you ignoring here"
issue, solve them both

this then cascaded into zimport uncooperativeness so had to
fix that and put out 0.6.3, so this becomes more of a thing

Change-Id: I5c01e48af2af14be17c3e5f2a53e7913444b98eb
(cherry picked from commit f4c08c07d0ea4d18d384925f4c7d46f05566f42b)

3 days agoclarify Core / ORM insert parameter behaviors
Mike Bayer [Tue, 4 Nov 2025 14:13:45 +0000 (09:13 -0500)] 
clarify Core / ORM insert parameter behaviors

it seems to have gotten lost in our newer docs that we're looking
at the first dict only for core insert.  add sections to both
INSERT tutorials explaining this difference

references: #12962
Change-Id: Id2e6c7e7db57fba6aa7838d5c3c65dea1939445a
(cherry picked from commit 7beb71d208955f8badef270c67eb47f3caac1f96)

4 days agoAdd order by clause to dialect tests to ensure expected result order
Pat Buxton [Mon, 3 Nov 2025 14:49:33 +0000 (09:49 -0500)] 
Add order by clause to dialect tests to ensure expected result order

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

### Description
Failing for Starrocks dialect currently without overrides, the amended dialect tests require an order by clause to ensure the expected result.

### 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 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.

Fixes https://github.com/sqlalchemy/sqlalchemy/issues/12956

Closes: #12957
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12957
Pull-request-sha: 271a014896e0c3d994112dec19029261d4507b6d

Change-Id: Ib8f5bc1caf014026071b83f57011c43c02043746
(cherry picked from commit a87faba35a65563447c8204cc47eb37ab47e216e)

6 days agouse the default driver for sparse backend
Mike Bayer [Sat, 1 Nov 2025 13:56:18 +0000 (09:56 -0400)] 
use the default driver for sparse backend

the memusage tests use sparse_backend but should use the
main driver in a set; they were using the pysqlite_numeric
dialect which is not a real dialect and apparently runs
dramatically slower for the memusage tests since it generates
more memory artifacts.

Change-Id: Icf19ac1a3cae862a48ddcec565079c960b8ac2b7
(cherry picked from commit 725d1a19b4e638c4a5ef40534397423c6c016614)

6 days agofix sqlite regex for quoted fk, pk names
Mike Bayer [Sat, 1 Nov 2025 02:57:28 +0000 (22:57 -0400)] 
fix sqlite regex for quoted fk, pk names

Fixed issue where SQLite dialect would fail to reflect constraint names
that contained uppercase letters or other characters requiring quoting. The
regular expressions used to parse primary key, foreign key, and unique
constraint names from the ``CREATE TABLE`` statement have been updated to
properly handle both quoted and unquoted constraint names.

Fixes: #12954
Change-Id: If5c24f536795e5db867d857242013610a04638fc
(cherry picked from commit cdaf1824316ba6fa7b52164b50cd9fd4aeb2c41f)

7 days agoensure util.get_annotations() is used
Mike Bayer [Fri, 31 Oct 2025 15:51:37 +0000 (11:51 -0400)] 
ensure util.get_annotations() is used

Fixed issue in Python 3.14 where dataclass transformation would fail when
a mapped class using :class:`.MappedAsDataclass` included a
:func:`.relationship` referencing a class that was not available at
runtime (e.g., within a ``TYPE_CHECKING`` block). This occurred when using
Python 3.14's :pep:`649` deferred annotations feature, which is the
default behavior without a ``from __future__ import annotations``
directive.

Fixes: #12952
Change-Id: I32f0adba00c32f5bf98fe2880dda1b96a7774d07
(cherry picked from commit 03dbd830e174685964191f739ea784f51c97d6b3)

9 days agoMerge "Add docs for using Psycopg 3 connection pooling" into rel_2_0
Michael Bayer [Wed, 29 Oct 2025 15:38:55 +0000 (15:38 +0000)] 
Merge "Add docs for using Psycopg 3 connection pooling" into rel_2_0

9 days agofix session cursor result tip
Mike Bayer [Wed, 29 Oct 2025 12:08:03 +0000 (08:08 -0400)] 
fix session cursor result tip

in 2.0, we are usually not returning CursorResult for
Session.execute().

References: #12813
Change-Id: I19049b57790b5429ce7890c86e87b93c07a3f1d2
(cherry picked from commit e2bda66b5115cc628ebce9423877586c9e817feb)

9 days agomissed yet another force dereference
Mike Bayer [Tue, 28 Oct 2025 23:41:10 +0000 (19:41 -0400)] 
missed yet another force dereference

Change-Id: I75204886b7a48a6148e47e18d28a0465f908c09d
(cherry picked from commit b8c5fd8588aeaea8077560b68c0ce85bfd2dfc3f)

9 days agofollowup to 368f5ac6668456 2
Mike Bayer [Tue, 28 Oct 2025 23:39:06 +0000 (19:39 -0400)] 
followup to 368f5ac6668456 2

Change-Id: I35e212aba32b2758a8bf6c01455f624910b4df17
(cherry picked from commit 2845e8418db95b4950a4df0d7933a419ca0e6f9e)

9 days agoadditional followup to368f5ac6668456609cf5f862
Mike Bayer [Tue, 28 Oct 2025 22:44:55 +0000 (18:44 -0400)] 
additional followup to368f5ac6668456609cf5f862

Change-Id: I689a52c22efe8cff5ef80fe308673b2cb1fe7684
(cherry picked from commit df558a375339abeaeb416e353fe6f1bdf05e2a32)

9 days agoAdd docs for using Psycopg 3 connection pooling
chrispy [Fri, 24 Oct 2025 21:08:31 +0000 (17:08 -0400)] 
Add docs for using Psycopg 3 connection pooling

Updates documentation to describe how to use Psycopg 3 connection
pooling in SQLAlchemy. This is a follow-up to discussion #12522.

References: #12522
Closes: #12540
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12540
Pull-request-sha: 8abbcb6e863deb6e0cf077d5fa780a2be5792931

Change-Id: I11ded6f82852f354f8371051c4b68fd7bdd01997
(cherry picked from commit 6f2275d8051beb501af912d431672887baa26594)

9 days agotry not to rely on GC working at all for tests
Mike Bayer [Tue, 28 Oct 2025 20:20:54 +0000 (16:20 -0400)] 
try not to rely on GC working at all for tests

GC seems to be working in fewer cases across different interpreters,
so add a new step to force an InstanceState to act as though
it got dereferenced, for those cases where we have del'ed the object,
done a gc collect, and we know it should not be reachable.

Change-Id: Ie97af1d5739f8d5a24aabe1296f14ce99ec1b0e5
(cherry picked from commit 368f5ac6668456609cf5f862c0676108cef4bec8)

9 days agoMerge "rewrite pool subsecond test to use mocking" into rel_2_0
Michael Bayer [Tue, 28 Oct 2025 20:25:30 +0000 (20:25 +0000)] 
Merge "rewrite pool subsecond test to use mocking" into rel_2_0

9 days agodont even run 3.7 on github actions
Mike Bayer [Tue, 28 Oct 2025 20:24:36 +0000 (16:24 -0400)] 
dont even run 3.7 on github actions

the nox version that installs on 3.7 is too old for the things
we are doing with tags. just skip it

Change-Id: I0d53ff3ed715dd6f4188fe865ce9a2d70a285de0

9 days agoset nox min version only for newer sys python
Mike Bayer [Tue, 28 Oct 2025 19:22:45 +0000 (15:22 -0400)] 
set nox min version only for newer sys python

The min version here fails on github actions because the runners
there use the single version of python for the install, and the newer
nox is not available on older pythons like 3.7.

We probably dont need the min version anyway, as since we have just
switched to venv in 5e62ea65167c, the misinterpretation of
"python3.14t" doesn't seem to happen anyway.  however, all versions
of nox seem willing to install a 3.14t interpreter when 3.14 is
requested, and a 3.14t is sooner in the path.  does not seem to
happen the other way around though (e.g. when 3.14t is requested,
it does not use a 3.14)

Anyway, for better predictability leave a min nox version in place
where we can do so for now.

Change-Id: I93a2c2e71798f5a75d71cc63de54750ec13975a1
(cherry picked from commit 93968e2c9e0796a4ea2fc13582b2eec83371f008)

9 days agorewrite pool subsecond test to use mocking
Mike Bayer [Tue, 28 Oct 2025 14:03:09 +0000 (10:03 -0400)] 
rewrite pool subsecond test to use mocking

the timing here is too sensitive to play out reliably
on CI machines particularly free threaded, so mock the time()
callable instead and ensure with subsecond clock intervals
we do the right math

Change-Id: Icc203ae2298eb4b64e3b45f063811e9527278d0c
(cherry picked from commit 4147accbd2b70493c01df18fd0d4598c4e1cb72e)

9 days agouse the nox venv backend
Mike Bayer [Tue, 28 Oct 2025 18:06:14 +0000 (14:06 -0400)] 
use the nox venv backend

This backend seems to run from the start against the resolved
interpreter, which we want.   The virtualenv option, which is
the default, has the problem indicated at [1].

[1] https://github.com/wntrblm/nox/issues/1021

Change-Id: Ic10317c603e0556676b16ad314fe6e79ba9d0476
(cherry picked from commit 5e62ea65167c4d6d710cb475cf506284e9335cfb)

11 days agoensure PYTHONPATH is blanked out
Mike Bayer [Mon, 27 Oct 2025 15:12:44 +0000 (11:12 -0400)] 
ensure PYTHONPATH is blanked out

this is in the tox.ini file also.  without it, the tests
run from my local ./lib/ when I set PYTHONPATH on the
outside

Change-Id: I1ec88edc0e1aeafbfa95054ec4ccb30bcb22d55f
(cherry picked from commit 2bb963891b8bbc3b2ec67c848cb405596c8ca3f6)

2 weeks agoimprove sqlite reflection regex for unusual names/formats
Mike Bayer [Sat, 18 Oct 2025 20:43:22 +0000 (16:43 -0400)] 
improve sqlite reflection regex for unusual names/formats

A series of improvements have been made for reflection of CHECK constraints
on SQLite. The reflection logic now correctly handles table names
containing the strings "CHECK" or "CONSTRAINT", properly supports all four
SQLite identifier quoting styles (double quotes, single quotes, brackets,
and backticks) for constraint names, and accurately parses CHECK constraint
expressions containing parentheses within string literals using balanced
parenthesis matching with string context tracking.    Big thanks to
GruzdevAV for new test cases and implementation ideas.

Fixes: #12924
Change-Id: I0390ac334c98e934c7e0353f47c9f43204791af5
(cherry picked from commit 189907be93392246ed5948506f1ca3921b8379f0)

2 weeks agorequire nox 2025.10.16, remove python version workaround
Mike Bayer [Sat, 18 Oct 2025 20:05:14 +0000 (16:05 -0400)] 
require nox 2025.10.16, remove python version workaround

the workaround for [1] no longer works now that the fix has
been committed.  slightly surprising but just require that version
of nox and carry on

[1] https://github.com/wntrblm/nox/pull/999

Change-Id: I4b4031c3d3d02399f55f9750237de61e5e90d179
(cherry picked from commit e1f3b43ad8b45afca3a7a363a41103f5f468f461)

2 weeks agoMerge "add nox support (but dont switch out fully)" into rel_2_0
Michael Bayer [Tue, 21 Oct 2025 17:30:19 +0000 (17:30 +0000)] 
Merge "add nox support (but dont switch out fully)" into rel_2_0

2 weeks agoadd nox support (but dont switch out fully)
Mike Bayer [Mon, 29 Sep 2025 03:44:41 +0000 (23:44 -0400)] 
add nox support (but dont switch out fully)

This backports the nox change from main/2.1 so that we have full
nox support available for the 2.0 series, however does not modify
any existing docs or test systems.

A noxfile.py has been added to allow testing with nox.  This is a direct
port of 2.1's move to nox, however leaves the tox.ini file in place and
retains all test documentation in terms of tox.   Version 2.1 will move to
nox fully, including deprecation warnings for tox and new testing
documentation.

Change-Id: I66639991e1dc3db582e2ff13f9348a7d6241916e
(cherry picked from commit df899e94cf7ba18f4e7151ef173393be78c56c3f)
(also cherry-picked from 1577c1d15b)

2 weeks agoFix missing back_populates in Note.item relationship in example code (#12925)
krave1986 [Mon, 20 Oct 2025 20:06:31 +0000 (04:06 +0800)] 
Fix missing back_populates in Note.item relationship in example code (#12925)

Without back_populates, the subsequent code would not automatically populate Item.notes or generate the key, which contradicts what the documentation intends to demonstrate.

(cherry picked from commit 1220858a0c5e85d4600b249dc3ae9412e01608ad)

3 weeks agore-document 12915 as not fully fixed
Mike Bayer [Fri, 17 Oct 2025 12:57:10 +0000 (08:57 -0400)] 
re-document 12915 as not fully fixed

The ORM side of this issue can't be fixed without rewriting
.params() which will be 2.1 only, so clarify changelog

References: #12915
Change-Id: I2e524d5390241aa289786f524b6a51f39bc09876
(cherry picked from commit b8906e62ceb122949f5dc9f49b1174986b64d503)

3 weeks agoMerge "fully copy_internals for AnnotatedFromClause for straight cloned traverse...
Michael Bayer [Wed, 15 Oct 2025 20:56:23 +0000 (20:56 +0000)] 
Merge "fully copy_internals for AnnotatedFromClause for straight cloned traverse" into rel_2_0

3 weeks agoUpdate collection_api.rst (#12912)
krave1986 [Wed, 15 Oct 2025 19:37:10 +0000 (03:37 +0800)] 
Update collection_api.rst (#12912)

In the Dictionary Collections section, the example code incorrectly calls .items() on the dictionary but shows dictionary output instead of the items() method's actual return value.

(cherry picked from commit d0651bde134c0038596893766a31498b6a6c3d8b)

3 weeks agofully copy_internals for AnnotatedFromClause for straight cloned traverse
Mike Bayer [Wed, 15 Oct 2025 18:47:38 +0000 (14:47 -0400)] 
fully copy_internals for AnnotatedFromClause for straight cloned traverse

Fixed issue where using :meth:`_sql.Select.params` to replace bound
parameters in a query could fail for some cases where the parameters
were embedded in subqueries or CTEs when ORM classes were involved,
due to issues with internal query traversal for these cases.

Fixes: #12915
Change-Id: Ib63bca786a541682f6b2144fd5dd43350411ae9d
(cherry picked from commit 03116b8cc90986a2e597d5423c490babf49c9913)

3 weeks agoSupport warnings in exclusions
Mike Bayer [Tue, 14 Oct 2025 21:19:26 +0000 (17:19 -0400)] 
Support warnings in exclusions

this adds a new feature to exclusions ``warns_if()`` which applies
the expect_warnings() context manager to a test method.  Additionally,
at the class level these requirements can be extracted from a
``__requirements__`` directive and also added to global Python warnings
filter using catch_warnings().

Change-Id: Ibe28d169106309a930731c77e201402152a38810
(cherry picked from commit 1a2d5cb8518e0b2ce81b2368e16fb470c27389be)

3 weeks agocreate real sections for PG table and constraint options
Mike Bayer [Tue, 14 Oct 2025 15:52:19 +0000 (11:52 -0400)] 
create real sections for PG table and constraint options

add new docs, clarify INDEX/UNIQUE for covering indexes which
was not clear at all previously

Change-Id: Ibc11b63b87cd8a939e074973b387e1a23fc236e5

3 weeks agoReflect collation in types on PostgreSQL
Denis Laxalde [Thu, 24 Jul 2025 19:35:09 +0000 (15:35 -0400)] 
Reflect collation in types on PostgreSQL

Added support for reflection of collation in types for PostgreSQL.
The ``collation`` will be set only if different from the default
one for the type.

References #6511
Closes: #12510
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12510
Pull-request-sha: c0a390314eb8ff2a4f729babf25cb052b6268d0a

Change-Id: I269a194d526a0689a4b38f10456d28539c73cffb
(cherry picked from commit 78af7c4f0406df614adc65a460481406eb4b1073)

3 weeks agodoc tweaks
Mike Bayer [Sun, 12 Oct 2025 05:43:48 +0000 (01:43 -0400)] 
doc tweaks

Change-Id: I7d445cd98db7edefe705ee4eb2cd24cad72040f3
(cherry picked from commit 938d70ae82441ebd48cb0f059823b8b39529f0cb)

3 weeks agobump black, flake8
Mike Bayer [Sat, 11 Oct 2025 18:29:44 +0000 (14:29 -0400)] 
bump black, flake8

nothing seems to have changed...

Change-Id: I7d08b24dc2df0f8a67bd5e704c8d108392a34fa3
(cherry picked from commit fd191b9d4a1d0b4a472917bfc8464309f6439b4c)

3 weeks agoMerge "Complete type annotations of sqlalchemy.engine.cursor module" into rel_2_0
Federico Caselli [Fri, 10 Oct 2025 18:45:55 +0000 (18:45 +0000)] 
Merge "Complete type annotations of sqlalchemy.engine.cursor module" into rel_2_0

3 weeks agoMerge "Improve typing and code in cursor module" into rel_2_0
Federico Caselli [Fri, 10 Oct 2025 18:43:19 +0000 (18:43 +0000)] 
Merge "Improve typing and code in cursor module" into rel_2_0

4 weeks agoVersion 2.0.45 placeholder
Mike Bayer [Fri, 10 Oct 2025 14:39:32 +0000 (10:39 -0400)] 
Version 2.0.45 placeholder

4 weeks ago- 2.0.44 rel_2_0_44
Mike Bayer [Fri, 10 Oct 2025 14:29:58 +0000 (10:29 -0400)] 
- 2.0.44

4 weeks agochangelog edits
Mike Bayer [Fri, 10 Oct 2025 14:29:32 +0000 (10:29 -0400)] 
changelog edits

Change-Id: I2d72ee3d8640c45efb6e6feb0f97df8d38d2236a
(cherry picked from commit d0cdf1939a37e0712fd951cca82e95b7c170c851)

4 weeks agothe gc_intensive blocks will continue until builds improve
Mike Bayer [Fri, 10 Oct 2025 12:22:22 +0000 (08:22 -0400)] 
the gc_intensive blocks will continue until builds improve

Change-Id: Ie62a2371eb1512ecde3a886f11a4b3de6d6cde3d
(cherry picked from commit 833953138f355c5288cd0f5b037869c13011dbe5)

4 weeks agoComplete type annotations of sqlalchemy.engine.cursor module
Denis Laxalde [Sat, 4 Oct 2025 19:13:29 +0000 (15:13 -0400)] 
Complete type annotations of sqlalchemy.engine.cursor module

References: #6810
Closes: #12760
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12760
Pull-request-sha: 2804f49e1922d3cdc67065b733d0dd6e06554905

Change-Id: I974f966b2cd8f984b872d0aa27bbbdab78c6c1d7
(cherry picked from commit 692dee952499bc9ed5abe31692c011b6e4847486)

4 weeks agomark more GC sensitive tests as not open for github
Mike Bayer [Thu, 9 Oct 2025 19:56:25 +0000 (15:56 -0400)] 
mark more GC sensitive tests as not open for github

Change-Id: Ib73ec54e4ed7ef2d8911bfe8ee7a719022c6cddd
(cherry picked from commit 0486e6eaf878568a1c3f53189a876cccf279fcdc)

4 weeks agoImprove typing and code in cursor module
Federico Caselli [Thu, 9 Oct 2025 18:45:26 +0000 (20:45 +0200)] 
Improve typing and code in cursor module

Change-Id: I56b89f303f03dfc7056c7174ac06bc1679319bb5
(cherry picked from commit 16be119cc04d9327df78e0891bec40765bfd5d4f)

4 weeks agoFix mssql index column order
Allen Chen [Fri, 3 Oct 2025 02:53:34 +0000 (22:53 -0400)] 
Fix mssql index column order

Fixed issue where the index reflection for SQL Server would
not correctly return the order of the column inside an index
when the order of the columns in the index did not match the
order of the columns in the table.
Pull request courtesy of Allen Chen.

Fixes: #12894
Closes: #12895
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12895
Pull-request-sha: bd9bd43219f35a29eaeee81fedea452afc64eb5d

Change-Id: I45ed30bbd0fcfd4f67cb2b682ecb3a18029be2b7
(cherry picked from commit 3dc9720c365a8d03e7c173874db74a080752d24e)

4 weeks agodont generate skipped suite names
Mike Bayer [Thu, 9 Oct 2025 16:43:16 +0000 (12:43 -0400)] 
dont generate skipped suite names

For a suite that is ``__backend__``, if no tests will run, then
don't include that suite in the result at all, rather than
keeping them there and having them skip.  the skip suites are
producing lots of noise in junit files

Change-Id: If58af412b7d8f542d6e1903ca933745075f5c7d9
(cherry picked from commit 8bb6aaa01bb292ffa7cc8db61d1b6f9c44fb5fc3)

4 weeks agoMerge "correct for FK reflecting on PK / index col at the same time" into rel_2_0
Michael Bayer [Wed, 8 Oct 2025 16:22:15 +0000 (16:22 +0000)] 
Merge "correct for FK reflecting on PK / index col at the same time" into rel_2_0

4 weeks agoMerge "Add Executable traverse internals to Executable subclasses and turn tests...
Michael Bayer [Wed, 8 Oct 2025 15:11:36 +0000 (15:11 +0000)] 
Merge "Add Executable traverse internals to Executable subclasses and turn tests on" into rel_2_0

4 weeks agocorrect for FK reflecting on PK / index col at the same time
Mike Bayer [Wed, 8 Oct 2025 15:09:59 +0000 (11:09 -0400)] 
correct for FK reflecting on PK / index col at the same time

Fixed issue in the MSSQL dialect's foreign key reflection query where
duplicate rows could be returned when a foreign key column and its
referenced primary key column have the same name, and both the referencing
and referenced tables have indexes with the same name. This resulted in an
"ForeignKeyConstraint with duplicate source column references are not
supported" error when attempting to reflect such tables. The query has been
corrected to exclude indexes on the child table when looking for unique
indexes referenced by foreign keys.

Fixes: #12907
Change-Id: I435d4cf3bfa9e861cbb5e1e5c8c81bd59c9a9d58
(cherry picked from commit 652f610a35ca0ba5286b2603dd1de84528262ae2)

4 weeks agoMerge "Add type annotations to indexable extension code" into rel_2_0
Federico Caselli [Wed, 8 Oct 2025 12:57:58 +0000 (12:57 +0000)] 
Merge "Add type annotations to indexable extension code" into rel_2_0

4 weeks agoAdd Executable traverse internals to Executable subclasses and turn tests on
Mike Bayer [Tue, 7 Oct 2025 18:55:44 +0000 (14:55 -0400)] 
Add Executable traverse internals to Executable subclasses and turn tests on

Fixed a caching issue where :func:`_orm.with_loader_criteria` would
incorrectly reuse cached bound parameter values when used with
:class:`_sql.CompoundSelect` constructs such as :func:`_sql.union`. The
issue was caused by the cache key for compound selects not including the
execution options that are part of the :class:`_sql.Executable` base class,
which :func:`_orm.with_loader_criteria` uses to apply its criteria
dynamically. The fix ensures that compound selects and other executable
constructs properly include execution options in their cache key traversal.

Fixes: #12905
Change-Id: I24bbd96233cddabe42eb716f078eea4c84b1af05
(cherry picked from commit 148059ced691da5edf3504a1d999cb1ab638dc7b)

4 weeks agotrim down GH actions jobs
Mike Bayer [Wed, 8 Oct 2025 12:05:21 +0000 (08:05 -0400)] 
trim down GH actions jobs

- remove 3.13t, it's not really viable compared to 3.14t
- fully block test_memusage

Change-Id: I78ffcde329a78a9d720569a4b46a20c071e94a5c
(cherry picked from commit 3815469635a4378cd3b6653a403bee4cc5e31327)

4 weeks agoAdd type annotations to indexable extension code
Denis Laxalde [Fri, 3 Oct 2025 19:10:08 +0000 (15:10 -0400)] 
Add type annotations to indexable extension code

A typing test case (plain_files/ext/indexable.py) is also added.

In order to make the methods of index_property conform with type
definitions of `fget`, `fset` and `fdel` arguments of hybrid_property,
we need to make the signature of protocols
(e.g. `_HybridGetterType`) `__call__`) method positional only.

Related to #6810.

Closes: #12763
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12763
Pull-request-sha: 896b9642629fb212a71e68ed3f08705d08407dbf

Change-Id: I42980ccf20ff9c992ebd616f38545e06ede57d36
(cherry picked from commit b2aa0e2575d3e779a9fc757b04896e9b61045aa8)

4 weeks agoMerge "update oracle profiles" into rel_2_0
Federico Caselli [Tue, 7 Oct 2025 21:41:03 +0000 (21:41 +0000)] 
Merge "update oracle profiles" into rel_2_0

4 weeks agoupdate oracle profiles
Federico Caselli [Tue, 7 Oct 2025 19:00:34 +0000 (21:00 +0200)] 
update oracle profiles

Change-Id: Ie1d5a8a6e655d7fc883f07348ee56a39fdc598da

4 weeks agoadd teardown to "run_n_times"
Mike Bayer [Tue, 7 Oct 2025 18:05:49 +0000 (14:05 -0400)] 
add teardown to "run_n_times"

Change-Id: Ibeeb90f7ea3bbd32ffd27b4eb2e2988018e87a5c
(cherry picked from commit 1ad77a925c4d34a6c6c4879803a79e7d6d10881b)

4 weeks agoremove mis-applied patch
Mike Bayer [Tue, 7 Oct 2025 13:35:26 +0000 (09:35 -0400)] 
remove mis-applied patch

some scratch tests got merged in 456727df50c7dc29ddc31c6f67c1b,
revert that part

Change-Id: I4e9d4a005f586dcc6fa1eb4a3a6fe886a21d6066
(cherry picked from commit ea78ff75bf4b43c417fe2ff4c37a8283f1de9ce5)

4 weeks agoadd 2.1 specific freethreading changelog
Mike Bayer [Tue, 7 Oct 2025 13:31:07 +0000 (09:31 -0400)] 
add 2.1 specific freethreading changelog

Change-Id: I9b4113d865938c164f119b6aef8648fd75ca6d5f
(cherry picked from commit 7015f7c4740efb3b99d64053ab629962ea365c5e)

4 weeks agoMerge "Add explicit multi-threaded tests and support free-threaded build" into rel_2_0
Michael Bayer [Tue, 7 Oct 2025 13:17:30 +0000 (13:17 +0000)] 
Merge "Add explicit multi-threaded tests and support free-threaded build" into rel_2_0

4 weeks agotype pysqlite
Pablo Estevez [Sat, 23 Aug 2025 12:33:47 +0000 (08:33 -0400)] 
type pysqlite

<!-- Provide a general summary of your proposed changes in the Title field above -->
type pysqlite from dialects.
type some related code on pysqlite.py

related to #6810

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

<!-- 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
- [ ] 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: #12789
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12789
Pull-request-sha: 2c1ea7283d534dd625c8f0e4270247d2cc5ed40c

Change-Id: I4d691c4bb334957029cd47289463555034ebd866
(cherry picked from commit e833474db064df32a7c02e809893e71ac4df4996)

5 weeks agoAdd explicit multi-threaded tests and support free-threaded build
Lysandros Nikolaou [Fri, 26 Sep 2025 14:16:41 +0000 (10:16 -0400)] 
Add explicit multi-threaded tests and support free-threaded build

Implemented initial support for free-threaded Python by adding new tests
and reworking the test harness and GitHub Actions to include Python 3.13t
and Python 3.14t in test runs. Two concurrency issues have been identified
and fixed: the first involves initialization of the ``.c`` collection on a
``FromClause``, a continuation of :ticket:`12302`, where an optional mutex
under free-threading is added; the second involves synchronization of the
pool "first_connect" event, which first received thread synchronization in
:ticket:`2964`, however under free-threading the creation of the mutex
itself runs under the same free-threading mutex. Initial pull request and
test suite courtesy Lysandros Nikolaou.

py313t: yes
py314t: yes
Fixes: #12881
Closes: #12882
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12882
Pull-request-sha: 53d65d96b979b1afbdb49e6394979cfd598c9a34

Co-authored-by: Mike Bayer <mike_mp@zzzcomputng.com>
Change-Id: I2e4f2e9ac974ab6382cb0520cc446b396d9680a6
(cherry picked from commit 456727df50c7dc29ddc31c6f67c1be21771386fa)

5 weeks agofix: pass dialect-specific kwargs to MetaData.reflect
Lukáš KožuÅ¡ník [Fri, 26 Sep 2025 22:37:50 +0000 (18:37 -0400)] 
fix: pass dialect-specific kwargs to MetaData.reflect

Fixed issue where :meth:`_schema.MetaData.reflect` did not forward
dialect-specific keyword arguments to the :class:`_engine.Inspector`
methods, causing options like ``oracle_resolve_synonyms`` to be ignored
during reflection. The method now ensures that all extra kwargs passed to
:meth:`_schema.MetaData.reflect` are forwarded to
:meth:`_engine.Inspector.get_table_names` and related reflection methods.
Pull request courtesy Lukáš KožuÅ¡ník.

Fixes: #12884
Closes: #12885
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12885
Pull-request-sha: 9436812223600a2459461744fe20648639afc07d

Change-Id: Idb1ca0bc624df8e175cbfa979a8f31e62de185fe
(cherry picked from commit 61c21f09c7f5bcf7acea0c1e65e07466da59a48c)

5 weeks agounblock python 3.14
Mike Bayer [Mon, 29 Sep 2025 17:17:49 +0000 (13:17 -0400)] 
unblock python 3.14

Unblocked automatic greenlet installation for Python 3.14 now that
there are greenlet wheels on pypi for python 3.14.

Change-Id: I2f7c94a01cb8d081f1bde8dc6685eaccba19f5f2

5 weeks agoMerge "lock down format_docs_code.py to specific paths" into rel_2_0
Michael Bayer [Mon, 29 Sep 2025 18:16:23 +0000 (18:16 +0000)] 
Merge "lock down format_docs_code.py to specific paths" into rel_2_0

5 weeks agoSquashed commit of the following:
Mike Bayer [Mon, 29 Sep 2025 16:16:13 +0000 (12:16 -0400)] 
Squashed commit of the following:

commit 24ff4a8bbac71a174d6d7a2ab319fdf9bae04e6f
Author: yuanoOo <zhaomingyuan.zmy@digital-engine.com>
Date:   Sun Sep 28 16:28:57 2025 +0800

    docs: Add OceanBase SQLAlchemy plugin to dialects documentation

    - Add OceanBase entry to External Dialects table
    - Add link to oceanbase-sqlalchemy plugin repository
    - References: https://github.com/oceanbase/ecology-plugins/tree/main/oceanbase-sqlalchemy-plugin

Change-Id: I6d99421e5e931d8306416e3afdb14e65e88f9be1
(cherry picked from commit 828ca9d243b3a3af26a4543b1a2ad8bc036f0758)

5 weeks agolock down format_docs_code.py to specific paths
Mike Bayer [Mon, 29 Sep 2025 13:08:52 +0000 (09:08 -0400)] 
lock down format_docs_code.py to specific paths

the script too quick to pick up on dot directories,
random .py files I have in my local checkout, etc.

Change-Id: I6eb66ddd3598495a420d9e4fc0f644b60fb3ec6d
(cherry picked from commit 9f16251b648af0532786e6c5f3951a2a9bc6732f)

5 weeks agosome tox readability improvements
Mike Bayer [Fri, 26 Sep 2025 18:03:37 +0000 (14:03 -0400)] 
some tox readability improvements

Change-Id: Iffc9a41b4a42330eb1e71704b0efdee94387af98
(cherry picked from commit 2e058575c237f33058da79433f6f1ce5f6739121)

6 weeks agoremove _py3k suffixes from test files
Mike Bayer [Sat, 20 Sep 2025 22:31:25 +0000 (18:31 -0400)] 
remove _py3k suffixes from test files

on the theme of 2.0/2.1 are relatively similar right now, do
some more cleanup removing the py3k suffixes that we dont need anymore.

I'm not sure that the logic that would search for these suffixes is
even present anymore and I would guess we removed it when we removed
py2k support.  However, I am planning on possibly bringing it back
for some of the py314 stuff, so I still want to be able to do
suffix stuff.  that will be for another patch.

Change-Id: I929e6edd922f8d5f943acce77191fb1e3035b42c
(cherry picked from commit fb3243475e208673d98c6a543cf16169f7f5f42d)

6 weeks agoUse ARRAY type for any_(), all_() coercion
Mike Bayer [Sat, 20 Sep 2025 18:08:55 +0000 (14:08 -0400)] 
Use ARRAY type for any_(), all_() coercion

Fixed issue where the :func:`_sql.any_` and :func:`_sql.all_` aggregation
operators would not correctly coerce the datatype of the compared value, in
those cases where the compared value were not a simple int/str etc., such
as a Python ``Enum`` or other custom value.   This would lead to execution
time errors for these values.  This issue is essentially the same as
:ticket:`6515` which was for the now-legacy :meth:`.ARRAY.any` and
:meth:`.ARRAY.all` methods.

Fixes: #12874
Change-Id: I980894c23b9974bc84d584a1a4c5fae72dded6d3
(cherry picked from commit aaa85f707e312bbf21b21926b0901aa14e3f3856)

6 weeks agorefactor test_sqlite into a package
Mike Bayer [Sat, 20 Sep 2025 15:27:12 +0000 (11:27 -0400)] 
refactor test_sqlite into a package

this is many years overdue, let's do it while 2.1/2.0 are in
sync and we are far away from 1.4 now

for the 2.0 cherry pick this was 99% a clean cherry pick;
adding only test_deprecated_serializer_args, removing
one cachekeysuite, and a 3.8 check for
test_determinsitic_parameter (yes it's misspelled)

Change-Id: Icf90f957e4d56382a4c91250f55bec4c7abc9d79
(cherry picked from commit 94e4d8dcd5fffa5415481227373c8ab6797ec495)

6 weeks agolimit STRICT to appropraite sqlite versions
Mike Bayer [Fri, 19 Sep 2025 20:35:44 +0000 (16:35 -0400)] 
limit STRICT to appropraite sqlite versions

Change-Id: Id7c302e9a182b0aa2cddd255d44afc3aa7bb77f4
(cherry picked from commit a04deb60ac28fa9e2555bb89ffdcd676514ef05d)

6 weeks agoAdd note regarding indexes with subscription of jsonb
Federico Caselli [Wed, 17 Sep 2025 17:12:39 +0000 (19:12 +0200)] 
Add note regarding indexes with subscription of jsonb

Fixes: #12868
Change-Id: I2a5a6a94a7a8f8796d898d4b7e69967a981c59e8
(cherry picked from commit 9156fadc3c9a50f309e720f987ec1be64725853b)

7 weeks agoclarify clauses argument for order_by, group_by
Mike Bayer [Fri, 19 Sep 2025 14:32:43 +0000 (10:32 -0400)] 
clarify clauses argument for order_by, group_by

Change-Id: Idabfde4a6850a2649a2f32dc42d0320f1ec7692d
(cherry picked from commit 38008698207dc3703f2565aa8b41f95596724272)

7 weeks agoFix get_columns sqlite reflection rejecting tables with WITHOUT_ROWID and/or STRICT...
Tip ten Brink [Mon, 15 Sep 2025 12:58:40 +0000 (08:58 -0400)] 
Fix get_columns sqlite reflection rejecting tables with WITHOUT_ROWID and/or STRICT for generated column case

Fixed issue where SQLite table reflection would fail for tables using
``WITHOUT ROWID`` and/or ``STRICT`` table options when the table contained
generated columns. The regular expression used to parse ``CREATE TABLE``
statements for generated column detection has been updated to properly
handle these SQLite table options that appear after the column definitions.
Pull request courtesy Tip ten Brink.

Fixes: #12864
Closes: #12865
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12865
Pull-request-sha: 833420afc72f1918a9ca315209ce6664a18ba07f

Change-Id: Ia25c05746055a66234531b4f1275bd3a2f3b44ad
(cherry picked from commit d526cedef3cd742259af51dac7a8b35e6be6c9f2)

7 weeks agoremove confusing "with_parent()" from query-enabled properties example
Mike Bayer [Sat, 13 Sep 2025 13:54:38 +0000 (09:54 -0400)] 
remove confusing "with_parent()" from query-enabled properties example

references: #12862
Change-Id: I22ee9fa0c566458a465867e307a77c2eb0ddcdd0
(cherry picked from commit 13f569fd615485c50e07f211e37e45d749ccc40d)

7 weeks agodo the mypy dance
Mike Bayer [Fri, 12 Sep 2025 23:01:31 +0000 (19:01 -0400)] 
do the mypy dance

version 1.18.1.  lots of i have no idea situations.
just add ignores, seems pretty pointless

Change-Id: Ieb1466df3f45fa6b8d11ccd36c7164645740ba35
(cherry picked from commit e7ff28e21e063b13cc6bfe4ca69e108bffc03c4b)

8 weeks agoAdd function mapped_as_dataclass
Mike Bayer [Tue, 9 Sep 2025 19:16:45 +0000 (15:16 -0400)] 
Add function mapped_as_dataclass

Added new decorator :func:`_orm.mapped_as_dataclass`, which is a function
based form of :meth:`_orm.registry.mapped_as_dataclass`; the method form
:meth:`_orm.registry.mapped_as_dataclass` does not seem to be correctly
recognized within the scope of :pep:`681` in recent mypy versions.

The new function is tested and mentioned in the docs, in 2.1 in a
subsequent patch (probably the one that adds unmapped_dataclass also)
we'll switch this new decorator to be the prominent one.

also alphabetize mapping_api.rst.  while the summary box at the top
auto-sorts, have the sidebar alpha also, it's kind of weird how
these were in no order at all

Fixes: #12855
Change-Id: If98724fd466004ec4c8a312a0cbf1c934a6ce9e3
(cherry picked from commit eab8bb4ad04e47fe16f370331bb262943c128b43)

2 months agodoc updates, localize test fixtures
Mike Bayer [Sun, 7 Sep 2025 00:20:00 +0000 (20:20 -0400)] 
doc updates, localize test fixtures

testing with types is inherently awkward and subject
to changes in python interpreters (such as all the recent python 3.14
stuff we had them fix), but in this suite we already have a lot of
types that are defined inline inside of test methods.   so since that's
how many of the tests work anyway, organize the big series of pep-695
and pep-593 structures into fixtures or individual tests to make
the whole suite easier to follow.   pyright complains quite a lot
about this, so if this becomes a bigger issue for say mypy /pep484
target, we may have to revisit (which I'd likely do with more ignores)
or if function/method-local type declarations with global becomes a runtime
issue in py3.15 or something, we can revisit then where we would in
theory need to convert the entire suite, which I'd do with a more
consistent naming style for everything.

but for now try to go with fixtures / local type declarations so that
we dont have to wonder where all these types are used.

For 2.0 this further repairs some merge mismatches between 2.1 and
2.0, with tests lining up more closely to where they were placed in
2.1.

Change-Id: Ibe8f447eaa10f5e927b1122c8b608f11a5f5bc97
(cherry picked from commit 8f7138326cf48a1394417aa492ad083b3400c529)

2 months agoMerge "liberalize pep695 matching" into rel_2_0
Michael Bayer [Sat, 6 Sep 2025 22:58:31 +0000 (22:58 +0000)] 
Merge "liberalize pep695 matching" into rel_2_0

2 months agoliberalize pep695 matching
Mike Bayer [Thu, 4 Sep 2025 01:44:33 +0000 (21:44 -0400)] 
liberalize pep695 matching

after many days of discussion we are moving to liberalize the
matching rules used for pep695 to the simple rule that we will resolve
a pep695 type to its immediate ``__value__`` without requiring that
it be present in the type map, however without any further recursive
checks (that is, we will not resolve ``__value__`` of ``__value__``).
This allows the vast majority of simple uses of pep695 types to not
require entries in the type map, including when the type points
to a simple Python type or any type that is present in the type_map.
Also supported is resolution of generic pep695 types against the
right side, including for Annotated types.

The change here in 2.1 will form the base for a revised approach
to the RegistryEvents patch for #9832, which will still provide
the RegistryEvents.resolve_type_annotation hook.   In 2.0, we need
to scale back the warnings that are emitted so portions of this patch
will also be backported including similar changes to the test suite.

Fixes: #12829
Change-Id: Ib6e379793335da3f33f6ca2cd6874a6eaf1e36f4
(cherry picked from commit f44a361d18c57167622c34c04c6e2e1b67b1c9f2)

2 months agointerpret NULL in PG enum array values
Mike Bayer [Fri, 5 Sep 2025 13:29:34 +0000 (09:29 -0400)] 
interpret NULL in PG enum array values

Fixed issue where selecting an enum array column containing NULL values
would fail to parse properly in the PostgreSQL dialect. The
:func:`._split_enum_values` function now correctly handles NULL entries by
converting them to Python ``None`` values.

Fixes: #12847
Change-Id: I39d10bc1be6b458da7e5d3f4b740f8faafd0adc5
(cherry picked from commit 9eb35c6664094a8e2b7ca1a0794f3cfd65cd46cf)

2 months agomove callcount tests to py313, 314
Mike Bayer [Tue, 2 Sep 2025 21:11:31 +0000 (17:11 -0400)] 
move callcount tests to py313, 314

Some other gerrits are making changes to callcounts
so modernize these first

Change-Id: If2125883e36146bfdae8b2e29c0db537985750ac
(cherry picked from commit 8abb5947b35850df5fb3eee847e3ef181058d849)

2 months agosupport omission of standard event listen example
Mike Bayer [Tue, 2 Sep 2025 15:10:51 +0000 (11:10 -0400)] 
support omission of standard event listen example

The required targets for before_configured() and after_configured()
are the Mapper (and soon to include registry things as well in 2.1),
update the automatic doc example thing to be able to be skipped
when there are special instructions for the target.

Also updates the event docs a bit, which were very old and
written in more of that "disorganized wall of details" style
that was very hard to unlearn

Change-Id: I729d08e25b721f4c993aa1856038b27643fc95d0
(cherry picked from commit 3544d89d2de0e910afc3648fe1d34c96900b101b)

2 months agoMerge "use fixture_session() fixture, remove "future" terminology" into rel_2_0
Michael Bayer [Wed, 27 Aug 2025 00:53:35 +0000 (00:53 +0000)] 
Merge "use fixture_session() fixture, remove "future" terminology" into rel_2_0

2 months agoMerge "use _generate_columns_plus_names for ddl returning c populate" into rel_2_0
Michael Bayer [Wed, 27 Aug 2025 00:15:04 +0000 (00:15 +0000)] 
Merge "use _generate_columns_plus_names for ddl returning c populate" into rel_2_0

2 months agouse fixture_session() fixture, remove "future" terminology
Mike Bayer [Tue, 26 Aug 2025 23:14:20 +0000 (19:14 -0400)] 
use fixture_session() fixture, remove "future" terminology

Tests here are sporadically failing on aiosqlite and it
seems the use of Session() rather than fixture_session() may be
causing connections to be cleaned up in GC, leading to table
exists race conditions.

Remove the concept of "future" since everything is "future" now

Change-Id: Ibf9ec8c47d3ab4ce95566811c9f6729ddd78a7d3
(cherry picked from commit b9758c6c7424a7854ea272c71ab380edea63ccee)

2 months agoMerge "Create terminate mixin" into rel_2_0
Michael Bayer [Tue, 26 Aug 2025 22:21:10 +0000 (22:21 +0000)] 
Merge "Create terminate mixin" into rel_2_0

2 months agouse _generate_columns_plus_names for ddl returning c populate
Mike Bayer [Tue, 26 Aug 2025 18:47:34 +0000 (14:47 -0400)] 
use _generate_columns_plus_names for ddl returning c populate

Improved the implementation of :meth:`.UpdateBase.returning` to use more
robust logic in setting up the ``.c`` collection of a derived statement
such as a CTE.  This fixes issues related to RETURNING clauses that feature
expressions based on returned columns with or without qualifying labels.

Co-authored-by: Juhyeong Ko <dury.ko@gmail.com>
Fixes: #12271
Change-Id: Id0d486d4304002f1affdec2e7662ac2965936f2a
(cherry picked from commit 4c4011b50bf8f2f6acca86b11ae3d900b30034a0)

2 months agoFix typing for `hybrid_property.__set__` to properly validate setter values
Micah Denbraver [Wed, 20 Aug 2025 20:58:02 +0000 (16:58 -0400)] 
Fix typing for `hybrid_property.__set__` to properly validate setter values

While iterating on some typing improvements, my colleague @seamuswn pointed out mypy wasn't catching when values with invalid types were set using a `hybrid_property` setter. I believe this is all that's needed to fix the typing.

### Description
Adjust `hybrid_property.__set__` to expect a value of the type that matches the generic's type variable.

### 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: #12814
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12814
Pull-request-sha: 8a17b26aea264acf70c52de324b8ccb92b469f2d

Change-Id: Ic99ccc68a32354ef6fe013ec17242058ad2d6d63
(cherry picked from commit 7a68e2aeffd43fc5b78df6182969e031e31043b9)

2 months agoCreate terminate mixin
Federico Caselli [Thu, 23 Jan 2025 21:42:14 +0000 (22:42 +0100)] 
Create terminate mixin

Generalize the terminate logic employed by the asyncpg dialect to reuse
it in the aiomysql and asyncmy dialect implementation.

Fixes: #12273
Change-Id: Iddb658b7118de774f169e31e888a8aae1c7c6ec2
(cherry picked from commit dddfa96736dd905be59c8601ae3e09c8bc52299c)

2 months agorestore functionality in list
Federico Caselli [Thu, 14 Aug 2025 22:05:07 +0000 (00:05 +0200)] 
restore functionality in list

Fixed issue caused by an unwanted functional change while typing
the :class:`.MutableList` class.
This change also reverts all other functional changes done in
the same change, commit ba0e508141206efc55cdab91df21c18e7dd63c80

Fixes: #12802
Change-Id: I007aa86aec881241ea42ce59d1b078cf8c6829bb
(cherry picked from commit a93d18357f7080b8e52f4e02983b6e50e33212ed)

2 months agoWe can't promise CursorResult from session.execute()
Mike Bayer [Mon, 18 Aug 2025 15:01:47 +0000 (11:01 -0400)] 
We can't promise CursorResult from session.execute()

Fixed typing bug where the :meth:`.Session.execute` method advertised that
it would return a :class:`.CursorResult` if given an insert/update/delete
statement.  This is not the general case as several flavors of ORM
insert/update do not actually yield a :class:`.CursorResult` which cannot
be differentiated at the typing overload level, so the method now yields
:class:`.Result` in all cases.  For those cases where
:class:`.CursorResult` is known to be returned and the ``.rowcount``
attribute is required, please use ``typing.cast()``.

Fixes: #12813
Change-Id: I8a7197100db312b3898c66ceddd6638e68c6bb44
(cherry picked from commit a7275f8e06575dd6edcf84f8083361961e499f92)

2 months agohttphost string
Mike Bayer [Sat, 16 Aug 2025 13:58:07 +0000 (09:58 -0400)] 
httphost string

Change-Id: I056c3c5e68b41060125d670de35c53fa550c36ca
(cherry picked from commit de89d598744edc9365279a682a95e198dfbf1f29)

2 months agouse ssh host
Mike Bayer [Sat, 16 Aug 2025 13:41:58 +0000 (09:41 -0400)] 
use ssh host

Change-Id: I7fafc3c8b48c042bf63c31ef697cfa6dad8bca97
(cherry picked from commit 3a972fbbd9505668d448f874babb44dce5d31a2a)

2 months agoclose aio cursors etc. that require await close
Mike Bayer [Tue, 12 Aug 2025 19:25:15 +0000 (15:25 -0400)] 
close aio cursors etc. that require await close

Improved the base implementation of the asyncio cursor such that it
includes the option for the underlying driver's cursor to be actively
closed in those cases where it requires ``await`` in order to complete the
close sequence, rather than relying on garbage collection to "close" it,
when a plain :class:`.Result` is returned that does not use ``await`` for
any of its methods.  The previous approach of relying on gc was fine for
MySQL and SQLite dialects but has caused problems with the aioodbc
implementation on top of SQL Server.   The new option is enabled
for those dialects which have an "awaitable" ``cursor.close()``, which
includes the aioodbc, aiomysql, and asyncmy dialects (aiosqlite is also
modified for 2.1 only).

Fixes: #12798
Change-Id: Ib17d611201fedf9780dfe3d760760ace99a8835c
(cherry picked from commit 5dbb5ec0e4ce71f7b806b87808a504083a7e8ffa)

2 months agoVersion 2.0.44 placeholder
Mike Bayer [Mon, 11 Aug 2025 14:25:16 +0000 (10:25 -0400)] 
Version 2.0.44 placeholder

2 months ago- 2.0.43 rel_2_0_43
Mike Bayer [Mon, 11 Aug 2025 14:20:06 +0000 (10:20 -0400)] 
- 2.0.43

2 months agomaintain alphabetical create_engine() param ordering
Mike Bayer [Mon, 11 Aug 2025 14:19:12 +0000 (10:19 -0400)] 
maintain alphabetical create_engine() param ordering

the name changed on this so it needs to be moved down

Change-Id: I119c3f5db9262c80b6dd2175e1e56073776607cf
(cherry picked from commit bcd6bba54bf62dcd6a9fc0b84e1630d4398b19ec)

2 months agodoc fixes
Mike Bayer [Mon, 11 Aug 2025 14:15:12 +0000 (10:15 -0400)] 
doc fixes

Change-Id: Iee65f09ea17bfa7a39fe3da05f22007f92b76f29
(cherry picked from commit b5172fcdb7050c9ac7f94a40fd2076bd21d6228f)

2 months agoFixes: #12711 Added sparse vector support in Oracle
suraj [Mon, 11 Aug 2025 12:21:46 +0000 (08:21 -0400)] 
Fixes: #12711 Added sparse vector support in Oracle
Extended :class:`_oracle.VECTOR` to support sparse vectors. This update
introduces :class:_oracle.VectorStorageType to specify sparse or dense
storage and added :class:`_oracle.SparseVector`. Pull request courtesy
Suraj Shaw.

Fixes: #12711
Closes: #12712
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12712
Pull-request-sha: 5a4199de1e89785129ee6fce4c7e65570419a1c7

Change-Id: Icdda9520a5f752e923f087edb166b4032f5bfd21
(cherry picked from commit d8e6654427b5d24474e4d1825208991e5fcb5b43)

3 months agoensure autocommit is not False for SQLite FK pragma
Mike Bayer [Thu, 7 Aug 2025 14:48:51 +0000 (10:48 -0400)] 
ensure autocommit is not False for SQLite FK pragma

References: #12767
References: https://github.com/python/cpython/issues/137205
Change-Id: I6772a4c9c216c6981421043f850cbf833ded2be3
(cherry picked from commit e96bf8608ed2862f538ac0873303c91ed3a7260c)