]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
3 weeks agoFixes: #12853 Move tests from pg dialect
Reuven Starodubski [Wed, 10 Sep 2025 06:19:47 +0000 (09:19 +0300)] 
Fixes: #12853 Move tests from pg dialect
3 weeks agoFixes: #12853 Move aggregate_order_by to core functionality
Reuven Starodubski [Wed, 10 Sep 2025 06:19:25 +0000 (09:19 +0300)] 
Fixes: #12853 Move aggregate_order_by to core functionality
preserve it in postgresql for backward compatibility

4 weeks 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)

4 weeks 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

4 weeks 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)

4 weeks 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)

4 weeks 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)

4 weeks 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)

5 weeks 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

5 weeks 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

5 weeks 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)

5 weeks 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

5 weeks 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)

6 weeks 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)

6 weeks 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)

6 weeks 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)

6 weeks 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)

7 weeks 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)

7 weeks 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)

7 weeks 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)

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

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

8 weeks 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)

8 weeks 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)

8 weeks 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)

8 weeks 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)

8 weeks agoMerge "implement skip_autocommit_rollback" into rel_2_0
Michael Bayer [Thu, 7 Aug 2025 14:46:11 +0000 (14:46 +0000)] 
Merge "implement skip_autocommit_rollback" into rel_2_0

2 months agoimplement skip_autocommit_rollback
Mike Bayer [Tue, 5 Aug 2025 14:46:21 +0000 (10:46 -0400)] 
implement skip_autocommit_rollback

Added new parameter :paramref:`.create_engine.skip_autocommit_rollback`
which provides for a per-dialect feature of preventing the DBAPI
``.rollback()`` from being called under any circumstances, if the
connection is detected as being in "autocommit" mode.   This improves upon
a critical performance issue identified in MySQL dialects where the network
overhead of the ``.rollback()`` call remains prohibitive even if autocommit
mode is set.

Fixes: #12784
Change-Id: I22b45ab2fc396c5aadeff5cdc5ce895144d00098
(cherry picked from commit 99da878a25fd5105f17893f16617e7413e32a3e8)

2 months agoadd chunking to selectin_polymorphic
Mike Bayer [Wed, 6 Aug 2025 14:19:39 +0000 (10:19 -0400)] 
add chunking to selectin_polymorphic

Improved the implementation of the :func:`_orm.selectin_polymorphic`
inheritance loader strategy to properly render the IN expressions using
chunks of 500 records each, in the same manner as that of the
:func:`_orm.selectinload` relationship loader strategy.  Previously, the IN
expression would be arbitrarily large, leading to failures on databases
that have limits on the size of IN expressions including Oracle Database.

Fixes: #12790
Change-Id: I8df7f34d4fdf73996780772d983b72ea0fc8309e
(cherry picked from commit 9d6fa58d6996ac4cff1ac215ef389f4cb4b9ca3d)

2 months agoMerge "Fix use_existing_column with Annotated mapped_column in polymorphic inheritanc...
Michael Bayer [Wed, 6 Aug 2025 14:39:36 +0000 (14:39 +0000)] 
Merge "Fix use_existing_column with Annotated mapped_column in polymorphic inheritance" into rel_2_0

2 months agoapply correct pre-fetch params to post updated rows
Mike Bayer [Tue, 5 Aug 2025 21:11:50 +0000 (17:11 -0400)] 
apply correct pre-fetch params to post updated rows

Fixed issue where using the ``post_update`` feature would apply incorrect
"pre-fetched" values to the ORM objects after a multi-row UPDATE process
completed.  These "pre-fetched" values would come from any column that had
an :paramref:`.Column.onupdate` callable or a version id generator used by
:paramref:`.orm.Mapper.version_id_generator`; for a version id generator
that delivered random identifiers like timestamps or UUIDs, this incorrect
data would lead to a DELETE statement against those same rows to fail in
the next step.

Fixes: #12748
Change-Id: Id12c7973f168604533762dfc01afbb9155b693a6
(cherry picked from commit f4d9c107554288318003437103a3ac3e2d0bbb51)

2 months agoFix use_existing_column with Annotated mapped_column in polymorphic inheritance
Mike Bayer [Tue, 5 Aug 2025 18:05:49 +0000 (14:05 -0400)] 
Fix use_existing_column with Annotated mapped_column in polymorphic inheritance

Fixed issue where :paramref:`_orm.mapped_column.use_existing_column`
parameter in :func:`_orm.mapped_column` would not work when the
:func:`_orm.mapped_column` is used inside of an ``Annotated`` type alias in
polymorphic inheritance scenarios. The parameter is now properly recognized
and processed during declarative mapping configuration.

