]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
3 years agoVersion 1.4.34 placeholder
Mike Bayer [Thu, 31 Mar 2022 14:38:05 +0000 (10:38 -0400)] 
Version 1.4.34 placeholder

3 years ago- 1.4.33 rel_1_4_33
Mike Bayer [Thu, 31 Mar 2022 14:07:16 +0000 (10:07 -0400)] 
- 1.4.33

3 years agoMerge "add close=False parameter to engine.dispose()" into rel_1_4
mike bayer [Thu, 31 Mar 2022 14:05:45 +0000 (14:05 +0000)] 
Merge "add close=False parameter to engine.dispose()" into rel_1_4

3 years agoadd close=False parameter to engine.dispose()
Mike Bayer [Thu, 31 Mar 2022 13:08:11 +0000 (09:08 -0400)] 
add close=False parameter to engine.dispose()

Added new parameter :paramref:`.Engine.dispose.close`, defaulting to True.
When False, the engine disposal does not touch the connections in the old
pool at all, simply dropping the pool and replacing it. This use case is so
that when the original pool is transferred from a parent process, the
parent process may continue to use those connections.

Fixes: #7877
Change-Id: I88b0808442381ba5e50674787cdb64f0e77d8b54
(cherry picked from commit 87a0f7183de4e8454483c7348bf486265bfe1c4d)

3 years agoUpdate bindparam cache key
Federico Caselli [Wed, 30 Mar 2022 20:50:18 +0000 (22:50 +0200)] 
Update bindparam cache key

The ``literal_execute`` parameter now takes part of the cache
generation of a bindparam, since it changes the sql string generated
by the compiler.
Previously the correct bind values were used, but the ``literal_execute``
would be ignored on subsequent executions of the same query.

Fixes: #7876
Change-Id: I6bf887f1a2fe31f9d0ab68f5b4ff315004d006b2
(cherry picked from commit 429512d55e814b03854bc12ec541dbeee9e3b94e)

3 years agofurther changelog / doc fixes
Mike Bayer [Wed, 30 Mar 2022 15:44:23 +0000 (11:44 -0400)] 
further changelog / doc fixes

Change-Id: I959f242272ff5147b7c1f721cf119d09309a8c57
(cherry picked from commit 9731484f5c991b56e64349ef7b9775ef83b18402)

3 years agochangelog fixes
Mike Bayer [Wed, 30 Mar 2022 14:52:29 +0000 (10:52 -0400)] 
changelog fixes

Change-Id: I24e3de82d656d59719fd067bc81b2948e725b487
(cherry picked from commit 731262b17e0678b2549bf5d41adfd9c82ced01cc)

3 years agoFix spacing on ``bindparam`` docs
Federico Caselli [Tue, 29 Mar 2022 20:53:31 +0000 (22:53 +0200)] 
Fix spacing on ``bindparam`` docs

Change-Id: I9daad5293a4887734f14e6e5de6014aca415453c

3 years agouse annotated entity when adding secondary
Mike Bayer [Tue, 29 Mar 2022 13:48:24 +0000 (09:48 -0400)] 
use annotated entity when adding secondary

Fixed regression in "dynamic" loader strategy where the
:meth:`_orm.Query.filter_by` method would not be given an appropriate
entity to filter from, in the case where a "secondary" table were present
in the relationship being queried and the mapping were against something
complex such as a "with polymorphic".

Fixes: #7868
Change-Id: I3b82eec6485c5a92b56a596da0cfb009e9e67883
(cherry picked from commit a55476fbdbc9b4e192a052b81dfe7e750d6241e4)

3 years agoMerge "apply loader criteria more specifically when refresh is true" into rel_1_4
mike bayer [Tue, 29 Mar 2022 14:05:28 +0000 (14:05 +0000)] 
Merge "apply loader criteria more specifically when refresh is true" into rel_1_4

3 years agoMerge "fix quotes regexp for SQLite CHECK constraints" into rel_1_4
mike bayer [Mon, 28 Mar 2022 22:47:22 +0000 (22:47 +0000)] 
Merge "fix quotes regexp for SQLite CHECK constraints" into rel_1_4

3 years agoapply loader criteria more specifically when refresh is true
Mike Bayer [Mon, 28 Mar 2022 22:39:19 +0000 (18:39 -0400)] 
apply loader criteria more specifically when refresh is true

Fixed bug in :func:`_orm.with_loader_criteria` function where loader
criteria would not be applied to a joined eager load that were invoked
within the scope of a refresh operation for the parent object.

Fixes: #7862
Change-Id: If1ac86eaa95880b5ec5bdeee292d6e8000aac705
(cherry picked from commit 9c52d9a507a738ae68f0a6eae09d87959995b981)

3 years agocolumn_descriptions or equiv for DML, core select
Mike Bayer [Sat, 26 Mar 2022 20:20:34 +0000 (16:20 -0400)] 
column_descriptions or equiv for DML, core select

Added new attributes :attr:`.ValuesBase.returning_column_descriptions` and
:attr:`.ValuesBase.entity_description` to allow for inspection of ORM
attributes and entities that are installed as part of an :class:`.Insert`,
:class:`.Update`, or :class:`.Delete` construct. The
:attr:`.Select.column_descriptions` accessor is also now implemented for
Core-only selectables.

Fixes: #7861
Change-Id: Ia6a1cd24c798ba61f4e8e8eac90a0fd00d738342
(cherry picked from commit 2f1df5f9105149d6cb01c8b6ab6b9ccffa020780)

3 years agofix quotes regexp for SQLite CHECK constraints
Mike Bayer [Mon, 28 Mar 2022 17:46:24 +0000 (13:46 -0400)] 
fix quotes regexp for SQLite CHECK constraints

Fixed bug where the name of CHECK constraints under SQLite would not be
reflected if the name were created using quotes, as is the case when the
name uses mixed case or special characters.

Fixes: #5463
Change-Id: Ic3b1e0a0385fb9e727b0880e90815ea2814df313
(cherry picked from commit cb52b934000047278dbb63d0cfffdb4eae1f669c)

3 years agopin click pre-8.1 for black targets
Mike Bayer [Mon, 28 Mar 2022 20:07:51 +0000 (16:07 -0400)] 
pin click pre-8.1 for black targets

