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

Change-Id: I9b779230c236884dc58f79c97e65bd6c983b252e

28 hours 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

29 hours 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

2 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

3 days agofix versionadded for aggregate_order_by
Federico Caselli [Sun, 2 Nov 2025 18:54:02 +0000 (19:54 +0100)] 
fix versionadded for aggregate_order_by

Change-Id: I499e0501a20c72cb20ea580b307d4233ba01d508

4 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

4 days agoMerge "fix sqlite regex for quoted fk, pk names" into main
Michael Bayer [Sat, 1 Nov 2025 04:20:38 +0000 (04:20 +0000)] 
Merge "fix sqlite regex for quoted fk, pk names" into main

4 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

5 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

7 days agouse binary for psycopg2 and psycopg
Mike Bayer [Wed, 29 Oct 2025 17:17:47 +0000 (13:17 -0400)] 
use binary for psycopg2 and psycopg

Change-Id: Ieea8a90ca2dabd7675d9ce09e93c0399dd409f54

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

7 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

7 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

7 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

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

Change-Id: I689a52c22efe8cff5ef80fe308673b2cb1fe7684

7 days agoMerge "try not to rely on GC working at all for tests" into main
Michael Bayer [Tue, 28 Oct 2025 22:32:34 +0000 (22:32 +0000)] 
Merge "try not to rely on GC working at all for tests" into main

7 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

7 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

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

8 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

8 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

8 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

9 days agomore cache_key coverage
Mike Bayer [Mon, 27 Oct 2025 16:18:56 +0000 (12:18 -0400)] 
more cache_key coverage

Change-Id: I68ed84c1617b4d15b0103cf4a3debd1da05c6c97

9 days agofix source list for coverage
Mike Bayer [Mon, 27 Oct 2025 15:59:54 +0000 (11:59 -0400)] 
fix source list for coverage

Change-Id: Ie995efd2e20bde2c687d33d757e7b3b2e8a719c0

9 days agoMerge "try to improve coverage a bit" into main
Michael Bayer [Mon, 27 Oct 2025 15:49:29 +0000 (15:49 +0000)] 
Merge "try to improve coverage a bit" into main

9 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

9 days agotry to improve coverage a bit
Mike Bayer [Mon, 27 Oct 2025 14:56:49 +0000 (10:56 -0400)] 
try to improve coverage a bit

use pyproject.toml so the options are safe from "rm .coverage*"
types of commands

omit some files

add test coverage for a big section of cache-key

Change-Id: Ia540c632d91ec09284e187e3edeb8ccf0214e1a6

10 days agorepair / modernize binary literal round trip test
Mike Bayer [Sun, 26 Oct 2025 13:30:54 +0000 (09:30 -0400)] 
repair / modernize binary literal round trip test

update this test to use modern literal round trip
now that execute_compiled is gone

Fixes: #12940
Change-Id: I587dc6845fa8ff078baf3f6e08e54ce6cec84630

10 days agoMerge "Support for Create Table As" into main
Michael Bayer [Sat, 25 Oct 2025 20:18:32 +0000 (20:18 +0000)] 
Merge "Support for Create Table As" into main

11 days agoSupport for Create Table As
Greg Jarzab [Tue, 23 Sep 2025 13:08:46 +0000 (09:08 -0400)] 
Support for Create Table As

Added support for the SQL ``CREATE TABLE ... AS SELECT`` construct via the
new :class:`_sql.CreateTableAs` DDL construct and the
:meth:`_sql.SelectBase.into` method. The new construct allows creating a
table directly from the results of a SELECT statement, with support for
options such as ``TEMPORARY`` and ``IF NOT EXISTS`` where supported by the
target database.  Pull request courtesy Greg Jarzab.

Fixes: #4950
Closes: #12860
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12860
Pull-request-sha: 7de8a109b892fd91222ce2f59c388ca275021ddb

Change-Id: Id9c8e4a3c520ffc61de1e48e331b6220e3d52fc9

11 days agotry to stop greenlet from building on a t machine
Mike Bayer [Fri, 24 Oct 2025 23:35:55 +0000 (19:35 -0400)] 
try to stop greenlet from building on a t machine

