]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
11 months agoomit mysql8 dupe key alias for INSERT..FROM SELECT
Mike Bayer [Tue, 13 Aug 2024 13:13:51 +0000 (09:13 -0400)] 
omit mysql8 dupe key alias for INSERT..FROM SELECT

Fixed issue in MySQL dialect where using INSERT..FROM SELECT in combination
with ON DUPLICATE KEY UPDATE would erroneously render on MySQL 8 and above
the "AS new" clause, leading to syntax failures.  This clause is required
on MySQL 8 to follow the VALUES clause if use of the "new" alias is
present, however is not permitted to follow a FROM SELECT clause.

Fixes: #11731
Change-Id: I254a3db4e9dccd9a76b11fdfe6e38a064ba0b5cf

11 months agoMerge "turn off pyodbc pooling" into main
Michael Bayer [Sun, 11 Aug 2024 20:49:16 +0000 (20:49 +0000)] 
Merge "turn off pyodbc pooling" into main

11 months agoturn off pyodbc pooling
Mike Bayer [Sun, 11 Aug 2024 19:41:36 +0000 (15:41 -0400)] 
turn off pyodbc pooling

new updates of unixodbc are turning this on in CI revealing
that our isolation level tests assume no pooling takes place,
so disable this, which is only at global module level for pyodbc

Change-Id: I971dfddc90d248281e8ca8677a3a41af6de28b86