both packages seem to have a bunch of updates,
but as this branch is still formatted for python 2,
keep black at its old version and keep click before
8.1 which seems to be where symbols that are used by
the older black versions were removed

Change-Id: I432a59fb7512cf7c453815e17ec5e0559e5d6be7

3 years agoblock asyncmy 0.2.4
Mike Bayer [Mon, 28 Mar 2022 15:23:39 +0000 (11:23 -0400)] 
block asyncmy 0.2.4

asyncmy made a backwards incompatible change to the
TIME datatype in 0.2.4 which hopefully will be reverted
as this change does not belong in a minor point release

Change-Id: Id8bf932d70f52caba06094308a5b87387e69b94b
References: https://github.com/long2ice/asyncmy/issues/37
(cherry picked from commit bbd6420b39edb24481f171b8d0081149dd2e5ba7)

3 years agosupport BLANK_SCHEMA, RETAIN_SCHEMA FK schema on copy
Mike Bayer [Sat, 26 Mar 2022 14:09:10 +0000 (10:09 -0400)] 
support BLANK_SCHEMA, RETAIN_SCHEMA FK schema on copy

Added support so that the :paramref:`.Table.tometadata.referred_schema_fn`
callable passed to :meth:`.Table.to_metadata` may return the value
:data:`.BLANK_SCHEMA` to indicate that the referenced foreign key should be
reset to None. The :data.`RETAIN_SCHEMA` symbol may also be returned from
this function to indicate "no change", which will behave the same as
``None`` currently does which also indicates no change.

Fixes: #7860
Change-Id: I82a45988d534295d8356453f68001b21d4ff706d
(cherry picked from commit 74d3f3965b383aef7421f2cf1779573a4ac65987)

3 years agoClarify associationproxy.rst examples by using a one word keyword
aathan [Wed, 23 Feb 2022 22:06:42 +0000 (17:06 -0500)] 
Clarify associationproxy.rst examples by using a one word keyword

The examples are based on a `keyword` attribute but use a value
that a human may interpret as multiple keywords.

Closes: #7582
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7582
Pull-request-sha: 18b027035ece587c8bfbecff5a96385bf908edca

Change-Id: I30e8c3c0f46c66058131dfadd2b70959913a6335
(cherry picked from commit 1d4d7d858c0f724ff684423746f986b20b972476)

3 years agoMerge "Git ignore lib/sqlalchemy/cyextension for 1.4" into rel_1_4
mike bayer [Thu, 24 Mar 2022 20:58:16 +0000 (20:58 +0000)] 
Merge "Git ignore lib/sqlalchemy/cyextension for 1.4" into rel_1_4

3 years agomore autocommit messaging
Mike Bayer [Thu, 24 Mar 2022 17:58:20 +0000 (13:58 -0400)] 
more autocommit messaging

Further clarified connection-level logging to indicate the BEGIN, ROLLBACK
and COMMIT log messages do not actually indicate a real transaction when
the AUTOCOMMIT isolation level is in use; messaging has been extended to
include the BEGIN message itself, and the messaging has also been fixed to
accommodate when the :class:`.Engine` level
:paramref:`.create_engine.isolation_level` parameter was used directly.

Fixes: #7853
Change-Id: Iafc78070737ad117f84262e4bde84b81a81e4ea1
(cherry picked from commit 56366924673f88e51c74d94058c11132a057ecfa)

3 years agoMerge "Add option to disable from linting for table valued function" into rel_1_4
mike bayer [Wed, 23 Mar 2022 16:59:39 +0000 (16:59 +0000)] 
Merge "Add option to disable from linting for table valued function" into rel_1_4

3 years agotrust user PK argument as given; don't reduce
Mike Bayer [Wed, 23 Mar 2022 00:14:04 +0000 (20:14 -0400)] 
trust user PK argument as given; don't reduce

Fixed issue where the :class:`_orm.Mapper` would reduce a user-defined
:paramref:`_orm.Mapper.primary_key` argument too aggressively, in the case
of mapping to a ``UNION`` where for some of the SELECT entries, two columns
are essentially equivalent, but in another, they are not, such as in a
recursive CTE. The logic here has been changed to accept a given
user-defined PK as given, where columns will be related to the mapped
selectable but no longer "reduced" as this heuristic can't accommodate for
all situations.

Fixes: #7842
Change-Id: Ie46f0a3d42cae0501641fa213da0a9d5ca26c3ad
(cherry picked from commit d051645463b169bf1535459653eff247cb772e62)

3 years agoAdd option to disable from linting for table valued function
Mike Bayer [Wed, 23 Mar 2022 14:07:13 +0000 (10:07 -0400)] 
Add option to disable from linting for table valued function

Added new parameter
:paramref:`.FunctionElement.table_valued.joins_implicitly`, for the
:meth:`.FunctionElement.table_valued` construct. This parameter indicates
that the given table-valued function implicitly joins to the table it
refers towards, essentially disabling the "from linting" feature, i.e. the
"cartesian product" warning, from taking effect due to the presence of this
parameter. May be used for functions such as ``func.json_each()``.

Fixes: #7845
Change-Id: I80edcb74efbd4417172132c0db4d9c756fdd5eae
(cherry picked from commit 04dcc5c704dbf0b22705523e263e512c24936175)

3 years agofix generate series example
Mike Bayer [Wed, 23 Mar 2022 14:09:18 +0000 (10:09 -0400)] 
fix generate series example

this just drove me nuts because it didn't include
render_derived(), doesn't run on PG as given

Change-Id: I5d39336231c97b6cd5477644a718282709db2e1f
(cherry picked from commit c565c470517e1cc70a7f33d1ad3d3256935f1121)

3 years agoclarify LIMIT/ORDER BY FAQ wording
Mike Bayer [Tue, 22 Mar 2022 18:02:04 +0000 (14:02 -0400)] 
clarify LIMIT/ORDER BY FAQ wording

this will be coming to main in a related patch.
scale back the language here as we have a lot of examples that
use limit without order by in order to retrieve an arbitrary
row.   If subqueryload is not being used, there's nothing
inherently wrong with this.

Change-Id: I73a37658328f46a2e48b3e467f46e324f1d6a5e8