Change-Id: I21b4cbe056cf8d7265a5c15f793c6e4769f2c831

11 days agopostfix of I5f0fe800e31aac052926cebe9206763eef9a804c
Federico Caselli [Fri, 24 Oct 2025 21:54:48 +0000 (23:54 +0200)] 
postfix of I5f0fe800e31aac052926cebe9206763eef9a804c

Change-Id: Ic007a5bd842207a2c5a56374953e48c6acc7b254

11 days agoMerge "proposal: remove _execute_compiled()" into main
Michael Bayer [Fri, 24 Oct 2025 21:49:22 +0000 (21:49 +0000)] 
Merge "proposal: remove _execute_compiled()" into main

12 days agoMerge "improve sqlite reflection regex for unusual names/formats" into main
Michael Bayer [Fri, 24 Oct 2025 14:57:33 +0000 (14:57 +0000)] 
Merge "improve sqlite reflection regex for unusual names/formats" into main

12 days 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

13 days agoproposal: remove _execute_compiled()
Mike Bayer [Tue, 5 Mar 2024 21:28:51 +0000 (16:28 -0500)] 
proposal: remove _execute_compiled()

this isn't used internally and only allows execute(stmt.compile())
to work, which is not something I want to support.

Since people are definitely using this [1] we might want to think about
either deprectation or having a recipe for people who really want
to still do this

[1] https://github.com/sqlalchemy/sqlalchemy/discussions/11108?converting=1

Change-Id: I5f0fe800e31aac052926cebe9206763eef9a804c

2 weeks agoensure explicit left side considered for ON clause in join_from
Mike Bayer [Tue, 21 Oct 2025 12:48:12 +0000 (08:48 -0400)] 
ensure explicit left side considered for ON clause in join_from

Fixed an issue in :meth:`_sql.Select.join_from` where the join condition
between the left and right tables specified in the method call could be
incorrectly determined based on an intermediate table already present in
the FROM clause, rather than matching the foreign keys between the
immediate left and right arguments. The join condition is now determined by
matching primary keys between the two tables explicitly passed to
:meth:`_sql.Select.join_from`, ensuring consistent and predictable join
behavior regardless of the order of join operations or other tables present
in the query.  The fix is applied to both the Core and ORM implementations
of :meth:`_sql.Select.join_from`.

Fixes: #12931
Change-Id: Id457d441ee8a1bd64a002e57a9dcfd6fc56ff15e

2 weeks agoturn on plain 3.14 for GH actions
Mike Bayer [Mon, 20 Oct 2025 21:04:30 +0000 (17:04 -0400)] 
turn on plain 3.14 for GH actions

which we are assuming is released by now

there should also be 3.14t plain

Change-Id: I045984fa30531818cf51cac96aefd6db411a040a

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.

2 weeks agoMerge "refactor common reporting options a bit" into main
Michael Bayer [Mon, 20 Oct 2025 16:26:34 +0000 (16:26 +0000)] 
Merge "refactor common reporting options a bit" into main

2 weeks agoadd noxfile.py to MANIFEST
Mike Bayer [Mon, 20 Oct 2025 16:25:47 +0000 (12:25 -0400)] 
add noxfile.py to MANIFEST

this is still how we get the files to include in a build
so it has to be there

Change-Id: Ie43ed43a7f9c4c5d3d85c76a1fcf2a4737d6dbc4

2 weeks agorefactor common reporting options a bit
Mike Bayer [Sun, 19 Oct 2025 19:08:20 +0000 (15:08 -0400)] 
refactor common reporting options a bit

Change-Id: I4a7316867ceacabc4e641017c9f19e40fababdbe

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

2 weeks agoChange typing tests to use `assert_type` instead of `reveal_type`
Rebecca Chen [Sat, 18 Oct 2025 14:20:55 +0000 (10:20 -0400)] 
Change typing tests to use `assert_type` instead of `reveal_type`

Closes: #12922
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12922
Pull-request-sha: 580f6638168c33e6c50e95066312ac605433665f

Change-Id: I9f3bdb4c105971f53fa10ed8a934356203ddb080

2 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