Fixes: #12787
Change-Id: I0505df3f3714434e98052c4488f6b1b1d2b1f755
(cherry picked from commit 14a18d4591818bfa5081c4286881cbd017dc186b)

2 months agoFix PostgreSQL JSONB subscripting regression with functions
Mike Bayer [Fri, 1 Aug 2025 16:48:15 +0000 (12:48 -0400)] 
Fix PostgreSQL JSONB subscripting regression with functions

Fixed regression in PostgreSQL dialect where JSONB subscription syntax
would generate incorrect SQL for JSONB-returning functions, causing syntax
errors. The dialect now properly wraps function calls and expressions in
parentheses when using the ``[]`` subscription syntax, generating
``(function_call)[index]`` instead of ``function_call[index]`` to comply
with PostgreSQL syntax requirements.

Fixes: #12778
Change-Id: If1238457e6bba6a933023b26519a41aa5de4dbcd
(cherry picked from commit d37d56c1ad04a8fb99ff8ed70973197907abf631)

2 months agoupdate install faq to align with code
Federico Caselli [Wed, 30 Jul 2025 20:41:21 +0000 (22:41 +0200)] 
update install faq to align with code

Change-Id: Id032859c02803cd561bff00b4eb773eff933abbc
References: #12757

2 months agoRemove unnecessary r-prefix from docstring in 'columns' method (#12768)
Sviatoslav Bobryshev [Tue, 29 Jul 2025 20:08:15 +0000 (23:08 +0300)] 
Remove unnecessary r-prefix from docstring in 'columns' method (#12768)

(cherry picked from commit 52e80cd05d4b94a4b88d85316127f7ea71220152)

2 months agoVersion 2.0.43 placeholder
Mike Bayer [Tue, 29 Jul 2025 12:48:27 +0000 (08:48 -0400)] 
Version 2.0.43 placeholder

2 months ago- 2.0.42 rel_2_0_42
Mike Bayer [Tue, 29 Jul 2025 11:36:14 +0000 (07:36 -0400)] 
- 2.0.42

2 months agorepair changelog file
Mike Bayer [Tue, 29 Jul 2025 11:34:56 +0000 (07:34 -0400)] 
repair changelog file

Change-Id: I40994de5197271060e97a0bd7bccafc7c08918d8
(cherry picked from commit d02a9f923061d627658c3c81cabafc872396b113)

2 months agoMerge "Add ``dataclass_metadata`` parameter to orm cols" into rel_2_0
Michael Bayer [Tue, 29 Jul 2025 11:25:19 +0000 (11:25 +0000)] 
Merge "Add ``dataclass_metadata`` parameter to orm cols" into rel_2_0

2 months agoFix reflection of enum named intervalsomething
Federico Caselli [Mon, 21 Jul 2025 21:36:43 +0000 (23:36 +0200)] 
Fix reflection of enum named intervalsomething

Fixes bug that would mistakenly interpret a domain or enum type
with name starting in ``interval`` as an ``INTERVAL`` type while
reflecting a table.

Fixes: #12744
Change-Id: I89ab287c3847ca545691afe73f26d86bf2337ae0
(cherry picked from commit 0620f7d35251befc72247370820e1ac9a931440e)

2 months agoMerge "Add orderinglist type annotations" into rel_2_0
Federico Caselli [Mon, 28 Jul 2025 12:29:33 +0000 (12:29 +0000)] 
Merge "Add orderinglist type annotations" into rel_2_0

2 months agoMerge "type aiosqlite" into rel_2_0
Federico Caselli [Mon, 28 Jul 2025 12:05:15 +0000 (12:05 +0000)] 
Merge "type aiosqlite" into rel_2_0

2 months agoAdd orderinglist type annotations
Martijn Pieters [Mon, 25 Nov 2024 19:38:48 +0000 (14:38 -0500)] 
Add orderinglist type annotations

Closes: #10889
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10889
Pull-request-sha: 2ddeeb190630a8965a4fae567e2649ed16722c99

Change-Id: I9a0d6e2776d8b6756af4a3c54668bdcd1a1f40f8
(cherry picked from commit 70c918a9be714d46f59c333f8b791cb7864f9531)

2 months agoFix rendering of a SQL example in indexable examples (#12751)
Denis Laxalde [Sat, 26 Jul 2025 16:02:46 +0000 (18:02 +0200)] 
Fix rendering of a SQL example in indexable examples (#12751)

(cherry picked from commit fc2debe97ed74a497fea0c8b1c56ef212e8a4968)

2 months agotyping: improve type coverage in sql.base
KapilDagur [Mon, 14 Jul 2025 19:36:30 +0000 (15:36 -0400)] 
typing: improve type coverage in sql.base

improve type coverage in `sqlalchemy.sql.base`

References: #6810
Closes: #12707
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12707
Pull-request-sha: 7374212dfc88a43f381f8380d9b4ac193f5ed10b

Change-Id: Ied0676f420bc27ae033f0a5e6e22d806d20f4404
(cherry picked from commit ab3de7b0800a17927e09de6d570b906303897c58)

2 months agoAdd ``dataclass_metadata`` parameter to orm cols
Sigmund Lahn [Thu, 3 Jul 2025 16:14:13 +0000 (12:14 -0400)] 
Add ``dataclass_metadata`` parameter to orm cols

Added ``dataclass_metadata`` argument to a all column functions
used in the ORM that accept dataclasses parameters.
It's passed to the underlying dataclass ``metadata`` attribute
of the dataclass field.
Pull request courtesy Sigmund Lahn.

Fixes: #10674
Closes: #12619
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12619
Pull-request-sha: 9ea6a95b2bc6816e5b69d6d559783a6009877838

Change-Id: I4551c24b85cebee4064df6ab752d0700f0f191f1
(cherry picked from commit aeb7830d22cdb4ac387242d46833cb2f67e0a952)

2 months agoexpand out type map example to include the common MySQL case
Mike Bayer [Fri, 18 Jul 2025 16:35:27 +0000 (12:35 -0400)] 
expand out type map example to include the common MySQL case

References: #12742
Change-Id: I9d56597f12141bc8a63665b3cedb5c662a4f5c9d
(cherry picked from commit 632d8e47277015d3aee06b944aa183fbc23103af)

2 months agoUpdated index.rst in dialects docs to include Amazon Aurora DSQL (#12737)
Victor Tsang [Thu, 17 Jul 2025 19:02:44 +0000 (12:02 -0700)] 
Updated index.rst in dialects docs to include Amazon Aurora DSQL (#12737)

Co-authored-by: Victor Tsang <vitsangp@amazon.com>
(cherry picked from commit c145158821f05a0dac501f926aa596f0d247bb12)

2 months agoadd recursive test to values cte
Federico Caselli [Tue, 15 Jul 2025 20:50:32 +0000 (22:50 +0200)] 
add recursive test to values cte

Change-Id: I544aab7f9f5d2640fc6c3d970d835a6e3f80d746
(cherry picked from commit 320c3b5b043931187d266f5c92b3fe366f650e5a)

2 months agoremove py 3.9, 3.8 from mypy job
Mike Bayer [Tue, 15 Jul 2025 20:11:43 +0000 (16:11 -0400)] 
remove py 3.9, 3.8 from mypy job

both were already removed for pep484.  3.9 is EOL in two months
and latest mypy 1.17 changes are now failing, so just remove

Change-Id: I75d9bf06095da13621e2e3470486e44c9da50176

2 months agoextend Values from HasCTE
Mike Bayer [Mon, 14 Jul 2025 20:13:03 +0000 (16:13 -0400)] 
extend Values from HasCTE

The :func:`_sql.values` construct gains a new method :meth:`_sql.Values.cte`,
which allows creation of a named, explicit-columns :class:`.CTE` against an
unnamed ``VALUES`` expression, producing a syntax that allows column-oriented
selection from a ``VALUES`` construct on modern versions of PostgreSQL, SQLite,
and MariaDB.

Fixes: #12734
Change-Id: I4a0146418420cce3cbbda4e50f5eb32206dc696b
(cherry picked from commit 209d1913cc702665252f3d2bc1b38ce3a0b9e3eb)

2 months agoupdate for mypy 17
Mike Bayer [Mon, 14 Jul 2025 22:08:51 +0000 (18:08 -0400)] 
update for mypy 17

note for the 2.0 backport I also updated tox.ini to use mypy 1.17
for the "mypy" suite, 2.1 had this but 2.0 was pinned so some old
mypy version.

Change-Id: I25708115b44bf46d22a2a81fe010db875a8bcb22
(cherry picked from commit b319787b413794ad8c6d70135a286e664be292f8)

2 months agosupport JSONB subscripting syntax
Mike Bayer [Fri, 11 Jul 2025 16:51:44 +0000 (12:51 -0400)] 
support JSONB subscripting syntax

Added support for PostgreSQL 14+ JSONB subscripting syntax. When connected
to PostgreSQL 14 or later, JSONB columns now automatically use the native
subscript notation ``jsonb_col['key']`` instead of the arrow operator
``jsonb_col -> 'key'`` for both read and write operations. This provides
better compatibility with PostgreSQL's native JSONB subscripting feature
while maintaining backward compatibility with older PostgreSQL versions.
JSON columns continue to use the traditional arrow syntax regardless of
PostgreSQL version.

Fixes: #10927
Change-Id: I4b3a8a55a71f2ca3d95416a7b350b785574631eb
(cherry picked from commit 2ac0c459669d0200a4d15162ffc0a8765c60cb07)

2 months agoblock mariadb-connector 1.1.13 and above (tox only)
Mike Bayer [Sat, 12 Jul 2025 15:34:35 +0000 (11:34 -0400)] 
block mariadb-connector 1.1.13 and above (tox only)

New segfault occurs under failure modes [1]

[1] https://jira.mariadb.org/browse/CONPY-318

Change-Id: I85dee53be0cb4644c9e500fbb15f7cb35051ff4b
(cherry picked from commit 66d894f2651d781844c4c3cd92fbdcaf4c3aac15)

2 months agodocs: Clarify Mapped accepts equivalents to Optional (#12622)
Matthew Martin [Sat, 12 Jul 2025 10:34:22 +0000 (05:34 -0500)] 
docs: Clarify Mapped accepts equivalents to Optional (#12622)

Co-authored-by: Matthew Martin <mmartin@booliproject.com>
(cherry picked from commit 606a979719a6e180006d881a13e53e9e3abf2e69)

2 months agoRe-raise ``CancelledError`` in asyncpg
Federico Caselli [Thu, 10 Jul 2025 22:21:54 +0000 (00:21 +0200)] 
Re-raise ``CancelledError`` in asyncpg

Re-raise catched ``CancelledError`` in the terminate method of the
asyncpg dialect to avoid possible hangs of the code execution.

Fixes: #12728
Change-Id: Ia9a353ac7504592be00355001ef40b13ab51375c
(cherry picked from commit 36da2eaf3e23269f2cf28420ae73674beafd0661)

2 months agoMake __aiter__ in AsyncTupleReulst a sync function. (#12726)
Evgeny Petrov [Thu, 10 Jul 2025 20:10:08 +0000 (21:10 +0100)] 
Make __aiter__ in AsyncTupleReulst a sync function. (#12726)

As it should be accotring to PEP 525

(cherry picked from commit 46c507fb31e6d44c255083d05103235c1d70bd58)

2 months agoFix the code examples and the grammatic in `declarative_tables.rst` (#12721)
Roman Mashevskyi [Mon, 7 Jul 2025 20:23:43 +0000 (23:23 +0300)] 
Fix the code examples and the grammatic in `declarative_tables.rst` (#12721)

* Fix the code example in `declarative_tables.rst`

Add an import of a `Optional` class from the `typing` library in the
code example of the "Union types inside the Type Map" chapter.

* Fix the code example in `declarative_tables.rst`

Replace the import of the `deferred` function to `column_property` from
the `sqlalchemy.orm` package in first code example of the "Applying
Load, Persistence and Mapping Options for Imperative Table Columns"
chapter.

* Fix the grammatic in `declarative_tables.rst`

Remove the unnecessary article in the second paragraph of the
"Mapping to an Explicit Set of Primary Key Columns" chapter in
`declarative_tables.rst`.

(cherry picked from commit 75163df8ef4896589d00b682813f01e1a436afcb)

3 months agochore: Fix typo in autoflush warning (#12713)
Sillocan [Wed, 2 Jul 2025 21:20:47 +0000 (14:20 -0700)] 
chore: Fix typo in autoflush warning (#12713)

(cherry picked from commit 7376cdf43eef4b038891a5902a7e0692b4bd8185)

3 months agonote that SQL parenthesis are based on precedence
Mike Bayer [Wed, 2 Jul 2025 13:18:28 +0000 (09:18 -0400)] 
note that SQL parenthesis are based on precedence

References: #12708
Change-Id: I2401e92c936eb01a64ad6896a86faec1c205bc08
(cherry picked from commit 5b5db1f5f35d9eca6f66db73c05a8ce8302d3a4c)

3 months agoMerge "Update association examples to Declarative API" into rel_2_0
Michael Bayer [Mon, 30 Jun 2025 14:35:15 +0000 (14:35 +0000)] 
Merge "Update association examples to Declarative API" into rel_2_0

3 months agotype aiosqlite
Pablo Estevez [Thu, 26 Jun 2025 19:21:55 +0000 (15:21 -0400)] 
type aiosqlite

Closes: #12656
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12656
Pull-request-sha: 396e9cfaaccbc56537b967e62decbbb3eb0e036a

Change-Id: I598ee6022616f265824291544750e571eaba413c
(cherry picked from commit 944df50e92bd077b81775b080bfd9347f3baabdc)

3 months agoremove support for list of tuples in the normal execute
Federico Caselli [Thu, 5 Jun 2025 18:09:32 +0000 (20:09 +0200)] 
remove support for list of tuples in the normal execute

The function that validates the arguments in the normal execute flow
allowed by mistake list of tuples, that are not supported by the
code since the 2.0 series.

Change-Id: Ia401b0e19e72ed33b7d3d5718578cbed0d214c2a
(cherry picked from commit 7a96d2792dd7a65b8cc3a8af72d423c2c382b11d)

3 months agoUpdate association examples to Declarative API
Mike Fiedler [Thu, 26 Jun 2025 19:04:03 +0000 (15:04 -0400)] 
Update association examples to Declarative API

### Description

Follows initial attempt in #10450 - but starts with simpler association examples.

### Checklist
This pull request is:

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

I was curious how to add these selectively to any of the type hint test suites, to prevent future drift, but didn't see anything too obvious.

Closes: #12031
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12031
Pull-request-sha: dad6239370f23d52b4c0a1b21eba5752e216207e

Change-Id: Id5c2d65137c5e9d7e87778acd51b965c2bcf315a
(cherry picked from commit 904541a55ca3193171b48e57dd6b1b4fa31b0669)

3 months agoMerge "Deprecate the declarative_mixin decorator" into rel_2_0
Michael Bayer [Thu, 26 Jun 2025 15:22:40 +0000 (15:22 +0000)] 
Merge "Deprecate the declarative_mixin decorator" into rel_2_0

3 months agoMerge "add example to update from that uses values" into rel_2_0
Michael Bayer [Tue, 24 Jun 2025 22:28:30 +0000 (22:28 +0000)] 
Merge "add example to update from that uses values" into rel_2_0

3 months agouse zzzeeksphinx 1.6.1 and we arent' really using this doc mod
Mike Bayer [Tue, 24 Jun 2025 22:26:44 +0000 (18:26 -0400)] 
use zzzeeksphinx 1.6.1 and we arent' really using this doc mod

Change-Id: Ib53111444598331290bde1788f5f2617562d250c
(cherry picked from commit 5394c75bcac270905a58a0fb7cd5f0d6643f78fd)

3 months agoadd example to update from that uses values
Federico Caselli [Tue, 10 Jun 2025 21:42:35 +0000 (23:42 +0200)] 
add example to update from that uses values

Change-Id: Ic02a722be9a30851a87e0da4759c728e86fb22c8
References: #11768
(cherry picked from commit fb5e64c51ab91edf9ab0936aa540195746f9155b)

3 months agoMerge "try flake8-import-order 0.19.2" into rel_2_0
Michael Bayer [Tue, 24 Jun 2025 20:52:18 +0000 (20:52 +0000)] 
Merge "try flake8-import-order 0.19.2" into rel_2_0

3 months agotry flake8-import-order 0.19.2
Mike Bayer [Tue, 24 Jun 2025 17:57:17 +0000 (13:57 -0400)] 
try flake8-import-order 0.19.2

the big new thang is that it is doing import order checks inside of
TYPE_CHECKING blocks.   Introduces some new codes that we
enthusiastically add to our ignore list.   update to the latest
and greatest zimports 0.6.2 as well

Change-Id: I4e844408a8b218f9b92c43ad5e2a5c16781100be
(cherry picked from commit 1c8343576188940268de467b2537e5f838464690)

3 months agohardening against inappropriate multi-table updates
Mike Bayer [Mon, 23 Jun 2025 13:21:59 +0000 (09:21 -0400)] 
hardening against inappropriate multi-table updates

Hardening of the compiler's actions for UPDATE statements that access
multiple tables to report more specifically when tables or aliases are
referenced in the SET clause; on cases where the backend does not support
secondary tables in the SET clause, an explicit error is raised, and on the
MySQL or similar backends that support such a SET clause, more specific
checking for not-properly-included tables is performed.  Overall the change
is preventing these erroneous forms of UPDATE statements from being
compiled, whereas previously it was relied on the database to raise an
error, which was not always guaranteed to happen, or to be non-ambiguous,
due to cases where the parent table included the same column name as the
secondary table column being updated.

Fixed bug where the ORM would pull in the wrong column into an UPDATE when
a key name inside of the :meth:`.ValuesBase.values` method could be located
from an ORM entity mentioned in the statement, but where that ORM entity
was not the actual table that the statement was inserting or updating.  An
extra check for this edge case is added to avoid this problem.

Fixes: #12692
Change-Id: I342832b09dda7ed494caaad0cbb81b93fc10fe18
(cherry picked from commit dc0d0817622435ea46b33575fd4f84d3959dc42d)

3 months agoMerge "rework wraps_column_expression logic to be purely compile time checking" into...
Michael Bayer [Sat, 21 Jun 2025 23:44:27 +0000 (23:44 +0000)] 
Merge "rework wraps_column_expression logic to be purely compile time checking" into rel_2_0

3 months agoUpdate `table_per_related` example for Declarative API
Mike Fiedler [Fri, 20 Jun 2025 21:49:26 +0000 (17:49 -0400)] 
Update `table_per_related` example for Declarative API

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

### Description
When reading more of the Generic Associations, I found that the examples state "Annotated example", and wondered what that meant, since in other parts of the docs that means they are using the new 2.0 style.

I tried to update this example to be more in line with the new style, including a little f-string update.

I completely understand this is unlikely to be merged as-is - but wanted to understand more about the right way to use modern styles to properly code well-hinted, more "exotic" implementations.

Outstanding questions:
- Should examples pass pass `mypy --strict` ? It doesn't right now.
- Are there better ways to apply `Mapped` within the `type(...)` definition, so we could skip importing `Integer`?

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

(Do non-running examples count as code fixes/features?)

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

**Have a nice day!**

Closes: #10450
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10450
Pull-request-sha: a6a54d69487429c8b3a7758cf22913e6a2156316

Change-Id: Ie7c7526daed5bf907d41f666459759b9a986b8c2
(cherry picked from commit 7b9ee3daea9e22f3ec1babe7130b3885802e25af)

3 months agotype `set_committed_value`.
Federico Caselli [Fri, 20 Jun 2025 21:16:22 +0000 (23:16 +0200)] 
type `set_committed_value`.

Fixes: #12669
Change-Id: I9c73184d4c4880d0cd72eaafe125b3cf48bedf02
(cherry picked from commit 33af5279bbcf77d85f3370ce36d9f81e92c63fd6)

3 months agoDeprecate the declarative_mixin decorator
Federico Caselli [Thu, 13 Feb 2025 19:10:10 +0000 (20:10 +0100)] 
Deprecate the declarative_mixin decorator

References: #12346
Change-Id: I6709c7b33bf99ef94c3dc074a25386e8c13c9131

3 months agoreally pin flake8-import-order to <0.19
Mike Bayer [Fri, 20 Jun 2025 17:04:54 +0000 (13:04 -0400)] 
really pin flake8-import-order to <0.19

In 8a287bf5c5635daf99217e I told @caselit to just omit 0.19.0,
as I wa sure 0.19.1 would fix the issue.  Unfortunately in [1]
we see that this release continues to have problems, which seems
to be related not to the importlib.metadata fix but to an unrelated
improvement for TYPE_CHECKING blocks.

So we really have to wait for them to get a working release before
we can update.

Change-Id: Ia82a98e836bed9e826906bd07827a9e00998bf7c

3 months agorework wraps_column_expression logic to be purely compile time checking
Mike Bayer [Mon, 16 Jun 2025 23:53:30 +0000 (19:53 -0400)] 
rework wraps_column_expression logic to be purely compile time checking

Fixed issue where :func:`.select` of a free-standing, unnamed scalar expression that
has a unary operator applied, such as negation, would not apply result
processors to the selected column even though the correct type remains in
place for the unary expression.

This change opened up a typing rabbithole where we were led to also
improve and harden the typing for the Exists element, in particular
in that the Exists now always refers to a ScalarSelect object, and
no longer a SelectStatementGrouping within the _regroup() cases; there
did not seem to be any reason for this inconsistency.

Fixes: #12681
Change-Id: If9131807941030c627ab31ede4ccbd86e44e707f
(cherry picked from commit c96805a43aa76bc3ec5134832a5050d527e432fe)

3 months agoUpdate dialect opengauss url
victor [Mon, 9 Jun 2025 12:15:12 +0000 (20:15 +0800)] 
Update dialect opengauss url

(cherry picked from commit 9dfc1f0459d8e906c6ccf1d95543fe83fc2c7981)

3 months agopin flake8-import-order!=0.19.0 and updates for mypy 1.16.1
Federico Caselli [Mon, 16 Jun 2025 19:20:58 +0000 (21:20 +0200)] 
pin flake8-import-order!=0.19.0 and updates for mypy 1.16.1

Change-Id: Ic5caffe7fb7082869753947c943c8c49f0ecfc56
(cherry picked from commit 8a287bf5c5635daf99217eb14d6957c22911d7bf)

3 months agoupdate pickle tests
Mike Bayer [Wed, 11 Jun 2025 18:55:14 +0000 (14:55 -0400)] 
update pickle tests

Since I want to get rid of util.portable_instancemethod, first
make sure we are testing pickle extensively including going through
all protocols for all metadata-oriented tests.

Change-Id: I0064bc16033939780e50c7a8a4ede60ef5835b38
(cherry picked from commit 239f629b9a94b315c289930cadca4a49f2f70565)

3 months agouse integer division on maxlen
Mike Bayer [Tue, 10 Jun 2025 21:33:14 +0000 (17:33 -0400)] 
use integer division on maxlen

this was coming out as a float and breaking alembic column
compare

Change-Id: I50160cfdb2f2933331d3c316c9985f24fb914242
(cherry picked from commit 61477cf8b8af2b5a7123764a564da056f1a5c999)

3 months agofix typo in docs
Federico Caselli [Tue, 10 Jun 2025 20:18:38 +0000 (22:18 +0200)] 
fix typo in docs

Change-Id: I675636e7322ba95bb8f5f8107d5a8f3dbbc689ca
(cherry picked from commit 4c5761a114ae45eaddccb45d50b6432c9c44e4ab)

3 months agoMerge "update tox mypy" into rel_2_0
Michael Bayer [Tue, 10 Jun 2025 17:27:29 +0000 (17:27 +0000)] 
Merge "update tox mypy" into rel_2_0

3 months agoMerge "use sys.columns to allow accurate joining to other SYS tables" into rel_2_0
Michael Bayer [Tue, 10 Jun 2025 14:55:56 +0000 (14:55 +0000)] 
Merge "use sys.columns to allow accurate joining to other SYS tables" into rel_2_0

3 months agoupdate tox mypy
Pablo Estevez [Mon, 9 Jun 2025 12:49:13 +0000 (08:49 -0400)] 
update tox mypy

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

After this commit https://github.com/sqlalchemy/sqlalchemy/commit/68cd3e8ec7098d4bb4b2102ad247f84cd89dfd8c
tox will fail with mypy below 1.16, at least locally.

<!-- 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: #12655
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12655
Pull-request-sha: 15acf6b06570048d81aae89ef1d9f9a8ff83d88c

Change-Id: I7eb29a939a701ffd3a89a03d9705ab4954e66ffb
(cherry picked from commit 2ab2a3ed2a0b2b596da31e61e84ca5ff42c1ddc7)

3 months agodocument column_expression applies only to outermost statement
Mike Bayer [Tue, 10 Jun 2025 14:07:53 +0000 (10:07 -0400)] 
document column_expression applies only to outermost statement

References: https://github.com/sqlalchemy/sqlalchemy/discussions/12660
Change-Id: Id7cf98bd4560804b2f778cde41642f02f7edaf95
(cherry picked from commit 0e33848fe5330a60037594370cd7868907348c18)

3 months agoguard against schema_translate_map adding/removing None vs. caching
Mike Bayer [Tue, 10 Jun 2025 13:21:01 +0000 (09:21 -0400)] 
guard against schema_translate_map adding/removing None vs. caching

Change-Id: Iad29848b5fe15e314ad791b7fc0aac58700b0c68
(cherry picked from commit 1eb28772f0e602855cea292610f08d2581905d00)

3 months agouse sys.columns to allow accurate joining to other SYS tables
Mike Bayer [Sun, 8 Jun 2025 17:01:45 +0000 (13:01 -0400)] 
use sys.columns to allow accurate joining to other SYS tables

Reworked SQL Server column reflection to be based on the ``sys.columns``
table rather than ``information_schema.columns`` view.  By correctly using
the SQL Server ``object_id()`` function as a lead and joining to related
tables on object_id rather than names, this repairs a variety of issues in
SQL Server reflection, including:

* Issue where reflected column comments would not correctly line up
with the columns themselves in the case that the table had been ALTERed
* Correctly targets tables with awkward names such as names with brackets,
when reflecting not just the basic table / columns but also extended
information including IDENTITY, computed columns, comments which
did not work previously
* Correctly targets IDENTITY, computed status from temporary tables
which did not work previously

Fixes: #12654
Change-Id: I3bf3088c3eec8d7d3d2abc9da35f9628ef78d537
(cherry picked from commit c868afc090dde3ce5beac5cd3d6776567e9cf845)

3 months agoFix missing data type in Article.writer_id mapping example (#12649)
krave1986 [Sat, 7 Jun 2025 20:03:10 +0000 (04:03 +0800)] 
Fix missing data type in Article.writer_id mapping example (#12649)

(cherry picked from commit f2eda87a6b7f1534851da2d0370bd034d1791bfc)

3 months agoupdate docs for "copy column" warning
Mike Bayer [Sat, 7 Jun 2025 13:01:14 +0000 (09:01 -0400)] 
update docs for "copy column" warning

these docs failed to mention we're talking about ORM flush

References: #12650
Change-Id: I3a1655ba99e98021327c90d5cd0c0f8258f4ddc6
(cherry picked from commit 39142af868c0bd98e6ce59c009e62a597a2452f2)

4 months agohardcode now(), current_timstamp() into the MySQL regex
Mike Bayer [Thu, 5 Jun 2025 12:58:49 +0000 (08:58 -0400)] 
hardcode now(), current_timstamp() into the MySQL regex

Fixed yet another regression caused by by the DEFAULT rendering changes in
2.0.40 :ticket:`12425`, similar to :ticket:`12488`, this time where using a
CURRENT_TIMESTAMP function with a fractional seconds portion inside a
textual default value would also fail to be recognized as a
non-parenthesized server default.

There's no way to do this other than start hardcoding a list
of MySQL functions that demand that parenthesis are not added around
them, I can think of no other heuristic that will work here.
Suggestions welcome

Fixes: #12648
Change-Id: I75d274b56306089929b369ecfb23604e9d6fa9dd
(cherry picked from commit 8e9f789f1aa0309005e8b7725643b32802e7d214)

4 months agogive up on running py 3.14 in github actions
Mike Bayer [Tue, 3 Jun 2025 21:15:54 +0000 (17:15 -0400)] 
give up on running py 3.14 in github actions

not worth it

this is a good learning case for why we use jenkins

Change-Id: If70b0029545c70c0b5a9e1c203c853164caef874
(cherry picked from commit af2895a1d767a5357ccfeec9b57568cd6a6e0846)

4 months agoadd python 3.14 to run-test
Mike Bayer [Tue, 3 Jun 2025 18:28:19 +0000 (14:28 -0400)] 
add python 3.14 to run-test

If I'm reading correctly at https://github.com/actions/python-versions ,
there are plenty of python 3.14 versions available, so this should
"work".

Still not sure about wheel building so leaving that separate

Change-Id: Idd1ce0db124b700091f5499d6a7d087f6e31777e
(cherry picked from commit 9128189eaacf05a8479b27ef5b2e77f27f2f5ec3)

4 months agoMerge "Reflect index's column operator class on PostgreSQL" into rel_2_0
Michael Bayer [Tue, 3 Jun 2025 18:24:04 +0000 (18:24 +0000)] 
Merge "Reflect index's column operator class on PostgreSQL" into rel_2_0

4 months agoadd future mode tests for MappedAsDataclass; more py314b1 regressions
Mike Bayer [Fri, 9 May 2025 15:50:26 +0000 (11:50 -0400)] 
add future mode tests for MappedAsDataclass; more py314b1 regressions

for py314b2 all issues should be resolved

py314: yes
Change-Id: I498a1f623aeb5eb664289236e01e35d8a3dec99f
(cherry picked from commit 68f33ac943f07aaa1ade85d86e5113d5bec4ce65)

4 months agoFix type errors surfaced by mypy 1.16
Federico Caselli [Fri, 30 May 2025 20:53:59 +0000 (22:53 +0200)] 
Fix type errors surfaced by mypy 1.16

Change-Id: I50bbd760577ff7c865c81153041e82bba068e5d8
(cherry picked from commit 7088f7962bcdf497892da85aff16022d27662eb4)

4 months agoReflect index's column operator class on PostgreSQL
Denis Laxalde [Wed, 28 May 2025 19:37:36 +0000 (15:37 -0400)] 
Reflect index's column operator class on PostgreSQL

Fill the `postgresql_ops` key of PostgreSQL's `dialect_options` returned by get_multi_indexes() with a mapping from column names to the operator class, if it's not the default for respective data type.

As we need to join on ``pg_catalog.pg_opclass``, the table definition is added to ``postgresql.pg_catalog``.

Fixes #8664.

Closes: #12504
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12504
Pull-request-sha: 8fdf93e1b27c371f52990d5fda8b2fdf79ec23eb

Change-Id: I8789c1e9d15f8cc9a7205f492ec730570f19bbcc
(cherry picked from commit 0642541c6371d19c8d28ff0bdaf6ab3822715a6d)

4 months agoMerge "update black to 25.1.0 to align it with alembic" into rel_2_0
Michael Bayer [Tue, 27 May 2025 19:48:40 +0000 (19:48 +0000)] 
Merge "update black to 25.1.0 to align it with alembic" into rel_2_0

4 months agoMerge "Add missing requires in the tests for older postgresql version" into rel_2_0
Michael Bayer [Sun, 25 May 2025 14:16:33 +0000 (14:16 +0000)] 
Merge "Add missing requires in the tests for older postgresql version" into rel_2_0

4 months agofix missing quotes from cast call in mysqlconnector module
Federico Caselli [Fri, 23 May 2025 21:10:43 +0000 (23:10 +0200)] 
fix missing quotes from cast call in mysqlconnector module

This fixes an issue introduced by 51a7678db2f0fcb1552afa40333640bc7fbb6dac
in I37bd98049ff1a64d58e9490b0e5e2ea764dd1f73

Change-Id: Id738c04ee4dc8c2b12d9ab0fc71a4e1a6c5bc209
(cherry picked from commit 1070889f263be89e0e47bdbb9f7113e98ead192b)