3 years agouse begin() for settting up first PK
Mike Bayer [Mon, 21 Mar 2022 21:47:34 +0000 (17:47 -0400)] 
use begin() for settting up first PK

Change-Id: I227bbb46fbcbae1f60d3f5bb4dd2b9f41ca3dd0c
(cherry picked from commit 257f67b180cadf4ca0df0d1facf27d55c98df676)

3 years agonote that horizontal sharding supports multi schema translates
Mike Bayer [Mon, 21 Mar 2022 21:35:26 +0000 (17:35 -0400)] 
note that horizontal sharding supports multi schema translates

the horizontal sharding API needs some work as it is
still exposing some legacy details, but in any case illustrate
how we can, for the moment, to use multiple schema translate
maps in a single session.

A lot more cleanup is needed in horizontal sharding, see #7837

Change-Id: Ia925e2226ecee9d747a8c4fc1772917f10bc505f
References: #7832
References: #7837
(cherry picked from commit 2a1afd32b82e103961f305b478d4cc6f6244cd00)

3 years agoadditional updates to stream results note
Mike Bayer [Mon, 21 Mar 2022 20:29:59 +0000 (16:29 -0400)] 
additional updates to stream results note

Change-Id: I9d7ed9f412a2d9384f6c0b50316df79b6f8f481a
(cherry picked from commit 512807f02d7aa6c4074910f1d0fba2187f50ee8f)

3 years agoadd note that schema translate not supported per object
Mike Bayer [Mon, 21 Mar 2022 13:07:51 +0000 (09:07 -0400)] 
add note that schema translate not supported per object

Fixes: #7832
Change-Id: I241e4cbd1b5d6df46e49e29e4ab1cac021f2895c
(cherry picked from commit 75a601e2fda7b849b858455eaa17d772bd2381e5)

3 years agocatch unexpected errors when accessing clslevel attribute
Mike Bayer [Fri, 18 Mar 2022 14:33:40 +0000 (10:33 -0400)] 
catch unexpected errors when accessing clslevel attribute

Improved the error message that's raised for the case where the
:func:`.association_proxy` construct attempts to access a target attribute
at the class level, and this access fails. The particular use case here is
when proxying to a hybrid attribute that does not include a working
class-level implementation.

Fixes: #7827
Change-Id: Ic6ff9df010f49253e664a1e7c7e16d8546006965
(cherry picked from commit 764e36e5e7b7faf1a97b4b06be1ca307ac4fce46)

3 years agoGit ignore lib/sqlalchemy/cyextension for 1.4
Gord Thompson [Tue, 15 Mar 2022 00:03:29 +0000 (18:03 -0600)] 
Git ignore lib/sqlalchemy/cyextension for 1.4

Change-Id: Ic5978375278ef6bd49d8ae15a7d6452db1870365

3 years agoMerge "Fix "Ambiguous column name" error on FK reflection" into rel_1_4
mike bayer [Thu, 17 Mar 2022 18:21:45 +0000 (18:21 +0000)] 
Merge "Fix "Ambiguous column name" error on FK reflection" into rel_1_4

3 years agoremove intermediary _is_clone_of entries when cloning
Mike Bayer [Wed, 16 Mar 2022 16:37:20 +0000 (12:37 -0400)] 
remove intermediary _is_clone_of entries when cloning

Improvements in memory usage by the ORM, removing a significant set of
intermediary expression objects that are typically stored when a copy of an
expression object is created. These clones have been greatly reduced,
reducing the number of total expression objects stored in memory by
ORM mappings by about 30%.

note this change causes the tests to have a bit of a harder time with
GC, which we would assume is because mappings now have a lot more
garbage to clean up after mappers are configured.   it remains
to be seen what the long term effects of this are.

Fixes: #7823
Change-Id: If8729747ffb9bf27e8974f069a994b5a823ee095
(cherry picked from commit b8db80e9ea917e4770c78feff092044d386985c6)

3 years agoFix "Ambiguous column name" error on FK reflection
Gord Thompson [Mon, 14 Mar 2022 17:26:54 +0000 (11:26 -0600)] 
Fix "Ambiguous column name" error on FK reflection

Fixes: #7812
Change-Id: Ic16eff9a9201d34515cb8eb884270eced4e1196a
(cherry picked from commit 84a78a97b5903dc246155a63ee8514385ed95d7c)

3 years agorestore quickstart to toc
Mike Bayer [Fri, 11 Mar 2022 21:23:14 +0000 (16:23 -0500)] 
restore quickstart to toc

this was coming out wrong due to the wrong header level
on the page.  it needs to be in a visible toc so that
the inner elements show up on the sidebar / top mobile nav.

Change-Id: I13acbe0d82c6a839230bc2e2454e4ab82e4879e6
(cherry picked from commit df056af49c51dcbcd70eb13ead5c3d8588c08235)

3 years agofurther simplify pool-sharing doc
Mike Bayer [Fri, 11 Mar 2022 21:01:09 +0000 (16:01 -0500)] 
further simplify pool-sharing doc

1. the event based approach doesn't require dispose() to be
   called at all, and the note that the "pool will hang" makes
   no sense.   I have no idea what that refers towards
2. the subsequent paragraph about connections and sessions
   is unintelligible.  old paragraphs like these are likely
   why people complain about the docs so much.  try to just
   say "don't do this", as that is easier than trying to
   explain to use connection.invalidate() etc.

Change-Id: Id840c65a2f71583ced4dc82fd8690e7da4c4b10e
(cherry picked from commit b098d2a8b9c8a6fd1ddc5dce1eca7e70ace3f545)

3 years agodispose session outside of child proc
Mike Bayer [Fri, 11 Mar 2022 19:59:04 +0000 (14:59 -0500)] 
dispose session outside of child proc

disposing inside the child proc can interfere with the parent
process.  we likely never considered this.

Fixes: #7815
Change-Id: I6ad0e5840655ed99a9d30002eba280c8e44a5c2e
(cherry picked from commit 936f0b2fc226171a81df3ca66c269750e7e52436)

3 years agotake quickstart out of main TOC for now
Mike Bayer [Fri, 11 Mar 2022 19:10:17 +0000 (14:10 -0500)] 
take quickstart out of main TOC for now

