Commit Graph

17762 Commits

Author SHA1 Message Date
Mike Bayer 54a2991b50 experiment with alternate ways of detecting correct GC condtiions
Change-Id: If56ec107c0fd34333a48281486ac6e6fbc80cdde
2025-10-28 09:27:08 -04:00
Mike Bayer 293af0439d more cache_key coverage
Change-Id: I68ed84c1617b4d15b0103cf4a3debd1da05c6c97
2025-10-27 12:18:56 -04:00
Mike Bayer 21c47ea060 fix source list for coverage
Change-Id: Ie995efd2e20bde2c687d33d757e7b3b2e8a719c0
2025-10-27 11:59:54 -04:00
Michael Bayer a3340a71e8 Merge "try to improve coverage a bit" into main 2025-10-27 15:49:29 +00:00
Mike Bayer 2bb963891b 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
2025-10-27 11:12:44 -04:00
Mike Bayer 3db9c6be2d 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
2025-10-27 10:56:49 -04:00
Mike Bayer a5ccd8e9ef 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
2025-10-26 09:43:21 -04:00
Michael Bayer 3eb9308def Merge "Support for Create Table As" into main 2025-10-25 20:18:32 +00:00
Greg Jarzab 7f5e9e733c 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: 7de8a109b8

Change-Id: Id9c8e4a3c520ffc61de1e48e331b6220e3d52fc9
2025-10-25 14:24:46 -04:00
Mike Bayer c3840d9232 try to stop greenlet from building on a t machine
Change-Id: I21b4cbe056cf8d7265a5c15f793c6e4769f2c831
2025-10-24 19:35:55 -04:00
Federico Caselli 413a87093c postfix of I5f0fe800e31aac052926cebe9206763eef9a804c
Change-Id: Ic007a5bd842207a2c5a56374953e48c6acc7b254
2025-10-24 23:54:48 +02:00
Michael Bayer 70041d4c9c Merge "proposal: remove _execute_compiled()" into main 2025-10-24 21:49:22 +00:00
Michael Bayer 33f93745bc Merge "improve sqlite reflection regex for unusual names/formats" into main 2025-10-24 14:57:33 +00:00
Mike Bayer 189907be93 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
2025-10-24 09:54:44 -04:00
Mike Bayer 87e27693ad 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
2025-10-23 21:38:15 +02:00
Mike Bayer 6023557539 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
2025-10-21 09:21:29 -04:00
Mike Bayer 893a4f2f35 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
2025-10-20 17:08:25 -04:00
krave1986 1220858a0c 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.
2025-10-20 22:06:31 +02:00
Michael Bayer 09e3637fef Merge "refactor common reporting options a bit" into main 2025-10-20 16:26:34 +00:00
Mike Bayer 238a4b3bbe 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
2025-10-20 12:25:47 -04:00
Mike Bayer e3df597710 refactor common reporting options a bit
Change-Id: I4a7316867ceacabc4e641017c9f19e40fababdbe
2025-10-20 15:09:03 +00:00
Mike Bayer e1f3b43ad8 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
2025-10-18 16:05:14 -04:00
Rebecca Chen 0ab0d0c980 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: 580f663816

Change-Id: I9f3bdb4c105971f53fa10ed8a934356203ddb080
2025-10-18 11:23:20 -04:00
Mike Bayer b8906e62ce 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
2025-10-17 08:57:10 -04:00
Mike Bayer 80576beab2 delete previous coverage file
Change-Id: Id051257a2012bc0b40bbf0a89b80f540c9a1e5a1
2025-10-15 20:55:07 -04:00
Mike Bayer 1403a39fdc re-add .coveragerc with relative paths
Change-Id: I9023c392b98333e5235995cf8899b31e89f54096
2025-10-15 20:14:00 -04:00
Mike Bayer 056a96ce5c save coverage database files
Change-Id: Ie0260e2e96978f0c6a2824f3fb2199988091bb23
2025-10-15 19:12:16 -04:00
Mike Bayer 6728b624c0 create differently named coverage files
Change-Id: Idcdc0084037bc729151c2bbbf87c8f94c393cf79
2025-10-15 18:35:50 -04:00
Mike Bayer 1577c1d15b write db_idents file. check for it, delete it too
Change-Id: I75fee60d69ebc51d66a688f292c374db5f4753f3
2025-10-15 18:17:59 -04:00
Mike Bayer c78c39bae3 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
2025-10-15 17:11:58 -04:00
Michael Bayer caf2b25c38 Merge "fully copy_internals for AnnotatedFromClause for straight cloned traverse" into main 2025-10-15 20:56:13 +00:00
Mike Bayer fc1fef7a5c fixes for 3.14t on github actions
Change-Id: Ibc99e3dfdfd2a516c336090570df64875d97b653
2025-10-15 16:52:54 -04:00
krave1986 d0651bde13 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.
2025-10-15 21:37:10 +02:00
Mike Bayer a1eeb2e2a4 fix quotes
Change-Id: I9a56ce0fefc6be9cda0cdfeec2302ef30514aa0a
2025-10-15 15:29:02 -04:00
Mike Bayer 03116b8cc9 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
2025-10-15 15:21:08 -04:00
Mike Bayer df899e94cf 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
2025-10-15 14:13:55 -04:00
Michael Bayer 79969acaed Merge "Support VIRTUAL computed columns on PostgreSQL." into main 2025-10-14 23:07:05 +00:00
Michael Bayer 05df6f3714 Merge "Support warnings in exclusions" into main 2025-10-14 23:06:57 +00:00
Federico Caselli 8d560a0aa5 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
2025-10-14 21:21:30 +00:00
Mike Bayer 1a2d5cb851 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
2025-10-14 17:19:26 -04:00
Federico Caselli 1dd96d274d 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: a660459de9

Change-Id: I33e3d8b8eb0c02530933cb124e3d375ca4af7db2
2025-10-14 19:47:26 +02:00
Mike Bayer 52bbb8130b 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
2025-10-14 11:53:17 -04:00
Michael Bayer 2919e271be Merge "Improve postgresql reflection" into main 2025-10-14 15:03:03 +00:00
Michael Bayer ca473220b7 Merge "Reflect collation in types on PostgreSQL" into main 2025-10-14 15:02:39 +00:00
Federico Caselli 5b49b59ab7 Improve postgresql reflection
Some improvements to the reflection of PostgreSQL to avoid
unnecessary queries when not needed.

Fixes: #12908
Change-Id: Ic3da50ee43670f26d3159f5ec9a235a9a1963b8a
2025-10-14 13:27:18 +00:00
Denis Laxalde 78af7c4f04 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: c0a390314e

Change-Id: I269a194d526a0689a4b38f10456d28539c73cffb
2025-10-14 09:26:38 -04:00
Mike Bayer 938d70ae82 doc tweaks
Change-Id: I7d445cd98db7edefe705ee4eb2cd24cad72040f3
2025-10-12 01:43:48 -04:00
Mike Bayer fd191b9d4a bump black, flake8
nothing seems to have changed...

Change-Id: I7d08b24dc2df0f8a67bd5e704c8d108392a34fa3
2025-10-11 14:29:44 -04:00
Federico Caselli b3f4376f83 Merge "Complete type annotations of sqlalchemy.engine.cursor module" into main 2025-10-10 18:45:46 +00:00
Federico Caselli 845e0099ac Merge "Improve typing and code in cursor module" into main 2025-10-10 18:43:11 +00:00