2 weeks agodelete previous coverage file
Mike Bayer [Thu, 16 Oct 2025 00:55:07 +0000 (20:55 -0400)] 
delete previous coverage file

Change-Id: Id051257a2012bc0b40bbf0a89b80f540c9a1e5a1

2 weeks agore-add .coveragerc with relative paths
Mike Bayer [Thu, 16 Oct 2025 00:14:00 +0000 (20:14 -0400)] 
re-add .coveragerc with relative paths

Change-Id: I9023c392b98333e5235995cf8899b31e89f54096

2 weeks agosave coverage database files
Mike Bayer [Wed, 15 Oct 2025 23:12:16 +0000 (19:12 -0400)] 
save coverage database files

Change-Id: Ie0260e2e96978f0c6a2824f3fb2199988091bb23

2 weeks agocreate differently named coverage files
Mike Bayer [Wed, 15 Oct 2025 22:35:50 +0000 (18:35 -0400)] 
create differently named coverage files

Change-Id: Idcdc0084037bc729151c2bbbf87c8f94c393cf79

2 weeks agowrite db_idents file. check for it, delete it too
Mike Bayer [Wed, 15 Oct 2025 22:17:59 +0000 (18:17 -0400)] 
write db_idents file.  check for it, delete it too

Change-Id: I75fee60d69ebc51d66a688f292c374db5f4753f3

2 weeks agoqualify junit files on cext, greenlet as well
Mike Bayer [Wed, 15 Oct 2025 21:06:18 +0000 (17:06 -0400)] 
qualify junit files on cext, greenlet as well

for coverage we run different combinations of these in one nox
run with multiple tags

Change-Id: Ibe4861f5f34c7c984c38ca27a21e009eb6e0295f

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

2 weeks agofixes for 3.14t on github actions
Mike Bayer [Wed, 15 Oct 2025 20:52:21 +0000 (16:52 -0400)] 
fixes for 3.14t on github actions

Change-Id: Ibc99e3dfdfd2a516c336090570df64875d97b653

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.

3 weeks agofix quotes
Mike Bayer [Wed, 15 Oct 2025 19:29:02 +0000 (15:29 -0400)] 
fix quotes

Change-Id: I9a56ce0fefc6be9cda0cdfeec2302ef30514aa0a

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

3 weeks agouse nox
Mike Bayer [Mon, 29 Sep 2025 03:44:41 +0000 (23:44 -0400)] 
use nox

The top-level test runner has been changed to use ``nox``, adding a
``noxfile.py`` as well as some included modules.   The ``tox.ini`` file
remains in place so that ``tox`` runs will continue to function in the near
term, however it will be eventually removed and improvements and
maintenance going forward will be only towards ``noxfile.py``.

Change-Id: I66639991e1dc3db582e2ff13f9348a7d6241916e

3 weeks agoMerge "Support VIRTUAL computed columns on PostgreSQL." into main
Michael Bayer [Tue, 14 Oct 2025 23:07:05 +0000 (23:07 +0000)] 
Merge "Support VIRTUAL computed columns on PostgreSQL." into main

3 weeks agoMerge "Support warnings in exclusions" into main
Michael Bayer [Tue, 14 Oct 2025 23:06:57 +0000 (23:06 +0000)] 
Merge "Support warnings in exclusions" into main

3 weeks agoSupport VIRTUAL computed columns on PostgreSQL.
Federico Caselli [Mon, 6 Oct 2025 19:39:10 +0000 (21:39 +0200)] 
Support VIRTUAL computed columns on PostgreSQL.

Support for ``VIRTUAL`` computed columns on PostgreSQL 18 and later has
been added. The default behavior when :paramref:`.Computed.persisted` is
not specified has been changed to align with PostgreSQL 18's default of
``VIRTUAL``. When :paramref:`.Computed.persisted` is not specified, no
keyword is rendered on PostgreSQL 18 and later; on older versions a
warning is emitted and ``STORED`` is used as the default. To explicitly
request ``STORED`` behavior on all PostgreSQL versions, specify
``persisted=True``.

Fixes: #12866
Change-Id: Ic2ebdbe79e230a88370cf2b3503d2d1815f72a39

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