looks kind of awkward and isn't reference

Change-Id: I4fb664f79b792a32c6695a9cae7b1845a3044271
(cherry picked from commit d866eec2adcdfa2dd01e4c12d11cc2702ab2ff5e)

3 years agofix section format headings, remove "Step: "
Mike Bayer [Fri, 11 Mar 2022 19:07:09 +0000 (14:07 -0500)] 
fix section format headings, remove "Step: "

Change-Id: I25a837cf866b152a30aa373d07f704e0cc11d497
(cherry picked from commit 575a5e44bae4e587ff19d4137e54a7888ee08e41)

3 years agoadd copybutton
Mike Bayer [Fri, 11 Mar 2022 18:40:16 +0000 (13:40 -0500)] 
add copybutton

works great, including for plain code plus prompt code
with SQL (copies only the prompt code when prompts are present).
added some styling to zzzeeksphinx

Change-Id: I1b94b0488689e875adfb90ec171e04f7e8022415
(cherry picked from commit 7a48471f6482576ac50abab35ce4fa64c1f633b4)

3 years agoORM quickstart
Mike Bayer [Fri, 11 Mar 2022 15:08:36 +0000 (10:08 -0500)] 
ORM quickstart

This is done in 1.4 style so it can be backported to 1.4.
Will put this up as is, we can work on it.   For 2.0, the
ORM mapping will be updated to mapped_column() style when
we do the full pass.

Change-Id: Icfdf81449973844dac244b3a107ce955a7d3b16c
(cherry picked from commit 86fbd4a2155c31cd79f7446456b03f4cd5249050)

3 years agoMerge "support adapt_on_names for with_polymorphic" into rel_1_4
mike bayer [Wed, 9 Mar 2022 15:37:18 +0000 (15:37 +0000)] 
Merge "support adapt_on_names for with_polymorphic" into rel_1_4

3 years agoadd note about slots=True for attrs
Mike Bayer [Tue, 8 Mar 2022 23:38:11 +0000 (18:38 -0500)] 
add note about slots=True for attrs

Fixes: #7802
Change-Id: Ic5fadd369a0b63309cd9c44798ee5395efdbab2b
(cherry picked from commit e790b11460ffaf8cc68b309ad47fe0e314b2c67f)

3 years agosupport adapt_on_names for with_polymorphic
Mike Bayer [Tue, 8 Mar 2022 14:34:09 +0000 (09:34 -0500)] 
support adapt_on_names for with_polymorphic

Added :paramref:`_orm.with_polymorphic.adapt_on_names` to the
:func:`_orm.with_polymorphic` function, which allows a polymorphic load
(typically with concrete mapping) to be stated against an alternative
selectable that will adapt to the original mapped selectable on column
names alone.

Fixes: #7805
Change-Id: I933e180a489fec8a6f4916d1622d444dd4434f30
(cherry picked from commit 33e198185b2c8cc5a61c990d09a76bec76fafe31)

3 years agopop the stack that we pushed
Mike Bayer [Tue, 8 Mar 2022 18:40:12 +0000 (13:40 -0500)] 
pop the stack that we pushed

Fixed regression caused by :ticket:`7760` where the new capabilities of
:class:`.TextualSelect` were not fully implemented within the compiler
properly, leading to issues with composed INSERT constructs such as "INSERT
FROM SELECT" and "INSERT...ON CONFLICT" when combined with CTE and textual
statements.

Fixes: #7798
Change-Id: Ia2ce92507e574dd36fd26dd38ec9dd2713584467
(cherry picked from commit c36965ab211183764357456fff1640418586ed97)

3 years agoMerge "support selectin_polymorphic w/ no fixed polymorphic_on" into rel_1_4
mike bayer [Tue, 8 Mar 2022 15:21:07 +0000 (15:21 +0000)] 
Merge "support selectin_polymorphic w/ no fixed polymorphic_on" into rel_1_4

3 years agosupport selectin_polymorphic w/ no fixed polymorphic_on
Mike Bayer [Mon, 7 Mar 2022 20:11:29 +0000 (15:11 -0500)] 
support selectin_polymorphic w/ no fixed polymorphic_on

Fixed issue where the :func:`_orm.polymorphic_selectin` loader option would
not work with joined inheritance mappers that don't have a fixed
"polymorphic_on" column.   Additionally added test support for a wider
variety of usage patterns with this construct.

Fixed bug where :func:`_orm.composite` attributes would not work in
conjunction with the :func:`_orm.selectin_polymorphic` loader strategy for
joined table inheritance.

Fixes: #7799
Fixes: #7801
Change-Id: I7cfe32dfe844b188403b39545930c0aee71d0119
(cherry picked from commit 47509a2916ad1ca09b62d44ffabd66e7bda1827d)

3 years agotest sqlite w/ savepoint workaround in session fixture test
Mike Bayer [Mon, 7 Mar 2022 16:17:47 +0000 (11:17 -0500)] 
test sqlite w/ savepoint workaround in session fixture test

Fixes: #7795
Change-Id: Ib790581555656c088f86c00080c70d19ca295a03
(cherry picked from commit fbacb1991585202a5bf22acb0d36b5c979bcfad8)

3 years agoVersion 1.4.33 placeholder
Mike Bayer [Sun, 6 Mar 2022 22:43:26 +0000 (17:43 -0500)] 
Version 1.4.33 placeholder

3 years ago- 1.4.32 rel_1_4_32
Mike Bayer [Sun, 6 Mar 2022 22:28:39 +0000 (17:28 -0500)] 
- 1.4.32

3 years ago1.4.32 changelog edits
Mike Bayer [Sun, 6 Mar 2022 18:18:59 +0000 (13:18 -0500)] 
1.4.32 changelog edits

Change-Id: I3f62ba9c8ff35c8ae1d0bd611db92521da38dff0

3 years agoMerge "warn for enum length silently ignored" into rel_1_4
mike bayer [Fri, 4 Mar 2022 23:58:17 +0000 (23:58 +0000)] 
Merge "warn for enum length silently ignored" into rel_1_4

3 years agoMerge "fix type string formatting calls" into rel_1_4
mike bayer [Fri, 4 Mar 2022 23:31:58 +0000 (23:31 +0000)] 
Merge "fix type string formatting calls" into rel_1_4