11 months agoDocs: Dialects/index.rst - Add clickhouse-sqlalchemy pypi link. (#11717)
Gregg Lind [Fri, 9 Aug 2024 19:56:44 +0000 (14:56 -0500)] 
Docs:  Dialects/index.rst - Add clickhouse-sqlalchemy pypi link. (#11717)

Add the Pypi link for the `clickhouse-sqlalchemy` package to Externally supported dialects.

11 months agoFix typo in docs (#11715)
Gabi Nagy [Fri, 9 Aug 2024 19:54:24 +0000 (21:54 +0200)] 
Fix typo in docs (#11715)

11 months agonote prefix_with as a hint mechanism
Mike Bayer [Wed, 7 Aug 2024 18:31:48 +0000 (14:31 -0400)] 
note prefix_with as a hint mechanism

References: #11702
References: #11704
Change-Id: Ieee0780f6d132a29269430fc26de5c0664b16c2e

11 months agorestore generative to with_statement_hint
Mike Bayer [Wed, 7 Aug 2024 16:18:25 +0000 (12:18 -0400)] 
restore generative to with_statement_hint

Fixed regression in :meth:`_sql.Select.with_statement_hint` and others
where the generative behavior of the method stopped producing a copy of the
object.

Fixes: #11703
Change-Id: Ia4482f91f76fae9982dc6b075bf5cfec7042ffa6

11 months agoMerge "Add array_type to SuiteRequirements" into main
Michael Bayer [Wed, 7 Aug 2024 14:14:03 +0000 (14:14 +0000)] 
Merge "Add array_type to SuiteRequirements" into main

11 months agodisable recovery tests for oracledb
Mike Bayer [Wed, 7 Aug 2024 13:10:40 +0000 (09:10 -0400)] 
disable recovery tests for oracledb

this is not holding up in CI and is not a critical feature
for now

Change-Id: Ib9547028265403497c176d96c462d76cd86c967a

11 months agoFix a misreference in inheritance.rst (#11700)
Tao Zhou [Tue, 6 Aug 2024 20:21:44 +0000 (16:21 -0400)] 
Fix a misreference in inheritance.rst (#11700)

11 months agoBump pypa/cibuildwheel from 2.19.2 to 2.20.0 (#11690)
dependabot[bot] [Mon, 5 Aug 2024 21:07:55 +0000 (23:07 +0200)] 
Bump pypa/cibuildwheel from 2.19.2 to 2.20.0 (#11690)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.19.2 to 2.20.0.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.19.2...v2.20.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
11 months agoAdd array_type to SuiteRequirements
Anders Bogsnes [Mon, 5 Aug 2024 20:28:48 +0000 (16:28 -0400)] 
Add array_type to SuiteRequirements

Added missing ``array_type`` property to the testing suite
``SuiteRequirements`` class.

Closes: #11694
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11694
Pull-request-sha: 24697f6a4346005aa83d8eb06f94bba4cc994862

Change-Id: I192b5b932dfef07043c0c0cfe8ea36b02425a44d

11 months agoadd changelog for #11557
Mike Bayer [Mon, 5 Aug 2024 21:01:08 +0000 (17:01 -0400)] 
add changelog for #11557

also classify for oracle

Change-Id: I725db9c6ae6a8fabe7faf8631113633b338afea4

11 months agocherry-pick changelog update for 2.0.33
Mike Bayer [Mon, 5 Aug 2024 19:08:57 +0000 (15:08 -0400)] 
cherry-pick changelog update for 2.0.33

11 months agocherry-pick changelog from 2.0.32
Mike Bayer [Mon, 5 Aug 2024 19:08:57 +0000 (15:08 -0400)] 
cherry-pick changelog from 2.0.32

11 months agoAdded support for server-side cursor in oracledb async dialect.
Federico Caselli [Thu, 1 Aug 2024 19:16:20 +0000 (21:16 +0200)] 
Added support for server-side cursor in oracledb async dialect.

Added API support for server-side cursors for the oracledb async dialect,
allowing use of the :meth:`_asyncio.AsyncConnection.stream` and similar
stream methods.

Fixes: #10820
Change-Id: I861670ccc20a81ec5ee45132b8059fc2a0359087

12 months agochangelog updates
Mike Bayer [Fri, 2 Aug 2024 13:42:59 +0000 (09:42 -0400)] 
changelog updates

Change-Id: I3c319c15d883b88a4ceae2ea17d3122fcc90fb1f

12 months agoMerge "skip in eager row processors for enable_eagerloads=False" into main
Michael Bayer [Fri, 2 Aug 2024 13:39:07 +0000 (13:39 +0000)] 
Merge "skip in eager row processors for enable_eagerloads=False" into main

12 months agoMerge "escape percents for mysql enum and add suite tests" into main
Michael Bayer [Fri, 2 Aug 2024 13:38:10 +0000 (13:38 +0000)] 
Merge "escape percents for mysql enum and add suite tests" into main

12 months agoMerge "add check for pre-existing history records" into main
Michael Bayer [Fri, 2 Aug 2024 13:36:54 +0000 (13:36 +0000)] 
Merge "add check for pre-existing history records" into main

12 months agobring oracle timeout thing lower
Mike Bayer [Thu, 1 Aug 2024 23:15:57 +0000 (19:15 -0400)] 
bring oracle timeout thing lower

still seeing failures

we may very well have to revert this and mark oracle as not supporting
recovery

Change-Id: I4d48607cb8579dc73c650f5232e4414a408735e2

12 months agoskip in eager row processors for enable_eagerloads=False
Mike Bayer [Thu, 1 Aug 2024 19:58:57 +0000 (15:58 -0400)] 
skip in eager row processors for enable_eagerloads=False

Fixed issue where using the :meth:`_orm.Query.enable_eagerloads` and
:meth:`_orm.Query.yield_per` methods at the same time, in order to disable
eager loading that's configured on the mapper directly, would be silently
ignored, leading to errors or unexpected eager population of attributes.

Fixes: #10834
Change-Id: I6a20bdedf23f6dd4e98ffb49ad784117fe4afdd3

12 months agoadd check for pre-existing history records
Mike Bayer [Thu, 1 Aug 2024 20:41:45 +0000 (16:41 -0400)] 
add check for pre-existing history records

Fixed issue in history_meta example where the "version" column in the
versioned table needs to default to the most recent version number in the
history table on INSERT, to suit the use case of a table where rows are
deleted, and can then be replaced by new rows that re-use the same primary
key identity.  This fix adds an additonal SELECT query per INSERT in the
main table, which may be inefficient; for cases where primary keys are not
re-used, the default function may be omitted.  Patch courtesy  Philipp H.
v. Loewenfeld.

Fixes: #10267
Change-Id: I6b0737a7e871763f95fd636c9ad98b80f3b5808e

12 months agoescape percents for mysql enum and add suite tests
Mike Bayer [Thu, 1 Aug 2024 19:51:00 +0000 (15:51 -0400)] 
escape percents for mysql enum and add suite tests

Fixed issue in MySQL dialect where ENUM values that contained percent signs
were not properly escaped for the driver.

Fixes: #11479
Change-Id: I40d9aba619618603d3abb466f84a793d152b6788

12 months agoMerge "mutate lists in place for return_defaults=True" into main
Michael Bayer [Thu, 1 Aug 2024 19:31:26 +0000 (19:31 +0000)] 
Merge "mutate lists in place for return_defaults=True" into main

12 months agoMerge "Add support for two-phase commit in oracledb." into main
Michael Bayer [Thu, 1 Aug 2024 17:47:00 +0000 (17:47 +0000)] 
Merge "Add support for two-phase commit in oracledb." into main

12 months agomutate lists in place for return_defaults=True
Mike Bayer [Thu, 1 Aug 2024 13:49:55 +0000 (09:49 -0400)] 
mutate lists in place for return_defaults=True

Fixed regression from version 1.4 in
:meth:`_orm.Session.bulk_insert_mappings` where using the
:paramref:`_orm.Session.bulk_insert_mappings.return_defaults` parameter
would not populate the passed in dictionaries with newly generated primary
key values.

Fixes: #11661
Change-Id: I331d81a5b04456f107eb868f882d67773b3eec38

12 months agoMerge "Fixed compilation of bitwise operators on oracle and sqlite." into main
Michael Bayer [Thu, 1 Aug 2024 15:35:24 +0000 (15:35 +0000)] 
Merge "Fixed compilation of bitwise operators on oracle and sqlite." into main

12 months agoAdd support for two-phase commit in oracledb.
Federico Caselli [Mon, 10 Jun 2024 19:20:56 +0000 (21:20 +0200)] 
Add support for two-phase commit in oracledb.

Implemented two-phase transactions for the oracledb dialect. Historically,
this feature never worked with the cx_Oracle dialect, however recent
improvements to the oracledb successor now allow this to be possible.  The
two phase transaction API is available at the Core level via the
:meth:`_engine.Connection.begin_twophase` method.

As part of this change, added new facility for testing that allows
a test to skip if a certain step takes too long, allowing for a
separate cleanup step.  this is needed as oracle tpc wont allow
commit recovery if transaction is older than about 1 second, could not
find any docs on how to increase this timeout.

Fixed an execute call in the PostgreSQL dialect's provisioning that
drops old tpc transactions which was non-working, which indicates
that we've apparently never had any PG tpc transactions needing to
be cleaned up in CI for some years now, so that's good

Fixes: #11480
Change-Id: If3ad19cc29999e70f07f767b88afd330f6e5a4be

12 months agoFixed compilation of bitwise operators on oracle and sqlite.
Federico Caselli [Mon, 29 Jul 2024 21:52:04 +0000 (23:52 +0200)] 
Fixed compilation of bitwise operators on oracle and sqlite.

Implemented bitwise operators for Oracle which was previously
non-functional due to a non-standard syntax used by this database.
Oracle's support for bitwise "or" and "xor" starts with server version 21.
Additionally repaired the implementation of "xor" for SQLite.

As part of this change, the dialect compliance test suite has been enhanced
to include support for server-side bitwise tests; third party dialect
authors should refer to new "supports_bitwise" methods in the
requirements.py file to enable these tests.

Fixes: #11663
Change-Id: I41040bd67992b6c89ed3592edca8965d5d59be9e

12 months agoadd CTE cache elements for CompoundSelect, more verify tests
Federico Caselli [Fri, 14 Jun 2024 22:06:46 +0000 (00:06 +0200)] 
add CTE cache elements for CompoundSelect, more verify tests

Follow up of :ticket:`11471` to fix caching issue where using the
:meth:`.CompoundSelectState.add_cte` method of the
:class:`.CompoundSelectState` construct would not set a correct cache key
which distinguished between different CTE expressions. Also added tests
that would detect issues similar to the one fixed in :ticket:`11544`.

Fixes: #11471
Change-Id: Iae6a91077c987d83cd70ea826daff42855491330

12 months agoMerge "Import all legacy classes by sqlalchemy.orm.collections.*" into main
Michael Bayer [Mon, 29 Jul 2024 17:40:18 +0000 (17:40 +0000)] 
Merge "Import all legacy classes by sqlalchemy.orm.collections.*" into main

12 months agocherry-pick changelog update for 1.4.54
Mike Bayer [Mon, 29 Jul 2024 16:34:35 +0000 (12:34 -0400)] 
cherry-pick changelog update for 1.4.54

12 months agocherry-pick changelog from 1.4.53
Mike Bayer [Mon, 29 Jul 2024 16:34:34 +0000 (12:34 -0400)] 
cherry-pick changelog from 1.4.53

12 months agoImport all legacy classes by sqlalchemy.orm.collections.*
Takashi Kajinami [Mon, 29 Jul 2024 16:01:04 +0000 (12:01 -0400)] 
Import all legacy classes by sqlalchemy.orm.collections.*

Restored legacy class names removed from
``sqlalalchemy.orm.collections.*``, including
:class:`_orm.MappedCollection`, :func:`_orm.mapped_collection`,
:func:`_orm.column_mapped_collection`,
:func:`_orm.attribute_mapped_collection`. Pull request courtesy Takashi
Kajinami.

Fixes: #11435
Closes: #11432
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11432
Pull-request-sha: 66f20a8e2069f48665299d1ee220dfe57aedf79e

Change-Id: I05172669fc9a44e737b3714001d1317bbbf0012f

12 months agoadd missing forwards port versions
Mike Bayer [Mon, 29 Jul 2024 15:58:38 +0000 (11:58 -0400)] 
add missing forwards port versions

I totally forgot these meaning they wont show up in 2.0
changelogs, so this is a big mistake i have to stop making

Change-Id: I5f998eecbfa8aceab3ee247bb3a00e13820af872

12 months agobackport 1.4 changelogs
Mike Bayer [Mon, 29 Jul 2024 15:33:58 +0000 (11:33 -0400)] 
backport 1.4 changelogs

we have a few issues that were fixed only in 1.4, not yet released.
backport the changelog so that release mechanics proceed without issue

Change-Id: I376aa5c854314e86134c8f935b80d6c0dd083033

12 months agorestore transfer of mapper.local_table to DML for some cases
Mike Bayer [Sat, 20 Jul 2024 02:59:35 +0000 (22:59 -0400)] 
restore transfer of mapper.local_table to DML for some cases

Fixed regression appearing in 2.0.21 caused by :ticket:`10279` where using
a :func:`_sql.delete` or :func:`_sql.update` against an ORM class that is
the base of an inheritance hierarchy, while also specifying that subclasses
should be loaded polymorphically, would leak the polymorphic joins into the
UPDATE or DELETE statement as well creating incorrect SQL.

This re-introduces logic to set the `.table` of an ORM update or delete
back to `mapper.local_table` that was removed in d18ccdc997185b74 by
:ticket:`10279`; the logic is qualified to only take place for a
statement that's directly against a mapper and not one that's against
an aliased object.

Fixes: #11625
Change-Id: Ia228c99809370733f111925554167e39bcd6be1d

12 months agoupdate typing for mypy 1.11; pin plugin to <1.11
Federico Caselli [Mon, 22 Jul 2024 21:17:45 +0000 (23:17 +0200)] 
update typing for mypy 1.11; pin plugin to <1.11

Fixed internal typing issues to establish compatibility with mypy 1.11.0.
Note that this does not include issues which have arisen with the
deprecated mypy plugin used by SQLAlchemy 1.4-style code; see the addiional
change note for this plugin indicating revised compatibility.

The legacy mypy plugin is no longer fully functional with the latest series
of mypy 1.11.0, as changes in the mypy interpreter are no longer compatible
with the approach used by the plugin.  If code is dependent on the legacy
mypy plugin with sqlalchemy2-stubs, it's recommended to pin mypy to be
below the 1.11.0 series.    Seek upgrading to the 2.0 series of SQLAlchemy
and migrating to the modern type annotations.

Change-Id: Ib8fef93ede588430dc0f7ed44ef887649a415821

12 months agofix test for oracledb 2.3.0
Mike Bayer [Sat, 27 Jul 2024 03:28:57 +0000 (23:28 -0400)] 
fix test for oracledb 2.3.0

Separate from adding support for 2pc for oracledb, get the test
suite to pass cleanly for all oracledb versions first

Change-Id: I39ba91e81f2afe5e9610a65fdcc88025f207089b

12 months agoadd missing changelog for #11544
Mike Bayer [Sat, 20 Jul 2024 03:05:43 +0000 (23:05 -0400)] 
add missing changelog for #11544

Fixes: #11544
Change-Id: Ibf57f6ee0fee105672b03c2bf6690cad6bb0932d

12 months agoremove redundant(?) Isolation / isolation
Mike Bayer [Mon, 15 Jul 2024 13:15:36 +0000 (09:15 -0400)] 
remove redundant(?) Isolation / isolation

References: https://github.com/sqlalchemy/sqlalchemy/discussions/11609
Change-Id: I8ada4b8ed64a6d6b9cb923503fda6d7b4888f429

12 months agoinclude nulls_first, nulls_last in order_by_label_element
Mike Bayer [Wed, 10 Jul 2024 14:32:44 +0000 (10:32 -0400)] 
include nulls_first, nulls_last in order_by_label_element

Fixed bug where the :meth:`.Operators.nulls_first()` and
:meth:`.Operators.nulls_last()` modifiers would not be treated the same way
as :meth:`.Operators.desc()` and :meth:`.Operators.asc()` when determining
if an ORDER BY should be against a label name already in the statement. All
four modifiers are now treated the same within ORDER BY.

Fixes: #11592
Change-Id: I1de1aff679c56af1abfdfd07f9bcbc45ecc5a8cc

12 months agoImprove generated reflection in sqlite
Federico Caselli [Sun, 7 Jul 2024 09:56:56 +0000 (11:56 +0200)] 
Improve generated reflection in sqlite

Fixed reflection of computed column in SQLite to properly account
for complex expressions.

Fixes: #11582
Change-Id: I8e9fdda3e47c04b376973ee245b3175374a08f56

12 months agoMerge "alter the collation of string type for collate()" into main
Michael Bayer [Sun, 7 Jul 2024 02:49:30 +0000 (02:49 +0000)] 
Merge "alter the collation of string type for collate()" into main

12 months agoalter the collation of string type for collate()
Mike Bayer [Fri, 5 Jul 2024 13:30:10 +0000 (09:30 -0400)] 
alter the collation of string type for collate()

Fixed issue where the :func:`_sql.collate` construct, which explicitly sets
a collation for a given expression, would maintain collation settings for
the underlying type object from the expression, causing SQL expressions to
have both collations stated at once when used in further expressions for
specific dialects that render explicit type casts, such as that of asyncpg.
The :func:`_sql.collate` construct now assigns its own type to explicitly
include the new collation, assuming it's a string type.

Fixes: #11576
Change-Id: I6fc8904d2bcbc21f11bbca57e4a451ed0edbd879

12 months agoMerge "ensure intro to "functions have types" is not misleading" into main
Michael Bayer [Sat, 6 Jul 2024 18:43:55 +0000 (18:43 +0000)] 
Merge "ensure intro to "functions have types" is not misleading" into main

12 months agoMerge "add special rule to honor UPPERCASE name for TExtualSelect" into main
Michael Bayer [Sat, 6 Jul 2024 16:45:30 +0000 (16:45 +0000)] 
Merge "add special rule to honor UPPERCASE name for TExtualSelect" into main

12 months agoensure intro to "functions have types" is not misleading
Mike Bayer [Sat, 6 Jul 2024 16:24:51 +0000 (12:24 -0400)] 
ensure intro to "functions have types" is not misleading

make sure it's clear that there is normally not a return type
for SQL functions

Fixes: #11578
Change-Id: Ia0b66e7fe685dad427822345dd232eb47a0fc44f

13 months agoadd special rule to honor UPPERCASE name for TExtualSelect
Mike Bayer [Wed, 3 Jul 2024 19:46:30 +0000 (15:46 -0400)] 
add special rule to honor UPPERCASE name for TExtualSelect

Fixed issue in name normalization (e.g. "uppercase" backends like Oracle)
where using a :class:`.TextualSelect` would not properly maintain as
uppercase column names that were quoted as uppercase, even though
the :class:`.TextualSelect` includes a :class:`.Column` that explicitly
holds this uppercase name.

Fixes: #10788
Change-Id: I542a2313d22cf13db6760fe02ac659c97b5aa29e

13 months agoMerge "Fix table reflection on oracle <10.2" into main
Michael Bayer [Fri, 5 Jul 2024 14:24:04 +0000 (14:24 +0000)] 
Merge "Fix table reflection on oracle <10.2" into main

13 months agoMerge "use driver col names" into main
Michael Bayer [Fri, 5 Jul 2024 14:10:40 +0000 (14:10 +0000)] 
Merge "use driver col names" into main

13 months agoMerge "Allow flat for join with name" into main
Federico Caselli [Thu, 4 Jul 2024 20:30:24 +0000 (20:30 +0000)] 
Merge "Allow flat for join with name" into main

13 months agoAdded valid types to server_onupdate (#11555)
opkna [Thu, 4 Jul 2024 20:13:10 +0000 (22:13 +0200)] 
Added valid types to server_onupdate (#11555)

* Added valid types to server_onupdate and mapped_column kwargs mypy tests
* Joined mapped_column test files
* Set _ServerOnUpdateArgument to _ServerDefaultArgument

Fixes: #11546
13 months agoAllow flat for join with name
Eric Atkin [Wed, 3 Jul 2024 20:05:04 +0000 (16:05 -0400)] 
Allow flat for join with name

The :paramref:`_orm.aliased.name` parameter to :func:`_orm.aliased` may now
be combined with the :paramref:`_orm.aliased.flat` parameter, producing
per-table names based on a name-prefixed naming convention.  Pull request
courtesy Eric Atkin.

Fixes: #11575
Closes: #11531
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11531
Pull-request-sha: f85535464be7b04d5f9745848d28f87dcd248b86

Change-Id: If79679c7a9598fffe99c033894b7dffecef13939

13 months agouse driver col names
Mike Bayer [Thu, 21 Dec 2023 17:14:00 +0000 (12:14 -0500)] 
use driver col names

Added new execution option
:paramref:`_engine.Connection.execution_options.driver_column_names`. This
option disables the "name normalize" step that takes place against the
DBAPI ``cursor.description`` for uppercase-default backends like Oracle,
and will cause the keys of a result set (e.g. named tuple names, dictionary
keys in :attr:`.Row._mapping`, etc.) to be exactly what was delivered in
cursor.description.   This is mostly useful for plain textual statements
using :func:`_sql.text` or :meth:`_engine.Connection.exec_driver_sql`.

Fixes: #10789
Change-Id: Ib647b25bb53492fa839af04dd032d9f061e630af

13 months agoMerge "handle DBAPI error for fetchall()" into main
Michael Bayer [Thu, 4 Jul 2024 14:43:47 +0000 (14:43 +0000)] 
Merge "handle DBAPI error for fetchall()" into main

13 months agoMerge "call iter() on detached/transient dynamic session" into main
Michael Bayer [Wed, 3 Jul 2024 13:07:36 +0000 (13:07 +0000)] 
Merge "call iter() on detached/transient dynamic session" into main

13 months agoBump pypa/cibuildwheel from 2.19.1 to 2.19.2 (#11561)
dependabot[bot] [Tue, 2 Jul 2024 20:18:06 +0000 (22:18 +0200)] 
Bump pypa/cibuildwheel from 2.19.1 to 2.19.2 (#11561)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.19.1 to 2.19.2.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.19.1...v2.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
13 months agoFix table reflection on oracle <10.2
Sergio Oller Moreno [Tue, 2 Jul 2024 08:39:00 +0000 (04:39 -0400)] 
Fix table reflection on oracle <10.2

Fixed table reflection on Oracle 10.2 and older where compression options
are not supported.

Fixes: #11557
Closes: #11558
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11558
Pull-request-sha: 44e4f51a3616388f39b0f5edee3124d389765da3

Change-Id: I34c6a367bef158a0c6cf01f185e18392552b7cc7

13 months agocall iter() on detached/transient dynamic session
Mike Bayer [Tue, 2 Jul 2024 17:57:47 +0000 (13:57 -0400)] 
call iter() on detached/transient dynamic session

Fixed regression going back to 1.4 where accessing a collection using the
"dynamic" strategy on a transient object and attempting to query would
raise an internal error rather than the expected :class:`.NoResultFound`
that occurred in 1.3.

Fixes: #11562
Change-Id: I650305963a17592413520d8d1049c601761a0acc

13 months agohandle DBAPI error for fetchall()
Mike Bayer [Fri, 28 Jun 2024 20:30:57 +0000 (16:30 -0400)] 
handle DBAPI error for fetchall()

Fixed issue in "insertmanyvalues" feature where a particular call to
``cursor.fetchall()`` were not wrapped in SQLAlchemy's exception wrapper,
which apparently can raise a database exception during fetch when using
pyodbc.

Fixes: #11532
Change-Id: Ic07d3e79dd597e18d87a56b45ddffa25e762beb9

13 months agoMerge "Docs: simplify language in getting a connection & committing changes" into...
Michael Bayer [Fri, 28 Jun 2024 16:32:34 +0000 (16:32 +0000)] 
Merge "Docs: simplify language in getting a connection & committing changes" into main

13 months agoMerge "Ignore join_transaction_mode when bind is an engine" into main
Michael Bayer [Fri, 28 Jun 2024 16:29:28 +0000 (16:29 +0000)] 
Merge "Ignore join_transaction_mode when bind is an engine" into main

13 months agoDocs: simplify language in getting a connection & committing changes
lonkeknol [Fri, 28 Jun 2024 16:27:33 +0000 (12:27 -0400)] 
Docs: simplify language in getting a connection & committing changes

### Description
Simplifies language use in [Getting a Connection](https://docs.sqlalchemy.org/en/20/tutorial/dbapi_transactions.html#getting-a-connection) and [Committing Changes](https://docs.sqlalchemy.org/en/20/tutorial/dbapi_transactions.html#committing-changes)

### Checklist
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: #11542
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11542
Pull-request-sha: d706e69fb6058d3483fce98cfacbbf36ca12d78e

Change-Id: I7788f2a16a5127b3c9623f7b00f06f649b04e0fb

13 months agocache key share; support correct traverse of 'of'
Mike Bayer [Thu, 27 Jun 2024 22:17:47 +0000 (18:17 -0400)] 
cache key share; support correct traverse of 'of'

Fixed caching issue where the
:paramref:`_sql.Select.with_for_update.key_share` element of
:meth:`_sql.Select.with_for_update` was not considered as part of the cache
key, leading to incorrect caching if different variations of this parameter
were used with an otherwise identical statement.

Also repairs a traversal issue where the ``of`` element of
``ForUpdateArg`` when set to ``None`` cannot be compared against a
non-None element because the traversal defines it as a clauselist.
Traversal in this case is adjusted to accommodate for this case so that
we dont need to create a risky-to-backport change to ``ForUpdateArg``
itself.

Fixes: #11544
Change-Id: Ie8a50716df06977af58b0c22a8c10e1b64d972b9

13 months agoDocs: simplify language use for "Working with Transactions and the DBAPI"
lonkeknol [Thu, 27 Jun 2024 13:03:30 +0000 (09:03 -0400)] 
Docs: simplify language use for "Working with Transactions and the DBAPI"

### Description
This is my first pull request to sqlalchemy. It changes the writing style of two paragraphs in the unified tutorial [here](https://docs.sqlalchemy.org/en/20/tutorial/dbapi_transactions.html#working-with-transactions-and-the-dbapi). My goals were to.
1. Make them easier to read
2. Not change the meaning of the text.
3. Get feedback on whether this type of contribution is considered useful for sqlalchemy.

If this is a useful type of contribution, it might be good to discuss some general guidelines for me to adhere to as I continue. For instance:
- Prefer using present simple tense
- Remove superfluous words where possible
- Keep the pull requests to one or two h2 sections at a time, to make the review easier

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

I'm curious to hear what you all think. **Have a nice day!**

Closes: #11541
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11541
Pull-request-sha: 3179690e6a5b47de99a4486a7a15cffbfacd380b

Change-Id: I9b47f6ce4fd00c44c4b0e19957acf250f5e46d2f

13 months agoadd additional test cases re: #11371
Mike Bayer [Wed, 26 Jun 2024 16:13:28 +0000 (12:13 -0400)] 
add additional test cases re: #11371

Just want to make sure aliased() and with_polymorphic() still
work in the of_type() context here, since that's likely why we
had Any for this parameter in the first place

Change-Id: I0a2c4445bc3b91039b3446d31b4a02db28feaee7

13 months agoMerge "set type of type_of to be same as input argument" into main
Michael Bayer [Wed, 26 Jun 2024 16:09:57 +0000 (16:09 +0000)] 
Merge "set type of type_of to be same as input argument" into main

13 months agoMerge "Handle "SSL SYSCALL error: Success" in psycopg2" into main
Michael Bayer [Wed, 26 Jun 2024 16:09:00 +0000 (16:09 +0000)] 
Merge "Handle "SSL SYSCALL error: Success" in psycopg2" into main

13 months agoHandle "SSL SYSCALL error: Success" in psycopg2
David H. Irving [Sun, 23 Jun 2024 09:37:24 +0000 (05:37 -0400)] 
Handle "SSL SYSCALL error: Success" in psycopg2

Added "SSL SYSCALL error: Success" to the list of exceptions
that are considered a "disconnect" in psycopg2.

Fixes: #11522
Closes: #11523
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11523
Pull-request-sha: 63ad54e49dc3daa459caa29da8cffcb3e47a3f8c

Change-Id: I0db49d5c4db418a8e634f5370c76b99aaa3d3af6

13 months agoset type of type_of to be same as input argument
Wouter Kayser [Sun, 23 Jun 2024 10:18:05 +0000 (06:18 -0400)] 
set type of type_of to be same as input argument

Fixes: #11371
Fixes the of_type method so that it does not return a class with unset generic.
See the original issue for a more detailed explanation.

Closes: #11416
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11416
Pull-request-sha: ed8d0edebb6b84b9dcffcf24c52f113c37e7fedd

Change-Id: I35637491d6d9c573825f6d13299712626dd521c5

13 months agoIgnore join_transaction_mode when bind is an engine
Federico Caselli [Fri, 15 Mar 2024 18:15:27 +0000 (19:15 +0100)] 
Ignore join_transaction_mode when bind is an engine

Ignore :paramref:`_orm.Session.join_transaction_mode` in all cases when
the bind provided to the :class:`_orm.Session` is an
class:`_engine.Engine`.
Previously if an event that executed before the session logic,
like :meth:`_engine.ConnectionEvents.engine_connect`,
left the connection with an active transaction, the
paramref:`_orm.Session.join_transaction_mode` behavior took
place, leading to a surprising behavior.

Fixes: #11163
Change-Id: I10147876d07352f2dab898d615e98a9acd6eb91b

13 months agoMerge "use a new ClauseElement for Over.range_ / Over.rows" into main
Michael Bayer [Tue, 25 Jun 2024 13:57:14 +0000 (13:57 +0000)] 
Merge "use a new ClauseElement for Over.range_ / Over.rows" into main

13 months agouse a new ClauseElement for Over.range_ / Over.rows
Mike Bayer [Sun, 23 Jun 2024 19:40:31 +0000 (15:40 -0400)] 
use a new ClauseElement for Over.range_ / Over.rows

Enhanced the caching structure of the :paramref:`.over.rows` and
:paramref:`.over.range` so that different numerical values for the rows /
range fields are cached on the same cache key, to the extent that the
underlying SQL does not actually change (i.e. "unbounded", "current row",
negative/positive status will still change the cache key).  This prevents
the use of many different numerical range/rows value for a query that is
otherwise identical from filling up the SQL cache.

Note that the semi-private compiler method ``_format_frame_clause()``
is removed by this fix, replaced with a new method
``visit_frame_clause()``.  Third party dialects which may have referred
to this method will need to change the name and revise the approach to
rendering the correct SQL for that dialect.

This patch introduces a new ClauseElement called _FrameClause which
stores the integer range values separately and within cache-compatible
BindParameter objects from the "type" which
can be unbounded, current, preceding, or following, represented by
a _FrameClauseType enum.    The negative
sign is also stripped from the integer and represented within the
_FrameClauseType.  Tests from #11514 are adapted to include
a test for SQL Server's "literal_execute" flag taking effect so
that literal numeric values aren't stored in the cache.

Fixes: #11515
Change-Id: I8aad368ffef9f06cb5c3f8c4e971fadef029ffd5

13 months agocreate JoinedDispatcher subclasses up front
Mike Bayer [Mon, 24 Jun 2024 19:07:41 +0000 (15:07 -0400)] 
create JoinedDispatcher subclasses up front

Fixed additional issues in the event system triggered by unpickling of a
:class:`.Enum` datatype, continuing from :ticket:`11365` and
:ticket:`11360`,  where dynamically generated elements of the event
structure would not be present when unpickling in a new process.

Fixes: #11530
Change-Id: Ie1f2b3453d4891051f8719f6d3f6703302d5a86e

13 months agoMerge "use literal execute for SQL Server frame parameters" into main
Michael Bayer [Sun, 23 Jun 2024 18:17:05 +0000 (18:17 +0000)] 
Merge "use literal execute for SQL Server frame parameters" into main

13 months agofix default label style doc
Mike Bayer [Sun, 23 Jun 2024 14:18:47 +0000 (10:18 -0400)] 
fix default label style doc

Change-Id: I793f7b62c6c0b551ab1957cabcff685885b6e51c

13 months agoDocumentation: Update package name for CrateDB dialect (#11503)
Andreas Motl [Sun, 23 Jun 2024 10:14:15 +0000 (12:14 +0200)] 
Documentation: Update package name for CrateDB dialect (#11503)

The CrateDB SQLAlchemy dialect needs more love, so it was separated from
the DBAPI HTTP driver.

The new canonical package for the SQLAlchemy CrateDB dialect on PyPI is:

  https://pypi.org/project/sqlalchemy-cratedb/

13 months agoBump pypa/cibuildwheel from 2.19.0 to 2.19.1 (#11491)
dependabot[bot] [Sun, 23 Jun 2024 10:08:31 +0000 (12:08 +0200)] 
Bump pypa/cibuildwheel from 2.19.0 to 2.19.1 (#11491)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.19.0 to 2.19.1.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.19.0...v2.19.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
13 months agouse literal execute for SQL Server frame parameters
Mike Bayer [Wed, 19 Jun 2024 15:03:25 +0000 (11:03 -0400)] 
use literal execute for SQL Server frame parameters

Fixed issue where SQL Server drivers don't support bound parameters when
rendering the "frame specification" for a window function, e.g. "ROWS
BETWEEN", etc.

Fixes: #11514
Change-Id: I0664f4076a2a8266434a4670949b8b44cd261f44

13 months agopin setuptools below 69.3 and prepare for "build" for releases
Mike Bayer [Wed, 19 Jun 2024 15:44:54 +0000 (11:44 -0400)] 
pin setuptools below 69.3 and prepare for "build" for releases

Change-Id: Ib70446cc3c7d7d8acb264ffa2237a0c7aac5a0f5

13 months agocherry-pick changelog update for 2.0.32
Mike Bayer [Tue, 18 Jun 2024 21:39:11 +0000 (17:39 -0400)] 
cherry-pick changelog update for 2.0.32

13 months agocherry-pick changelog from 2.0.31
Mike Bayer [Tue, 18 Jun 2024 21:39:11 +0000 (17:39 -0400)] 
cherry-pick changelog from 2.0.31

13 months agoMerge "restore declared_attr consumption for __table__" into main
Michael Bayer [Tue, 18 Jun 2024 16:31:56 +0000 (16:31 +0000)] 
Merge "restore declared_attr consumption for __table__" into main

13 months agoMerge "Improve the documentation of json.as method" into main
Michael Bayer [Tue, 18 Jun 2024 16:30:11 +0000 (16:30 +0000)] 
Merge "Improve the documentation of json.as method" into main

13 months agoCorrect 'Session.is_modified' method documentation
Roman Druzhkov [Sun, 16 Jun 2024 18:48:30 +0000 (14:48 -0400)] 
Correct 'Session.is_modified' method documentation

Correct 'Session.is_modified' method documentation.

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

### Description
Correct documentation according to discussion: https://github.com/sqlalchemy/sqlalchemy/discussions/11481#discussioncomment-9759171

### 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: #11501
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11501
Pull-request-sha: 16e949af544b4a1a94ccc5660e164fd2bca8be78

Change-Id: Ia8be0e3865190f0667de006c3006ecf646ef8422
(cherry picked from commit 30492d665ed7edc474d151f0854ed4837dcafaed)

13 months agorestore declared_attr consumption for __table__
Mike Bayer [Tue, 18 Jun 2024 02:45:16 +0000 (22:45 -0400)] 
restore declared_attr consumption for __table__

Fixed bug in ORM Declarative where the ``__table__`` directive could not be
declared as a class function with :func:`_orm.declared_attr` on a
superclass, including an ``__abstract__`` class as well as coming from the
declarative base itself.  This was a regression since 1.4 where this was
working, and there were apparently no tests for this particular use case.

Fixes: #11509
Change-Id: I82ef0f93d00cb7a43b0b1b16ea28f1a9a79eba3b

13 months agoadd greenlet support for py313
Mike Bayer [Sun, 16 Jun 2024 15:26:41 +0000 (11:26 -0400)] 
add greenlet support for py313

based on vstinners patch

Change-Id: I3e852796b49fe51db51c030d03d17cfb6baa7484

13 months agoMerge "open up async greenlet for third parties" into main
Michael Bayer [Thu, 13 Jun 2024 14:20:57 +0000 (14:20 +0000)] 
Merge "open up async greenlet for third parties" into main

13 months agostrongly discourage noload
Mike Bayer [Thu, 13 Jun 2024 14:04:01 +0000 (10:04 -0400)] 
strongly discourage noload

Change-Id: I54a1c1d29b33091838b7f3fcd46eeec48bbd498b

13 months agoopen up async greenlet for third parties
Mike Bayer [Wed, 12 Jun 2024 16:42:29 +0000 (12:42 -0400)] 
open up async greenlet for third parties

Modified the internal representation used for adapting asyncio calls to
greenlets to allow for duck-typed compatibility with third party libraries
that implement SQLAlchemy's "greenlet-to-asyncio" pattern directly.
Running code within a greenlet that features the attribute
``__sqlalchemy_greenlet_provider__ = True`` will allow calls to
:func:`sqlalchemy.util.await_only` directly.

Change-Id: I79c67264e1a642b9a80d3b46dc64bdda80acf0aa

13 months agoMerge "include HasCTE traversal elements in TextualSelect" into main
Michael Bayer [Thu, 13 Jun 2024 13:26:12 +0000 (13:26 +0000)] 
Merge "include HasCTE traversal elements in TextualSelect" into main

13 months agoBump pypa/cibuildwheel from 2.17.0 to 2.19.0 (#11474)
dependabot[bot] [Tue, 11 Jun 2024 21:59:19 +0000 (23:59 +0200)] 
Bump pypa/cibuildwheel from 2.17.0 to 2.19.0 (#11474)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.17.0 to 2.19.0.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.17.0...v2.19.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
13 months agoloosen up hash_limit test
Mike Bayer [Tue, 11 Jun 2024 13:16:26 +0000 (09:16 -0400)] 
loosen up hash_limit test

hash_limit_string works by doing a modulus of a hash value so that
the range of possible numbers is 0-N.  however, there's a chance
we might not populate every 0-N value in unusual cases on CI,
even after iterating 500 times apparently.  Loosen the change by making
sure we got at least N/2 unique hash messages but not greater
than N.

Change-Id: I5cd2845697ec0a718ddca1c95fbc4867b06eabee

13 months agoinclude HasCTE traversal elements in TextualSelect
Mike Bayer [Tue, 11 Jun 2024 02:59:49 +0000 (22:59 -0400)] 
include HasCTE traversal elements in TextualSelect

Fixed caching issue where using the :meth:`.TextualSelect.add_cte` method
of the :class:`.TextualSelect` construct would not set a correct cache key
which distinguished between different CTE expressions.

Fixes: #11471
Change-Id: Ia9ce2c8cfd128f0f130aa9b26448dc23d994c324

13 months agoMerge "add additional contextual path info when splicing eager joins" into main
Michael Bayer [Sat, 8 Jun 2024 14:43:45 +0000 (14:43 +0000)] 
Merge "add additional contextual path info when splicing eager joins" into main

13 months agoadd additional contextual path info when splicing eager joins
Mike Bayer [Tue, 4 Jun 2024 14:56:26 +0000 (10:56 -0400)] 
add additional contextual path info when splicing eager joins

Fixed very old issue involving the :paramref:`_orm.joinedload.innerjoin`
parameter where making use of this parameter mixed into a query that also
included joined eager loads along a self-referential or other cyclical
relationship, along with complicating factors like inner joins added for
secondary tables and such, would have the chance of splicing a particular
inner join to the wrong part of the query.  Additional state has been added
to the internal method that does this splice to make a better decision as
to where splicing should proceed.

Fixes: #11449
Change-Id: Ie8f0e8d9bb7958baac33c7c2231e4afae15cf5b1

13 months agoMerge "Document InstanceState modified and expired." into main
Michael Bayer [Thu, 6 Jun 2024 13:53:04 +0000 (13:53 +0000)] 
Merge "Document InstanceState modified and expired." into main

14 months agoexpand entity_isa to include simple "isa" in poly case
Mike Bayer [Mon, 3 Jun 2024 18:50:25 +0000 (14:50 -0400)] 
expand entity_isa to include simple "isa" in poly case

Fixed issue where the :func:`_orm.selectinload` and
:func:`_orm.subqueryload` loader options would fail to take effect when
made against an inherited subclass that itself included a subclass-specific
:paramref:`_orm.Mapper.with_polymorphic` setting.

Fixes: #11446
Change-Id: I2df3ebedbe4aa9da58af99d7729e5f3052ad6abc