3 weeks agopostgresql dialect table options
Federico Caselli [Wed, 18 Jun 2025 20:22:59 +0000 (16:22 -0400)] 
postgresql dialect table options

Support for storage parameters in ``CREATE TABLE`` using the ``WITH``
clause has been added. The ``postgresql_with`` dialect option of
:class:`_schema.Table` accepts a mapping of key/value options.

The PostgreSQL dialect now support reflection of table options, including
the storage parameters, table access method and table spaces. These options
are automatically reflected when autoloading a table, and are also
available via the :meth:`_engine.Inspector.get_table_options` and
:meth:`_engine.Inspector.get_multi_table_optionsmethod` methods.

Fixes: #10909
Closes: #12584
Closes: #12684
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12584
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12684
Pull-request-sha: a660459de9adcedb2d12eac72450747c04792bcd

Change-Id: I33e3d8b8eb0c02530933cb124e3d375ca4af7db2

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 agoMerge "Improve postgresql reflection" into main
Michael Bayer [Tue, 14 Oct 2025 15:03:03 +0000 (15:03 +0000)] 
Merge "Improve postgresql reflection" into main

3 weeks agoMerge "Reflect collation in types on PostgreSQL" into main
Michael Bayer [Tue, 14 Oct 2025 15:02:39 +0000 (15:02 +0000)] 
Merge "Reflect collation in types on PostgreSQL" into main

3 weeks agoImprove postgresql reflection
Federico Caselli [Fri, 10 Oct 2025 22:31:00 +0000 (00:31 +0200)] 
Improve postgresql reflection

Some improvements to the reflection of PostgreSQL to avoid
unnecessary queries when not needed.

Fixes: #12908
Change-Id: Ic3da50ee43670f26d3159f5ec9a235a9a1963b8a

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

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

Change-Id: I7d445cd98db7edefe705ee4eb2cd24cad72040f3

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

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

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

3 weeks agocherry-pick changelog update for 2.0.45
Mike Bayer [Fri, 10 Oct 2025 14:39:33 +0000 (10:39 -0400)] 
cherry-pick changelog update for 2.0.45

3 weeks agocherry-pick changelog from 2.0.44
Mike Bayer [Fri, 10 Oct 2025 14:39:32 +0000 (10:39 -0400)] 
cherry-pick changelog from 2.0.44

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

Change-Id: I2d72ee3d8640c45efb6e6feb0f97df8d38d2236a

3 weeks agorestore main zzzeeksphinx new design is merged
Mike Bayer [Fri, 10 Oct 2025 13:54:27 +0000 (09:54 -0400)] 
restore main zzzeeksphinx new design is merged

Change-Id: Ifea8c4ec31332d01dda64514471c5ab5af43049e

3 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

3 weeks agotry out css_tweaks branch for zzzeeksphinx
Mike Bayer [Fri, 10 Oct 2025 04:58:08 +0000 (00:58 -0400)] 
try out css_tweaks branch for zzzeeksphinx

Change-Id: Ife130a0a3bda89704886f885b23696563fc149cc

3 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

3 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

3 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

3 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

3 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

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

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

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

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

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

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

4 weeks agoupdate oracle profiles
Federico Caselli [Tue, 7 Oct 2025 19:49:51 +0000 (21:49 +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

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

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

additionally put all setup/installation under the "platform"
header for now

Change-Id: I9b4113d865938c164f119b6aef8648fd75ca6d5f

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

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

4 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

5 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

### 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
- [ ] 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

5 weeks agoMerge "deprecate inherit_schema argument" into main
Federico Caselli [Wed, 1 Oct 2025 19:21:09 +0000 (19:21 +0000)] 
Merge "deprecate inherit_schema argument" into main

5 weeks agoMerge "fix: pass dialect-specific kwargs to MetaData.reflect" into main
Michael Bayer [Tue, 30 Sep 2025 19:46:42 +0000 (19:46 +0000)] 
Merge "fix: pass dialect-specific kwargs to MetaData.reflect" into main

5 weeks agoMerge "skip windows/macosx for GC sensitive tests" into main
Michael Bayer [Tue, 30 Sep 2025 17:29:16 +0000 (17:29 +0000)] 
Merge "skip windows/macosx for GC sensitive tests" into main

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