3 years agoadd missing changelog for #7045
Mike Bayer [Fri, 4 Mar 2022 23:30:40 +0000 (18:30 -0500)] 
add missing changelog for #7045

was missed in d2815b4ac39b42a38dff4cc21ec100c72b9f3cae

Fixes: #7045
Change-Id: Id4836690daabf7e547c278a4e538d39579e5f2a2
(cherry picked from commit 825f555a81e55b541ba33e84ee8131d8c0de6d47)

3 years agowarn for enum length silently ignored
Mike Bayer [Fri, 4 Mar 2022 23:27:24 +0000 (18:27 -0500)] 
warn for enum length silently ignored

the "length" parameter is silently ignored when native_enum
is not passed as False.  if native_enum is True, a non-native
VARCHAR can still be generated.   Warn for this silent ignore
right now, consider having "length" used in all cases where
non-native enum is rendered likely in 2.0.

Change-Id: Ibceedd4e3aa3926f3268c0c39d94ab73d17a9bdc
(cherry picked from commit 18683f474b285b4d7e16c38c0a570276912e1081)

3 years agoMerge "add length to enum repr params" into rel_1_4
mike bayer [Fri, 4 Mar 2022 23:04:49 +0000 (23:04 +0000)] 
Merge "add length to enum repr params" into rel_1_4

3 years agotry fixing github actions again
Federico Caselli [Fri, 25 Feb 2022 21:08:09 +0000 (22:08 +0100)] 
try fixing github actions again

Change-Id: Iaf801a028510f276cf94b4999f129de8f4eb590c
(cherry picked from commit 9e7c068d669b209713da62da5748579f92d98129)

3 years agofix type string formatting calls
Mike Bayer [Fri, 4 Mar 2022 22:17:53 +0000 (17:17 -0500)] 
fix type string formatting calls

Fixed type-related error messages that would fail for values that were
tuples, due to string formatting syntax, including compile of unsupported
literal values and invalid boolean values.

Fixes: #7721
Change-Id: I6775721486ef2db2d0738b9aa08b9f2570f55659
(cherry picked from commit a261a78894c4f835b5da7fcbfb3d466a687bc11b)

3 years agoadd length to enum repr params
Mike Bayer [Fri, 4 Mar 2022 22:30:21 +0000 (17:30 -0500)] 
add length to enum repr params

This amends the fix for #7789.

Fixes: #7598
Change-Id: I067a081d743f1efaf8288601bec0400712012265
(cherry picked from commit a26a522648af14ffb9388d8d306bd98523bef1c9)

3 years agocorrect for pytest discovery
Mike Bayer [Fri, 4 Mar 2022 21:28:31 +0000 (16:28 -0500)] 
correct for pytest discovery

Made corrections to the default pytest configuration so that test discovery
runs correctly; previously, a configuration error had the effect of
discovery locating the wrong files if a super-directory of the current
directory were named "test".

Fixes: #7045
Change-Id: I2e1f63a35f80ae3f53008f327d83c8342fa7f2f6
(cherry picked from commit d2815b4ac39b42a38dff4cc21ec100c72b9f3cae)

3 years agoMerge "Fix repr for MySQL SET, generic Enum" into rel_1_4
mike bayer [Fri, 4 Mar 2022 20:51:17 +0000 (20:51 +0000)] 
Merge "Fix repr for MySQL SET, generic Enum" into rel_1_4

3 years agoAdd LongAsMax note to mssql+pyodbc dialect docs
Gord Thompson [Fri, 4 Mar 2022 18:13:14 +0000 (11:13 -0700)] 
Add LongAsMax note to mssql+pyodbc dialect docs

Change-Id: I4491b188bae49ac615f8691dd9b7a8a341428ce7
(cherry picked from commit 8316e21e3821f678cf4c0ecbc9df5e360ddb5668)

3 years agoFix repr for MySQL SET, generic Enum
petit87 [Sat, 26 Feb 2022 21:46:32 +0000 (16:46 -0500)] 
Fix repr for MySQL SET, generic Enum

Fixed issues in :class:`_mysql.SET` datatype as well as :class:`.Enum`
where the ``__repr__()`` method would not render all optional parameters in
the string output, impacting the use of these types in Alembic
autogenerate. Pull request for MySQL courtesy Yuki Nishimine.

Fixes: #7720
Fixes: #7789
Closes: #7772
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7772
Pull-request-sha: d58845479f497f6b2e12d7df2e9eb2d6ac22109b
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: Idcec23eab4258511d9f32f4e3d78e511ea6021f1
(cherry picked from commit a926dea6b78c91b627f0f0b86cdc6a9279872e99)

3 years agoMerge "improve error raise for dialect/pool events w/ async engine" into rel_1_4
mike bayer [Fri, 4 Mar 2022 17:43:50 +0000 (17:43 +0000)] 
Merge "improve error raise for dialect/pool events w/ async engine" into rel_1_4

3 years agoVersion 1.4.32 placeholder
Mike Bayer [Fri, 4 Mar 2022 16:29:54 +0000 (11:29 -0500)] 
Version 1.4.32 placeholder

Mike cherry-picking this manually as it appears
I forgot to run post_update when I released 1.4.31

(cherry picked from commit 758f2b96d336c7ba5382e89bfd421f986b5ef846)

3 years agoquick doc adjustments
Mike Bayer [Thu, 3 Mar 2022 15:33:14 +0000 (10:33 -0500)] 
quick doc adjustments

tweet thread:  https://twitter.com/zzzeek/status/1499397255089909762

Change-Id: I5556ef707c2285e7b64c91ae5c58af52efcf4770
(cherry picked from commit f68a51c549754637bd59213101025f1ee63e4865)

3 years agoimprove error raise for dialect/pool events w/ async engine
Mike Bayer [Thu, 3 Mar 2022 02:43:53 +0000 (21:43 -0500)] 
improve error raise for dialect/pool events w/ async engine

Fixed issues where a descriptive error message was not raised for some
classes of event listening with an async engine, which should instead be a
sync engine instance.

Change-Id: I00b9f4fe9373ef5fd5464fac10651cc4024f648e
(cherry picked from commit e893ce1196a1fb02ad53576fd75ffd40e5d9dd89)

3 years agoremove incorrect deprecation message
Mike Bayer [Sun, 27 Feb 2022 19:27:54 +0000 (14:27 -0500)] 
remove incorrect deprecation message

this message likely referred to ResultProxy,
no idea how it referred to CursorResult, that's a very confusing
issue.  ResultProxy -> CursorResult is mostly a name
change as far as backwards compat is concerned so there's
not much "deprecated" here.

Change-Id: Ic06bdde65a120101b2f9db22483bf3be6ff3556c

3 years agorepair GH actions syntax
Mike Bayer [Fri, 25 Feb 2022 18:26:02 +0000 (13:26 -0500)] 
repair GH actions syntax

the commit in 51e6a62ab371897d646a5
included a comment that appears to not be accepted

Change-Id: I1e56293e0e75c0440073bff7190b4961cfebc353
(cherry picked from commit 96e197f3d0348fd7d79fdd126f989490b51fd9ef)

3 years agoblock pypy for now
Mike Bayer [Fri, 25 Feb 2022 17:40:21 +0000 (12:40 -0500)] 
block pypy for now

the most recent pypy 7.3.8 series (3.7 and 3.9 included, likely
3.8 as well) have installed a 9 year old version of SQLite,
and additionally seem to have some other behavioral changes
like formatting of exception messages that is breaking
some tests.  as we are waiting on a response at [1]
remove pypy testing for now.

[1] https://foss.heptapod.net/pypy/pypy/-/issues/3690

Change-Id: I66650635111e71241b5c45a778954544c8d2490e
(cherry picked from commit 51e6a62ab371897d646a5986b9139838402c57df)

3 years agoMerge "support cx_Oracle DPI disconnect codes" into rel_1_4
mike bayer [Thu, 24 Feb 2022 14:44:48 +0000 (14:44 +0000)] 
Merge "support cx_Oracle DPI disconnect codes" into rel_1_4

3 years agosupport cx_Oracle DPI disconnect codes
Mike Bayer [Wed, 23 Feb 2022 18:43:03 +0000 (13:43 -0500)] 
support cx_Oracle DPI disconnect codes

Added support to parse "DPI" error codes from cx_Oracle exception objects
such as ``DPI-1080`` and ``DPI-1010``, both of which now indicate a
disconnect scenario as of cx_Oracle 8.3.

Fixes: #7748
Change-Id: I4a10d606d512c0d7f9b4653c47ea5734afffb8a5
(cherry picked from commit 8f9e971f10dee0614054671e0c284f0acace2d04)

3 years agosupport add_cte() for TextualSelect
Mike Bayer [Wed, 23 Feb 2022 17:50:36 +0000 (12:50 -0500)] 
support add_cte() for TextualSelect

Fixed issue where the :meth:`.HasCTE.add_cte` method as called upon a
:class:`.TextualSelect` instance was not being accommodated by the SQL
compiler. The fix additionally adds more "SELECT"-like compiler behavior to
:class:`.TextualSelect` including that DML CTEs such as UPDATE and INSERT
may be accommodated.

Fixes: #7760
Change-Id: Id97062d882e9b2a81b8e31c2bfaa9cfc5f77d5c1
(cherry picked from commit bef67e58121704a9836e1e5ec2d361cd2086036c)

3 years agoMerge "improve reflection of inline UNIQUE constraints" into rel_1_4
mike bayer [Mon, 21 Feb 2022 02:29:06 +0000 (02:29 +0000)] 
Merge "improve reflection of inline UNIQUE constraints" into rel_1_4

3 years agoimprove reflection of inline UNIQUE constraints
Mike Bayer [Sun, 20 Feb 2022 14:51:22 +0000 (09:51 -0500)] 
improve reflection of inline UNIQUE constraints

Fixed issue where SQLite unique constraint reflection would not work
for an inline UNIQUE constraint where the column name had an underscore
in its name.

Added support for reflecting SQLite inline unique constraints where
the column names are formatted with SQLite "escape quotes" ``[]``
or `` ` ``, which are discarded by the database when producing the
column name.

Fixes: #7736
Change-Id: I635003478dc27193995f7d7a6448f9333a498706
(cherry picked from commit 834af17a469fd1893acf20225e8400c0c908053f)

3 years agoremove never-used get_result_cursor_strategy() method
Mike Bayer [Sat, 19 Feb 2022 18:51:22 +0000 (13:51 -0500)] 
remove never-used get_result_cursor_strategy() method

This method I would assume got committed during the
1.4 engine refactor, where we moved from different kinds of
ResultProxy implementations to different strategy
classes instead.   These strategies are set up by
dialects by setting "self.cursor_fetch_strategy"
in the execution context.   The method here was
likely a previous iteration of that which got merged
but was never used.

Change-Id: Iec292428f41c2c245bf7ae78beaa14786c28846c
(cherry picked from commit ec4a4910aa9ecc516cf3b096cb053fd9be7f82cc)

3 years agoupdates for mariadb connector 1.0.10
Mike Bayer [Sat, 19 Feb 2022 19:11:19 +0000 (14:11 -0500)] 
updates for mariadb connector 1.0.10

Fixed regression in mariadbconnector dialect as of mariadb connector 1.0.10
where the DBAPI no longer pre-buffers cursor.lastrowid. The dialect now
fetches this value proactively for situations where it applies.

test_invalidate_on_results seems to pass for mariadbconnector now.
the driver has likely changed how it buffers result sets.  This is
a major change for them to make in a point release so we might
want to watch this in case they reverse course again.

Fixes: #7738
Change-Id: I9610aae01d1ae42fa92ffbc7123a6948e40ec9dd
(cherry picked from commit e120837b682a3a822c2dff136ad48b1ca9fb6ce2)

3 years agoclarify SQLAlchemy version 2.0 constructs are not yet available
Mike Bayer [Thu, 17 Feb 2022 20:13:41 +0000 (15:13 -0500)] 
clarify SQLAlchemy version 2.0 constructs are not yet available

Fixes: #7726
Change-Id: I30646b9da5d4de6a075dedb4b42fd00b3ed7d969
(cherry picked from commit 86e42fbc83c78a577c1b7079f0aae7cbac5b29d5)
(cherry picked from commit c5756b11a0eceb6ba4c868b52daf676652940835)

3 years agocorrect for non-deterministic gc artifacts
Mike Bayer [Tue, 15 Feb 2022 15:53:07 +0000 (10:53 -0500)] 
correct for non-deterministic gc artifacts

Observed the tests here have different profiling
counts when run individually vs. as a group, and
this seems to be due to whether or not results of
each query are garbage collected or not.  for
all but one test, ensuring results stay between
query runs seems to meet the current profiling
counts.

Change-Id: I5aca5db08936757ad2a6055c5fc077cc58979bdd
(cherry picked from commit bcd4e36ab466e8e300bd704dd3b7e6e8470a2972)

3 years agoadd note reiterating do_orm_execute() is for ORM statements only
Mike Bayer [Tue, 15 Feb 2022 13:37:44 +0000 (08:37 -0500)] 
add note reiterating do_orm_execute() is for ORM statements only

Fixes: #7707
Change-Id: I7216f63d9f4269059438e41ad8dd3dffc25a5d03
(cherry picked from commit 619abb52b6f1ee023db0f85fd96ba9f88c8efa7b)

3 years agoRaise and re-catch NameError from _ModNS
Mike Bayer [Sat, 12 Feb 2022 15:50:45 +0000 (10:50 -0500)] 
Raise and re-catch NameError from _ModNS

Fixed issue where using a fully qualified path for the classname in
:func:`_orm.relationship` that nonetheless contained an incorrect name for
path tokens that were not the first token, would fail to raise an
informative error and would instead fail randomly at a later step.

Fixes: #7697
Change-Id: I5e1a3aa4c2a6ea5b123be14666f589aec43f4b60
(cherry picked from commit 260ade78a70d51378de9e7b9456bfe6218859b6c)

3 years agoMerge "update zimports" into rel_1_4
mike bayer [Thu, 10 Feb 2022 03:56:28 +0000 (03:56 +0000)] 
Merge "update zimports" into rel_1_4

3 years agodoc fixes
Mike Bayer [Thu, 10 Feb 2022 02:59:43 +0000 (21:59 -0500)] 
doc fixes

* clarify merge behavior for non-present attributes,
  references #7687
* fix AsyncSession in async_scoped_session documentation,
  name the scoped session AsyncScopedSession, fixes: #7671
* Use non-deprecated execute() style in sqltypes JSON examples,
  fixes: #7633
* Add note regarding mitigation for
  https://github.com/MagicStack/asyncpg/issues/727,
  fixes #7245

Fixes: #7671
Fixes: #7633
Fixes: #7245
Change-Id: Ic40b4378ca321367a912864f4eddfdd9714fe217
(cherry picked from commit 449389a45f358300ba95f7d03c7b94b64703e31a)

3 years agoupdate zimports
Mike Bayer [Wed, 9 Feb 2022 20:39:44 +0000 (15:39 -0500)] 
update zimports

includes new fix for formatting like black does.

also runs black on a few outliers.

Change-Id: I67446660a6bc10b73eb710389ae6d3f122af9302
(cherry picked from commit 2579ed2b8f295c7e0ad3d875bf57535623f8df0d)

3 years agoupdate Mypy plugin status
Mike Bayer [Wed, 9 Feb 2022 15:00:24 +0000 (10:00 -0500)] 
update Mypy plugin status

The Mypy plugin is not maintainable long-term and will be replaced
by new APIs that allow for typing to work inline without the need
for plugins.

Change-Id: Icc7a203df1d0b19bde2fd852719b7b7215774c58
References: #7535
(cherry picked from commit 491e8507fa46e4312302419149d180769c84696e)

3 years agoAccommodate escaped_bind_names for defaults/insert params
Mike Bayer [Tue, 8 Feb 2022 15:12:33 +0000 (10:12 -0500)] 
Accommodate escaped_bind_names for defaults/insert params

Fixed issue in Oracle dialect where using a column name that requires
quoting when written as a bound parameter, such as ``"_id"``, would not
correctly track a Python generated default value due to the bound-parameter
rewriting missing this value, causing an Oracle error to be raised.

Fixes: #7676
Change-Id: I5a54426d24f2f9b336e3597d5595fb3e031aad97
(cherry picked from commit c2aa6374f3965c28aa2d56cbddf6dab3e1de18a2)

3 years agoamend verbiage for #7667's changelog message
Mike Bayer [Fri, 4 Feb 2022 20:46:41 +0000 (15:46 -0500)] 
amend verbiage for #7667's changelog message

clarify this applies to async calling styles only.

Change-Id: I42286fe2651be13bd472fac981df9de276ed9bb1
(cherry picked from commit 88bc4f2f66cffe82ed039a622027abd54897280a)

3 years agoMerge "ensure exception raised for all stream w/ sync result" into rel_1_4
mike bayer [Fri, 4 Feb 2022 20:42:26 +0000 (20:42 +0000)] 
Merge "ensure exception raised for all stream w/ sync result" into rel_1_4

3 years agoensure exception raised for all stream w/ sync result
Mike Bayer [Fri, 4 Feb 2022 14:04:49 +0000 (09:04 -0500)] 
ensure exception raised for all stream w/ sync result

Fixed issue where the :meth:`_asyncio.AsyncSession.execute` method failed
to raise an informative exception if the ``stream_results`` execution
option were used, which is incompatible with a sync-style
:class:`_result.Result` object. An exception is now raised in this scenario
in the same way one is already raised when using ``stream_results`` in
conjunction with the :meth:`_asyncio.AsyncConnection.execute` method.
Additionally, for improved stability with state-sensitive dialects such as
asyncmy, the cursor is now closed when this error condition is raised;
previously with the asyncmy dialect, the connection would go into an
invalid state with unconsumed server side results remaining.

Fixes: #7667
Change-Id: I6eb7affe08584889b57423a90258295f8b7085dc
(cherry picked from commit faa9ef2cff53bde291df5ac3b5c4ed8f665ecd8c)

3 years agofall back to SHOW VARIABLES for MySQL < 5.6
Mike Bayer [Fri, 4 Feb 2022 02:58:14 +0000 (21:58 -0500)] 
fall back to SHOW VARIABLES for MySQL < 5.6

Fixed regression caused by :ticket:`7518` where changing the syntax "SHOW
VARIABLES" to "SELECT @@" broke compatibility with MySQL versions older
than 5.6, including early 5.0 releases. While these are very old MySQL
versions, a change in compatibility was not planned, so version-specific
logic has been restored to fall back to "SHOW VARIABLES" for MySQL server
versions < 5.6.

includes unrelated orm/test_expire ordering issue , only showing
up on 1.4 / py2.7 but seems to be passing by luck otherwise

Fixes: #7518
Change-Id: Ia554080af742f2c3437f88cf3f7a4827b5e55da8
(cherry picked from commit 9f1ed1c68af05eab5851ffd038011e3e3bd36b63)

3 years agoadd pg14 to supported implementations
Mike Bayer [Mon, 31 Jan 2022 14:50:57 +0000 (09:50 -0500)] 
add pg14 to supported implementations

Fixes: #7647
Change-Id: I071f1a53714ebb0dc838fddc665640d46666318f
(cherry picked from commit 5087dd2a02c6a142146944126022cec735a6f54d)

3 years agosplit out declarative varieties into the declarative mapping section
Mike Bayer [Sun, 30 Jan 2022 19:25:36 +0000 (14:25 -0500)] 
split out declarative varieties into the declarative mapping section

specific declarative styles like those for dataclasses and attrs
should be in the more reference-oriented "declarative_mapping"
section rather than the more introduction-oriented mapping_styles.

this will also make it easier for us to add still more ways of
mapping declaratively for 2.0.

for the cherry-pick, also remove the misleading line about
stubs.

Fixes: #7575
Change-Id: I2700c2c2b34db9680f9cbe6ed6197add773a6a5d
(cherry picked from commit 6bfd428eea7bf712d962a0c4c6a7fb15e14955f6)

3 years agoFix up Python logging metadata
Markus Gerstel [Wed, 26 Jan 2022 09:56:40 +0000 (04:56 -0500)] 
Fix up Python logging metadata

Adjusted the logging for key SQLAlchemy components including
:class:`_engine.Engine`, :class:`_engine.Connection` to establish an
appropriate stack level parameter, so that the Python logging tokens
``funcName`` and ``lineno`` when used in custom logging formatters will
report the correct information, which can be useful when filtering log
output; supported on Python 3.8 and above. Pull request courtesy Markus
Gerstel.

Fixes: #7612
Closes: #7615
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7615
Pull-request-sha: cf9567beb06680df320cb12dde1f15baa68e1eb5

Change-Id: Iff23c92ef3453ac93cbd0d190e7efbf8ea4457a2
(cherry picked from commit f24a34140f6007cada900a8ae5ed03fe40ce2631)

3 years agoAdd compiler support for PostgreSQL "NOT VALID" constraints.
Gilbert Gilb's [Sun, 23 Jan 2022 18:00:35 +0000 (13:00 -0500)] 
Add compiler support for PostgreSQL "NOT VALID" constraints.

Added compiler support for the PostgreSQL ``NOT VALID`` phrase when rendering
DDL for the :class:`.CheckConstraint`, :class:`.ForeignKeyConstraint`
and :class:`.ForeignKey` schema constructs.  Pull request courtesy
Gilbert Gilb's.

Fixes: #7600
Closes: #7601
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7601
Pull-request-sha: 78eecd55fd9fad07030d963f5fd6713c4af60e80

Change-Id: I84bfe84596856eeea2bcca45c04ad23d980a75ec
(cherry picked from commit 77dd6808f250e0431f9bce824f46f6e1ef63eef3)

3 years agoreplace "e.g.::" with more context regarding attribute events example
Mike Bayer [Tue, 25 Jan 2022 14:14:32 +0000 (09:14 -0500)] 
replace "e.g.::" with more context regarding attribute events example

Fixes: #7613
Change-Id: I28a9577587399c41afd53fbd026003667654c3fc
(cherry picked from commit 5e3357c70e419c244156ac3885b2cf784b5b3fc0)

3 years agoMerge "dont test squelched warnings against the filter" into rel_1_4
mike bayer [Sun, 23 Jan 2022 15:18:50 +0000 (15:18 +0000)] 
Merge "dont test squelched warnings against the filter" into rel_1_4

3 years agofix bullet indentation, clarify insert independent of DDL
Mike Bayer [Sun, 23 Jan 2022 14:41:52 +0000 (09:41 -0500)] 
fix bullet indentation, clarify insert independent of DDL

Change-Id: I3b6f2b7e23044148e837afdbe4fef66773e42777
(cherry picked from commit 3fc5d28b7999cafc5111ce999a218cd5cd9329a2)

3 years agodont test squelched warnings against the filter
Mike Bayer [Sun, 23 Jan 2022 14:28:22 +0000 (09:28 -0500)] 
dont test squelched warnings against the filter

I spent days on Ibcf09af25228d39ee5a943fda82d8a9302433726
reading it over and over again and noticed this slight inaccuracy
10 seconds after I merged it.

the assert_warns_message() and assert_warns() functions should
not consider a mismatched warning class as valid for a match.

Change-Id: Ib8944dd95bcec1a7e4963917a5f4829e2ba27732
(cherry picked from commit f653d5eb169e3d0371eae388aecb0db0cb0b8c11)

3 years agoMerge "dont use exception catches for warnings; modernize xdist detection" into rel_1_4
mike bayer [Sun, 23 Jan 2022 14:24:55 +0000 (14:24 +0000)] 
Merge "dont use exception catches for warnings; modernize xdist detection" into rel_1_4

3 years agomake the autoincrement doc a lot more clear
Mike Bayer [Sun, 23 Jan 2022 14:14:00 +0000 (09:14 -0500)] 
make the autoincrement doc a lot more clear

I saw it saying "this parameter has no effect when
Identity is in use", which is not accurate, so I've expanded
this way out with bullets to make the current situation
as clear as possible.

Change-Id: I77001cc81cd90a6b867686e2975aed682e539347
(cherry picked from commit 8fa6a1b9cc86bf1a580bc0f30a02cd4028051cf4)