]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
2 years agofix documentation typos
Federico Caselli [Fri, 16 Sep 2022 21:50:47 +0000 (23:50 +0200)] 
fix documentation typos

Closes #8527
Change-Id: I0354f3953075fa35a84b09ad45fd850d8889c992

2 years agoMake 652755e7571c8cc2ec4e8beab8ef6b1f180c496b compatible with py36
Federico Caselli [Thu, 15 Sep 2022 21:38:47 +0000 (23:38 +0200)] 
Make 652755e7571c8cc2ec4e8beab8ef6b1f180c496b compatible with py36

Change-Id: I8072146e9c4405a96b566392afa8e57661aa2a42

2 years agoMerge "Improved usage of ``asyncio.shield()``" into rel_1_4
Federico Caselli [Thu, 15 Sep 2022 20:19:12 +0000 (20:19 +0000)] 
Merge "Improved usage of ``asyncio.shield()``" into rel_1_4

2 years agoMerge "Add type awareness to evaluator" into rel_1_4
mike bayer [Thu, 15 Sep 2022 15:31:52 +0000 (15:31 +0000)] 
Merge "Add type awareness to evaluator" into rel_1_4

2 years agoImproved usage of ``asyncio.shield()``
Federico Caselli [Tue, 13 Sep 2022 19:23:12 +0000 (21:23 +0200)] 
Improved usage of ``asyncio.shield()``

Fixes: #8516
Change-Id: Ifd8f5e5f42d9fbcd5b8d00bddc81ff6be690a75e
(cherry picked from commit e2e85de93daef31c75d397251cee2fbee7a5de65)

2 years agoAdd type awareness to evaluator
Mike Bayer [Tue, 13 Sep 2022 15:00:46 +0000 (11:00 -0400)] 
Add type awareness to evaluator

Fixed regression where using ORM update() with synchronize_session='fetch'
would fail due to the use of evaluators that are now used to determine the
in-Python value for expressions in the the SET clause when refreshing
objects; if the evaluators make use of math operators against non-numeric
values such as PostgreSQL JSONB, the non-evaluable condition would fail to
be detected correctly. The evaluator now limits the use of math mutation
operators to numeric types only, with the exception of "+" that continues
to work for strings as well. SQLAlchemy 2.0 may alter this further by
fetching the SET values completely rather than using evaluation.

For 1.4 this also adds "concat_op" as evaluable; 2.0 already has
more string operator support

Fixes: #8507
Change-Id: Icf7120ccbf4266499df6bb3e05159c9f50971d69
(cherry picked from commit 4ab1bc641c7d5833cf20d8ab9b38f5bfba37cfdd)

2 years agoadd missing doc for mariadb-connector
Mike Bayer [Thu, 15 Sep 2022 03:09:08 +0000 (23:09 -0400)] 
add missing doc for mariadb-connector

this module was never indexed.   kind of a major oversight

Change-Id: I4389a2ca3900edc70130fbae66195605a5704362
(cherry picked from commit 310dd2e6a741c606e5be40ef35cac6ed63e10bfe)

2 years agoadd docs for session.get()
Mike Bayer [Wed, 7 Sep 2022 23:00:31 +0000 (19:00 -0400)] 
add docs for session.get()

also use the term "primary key" a bit more

Change-Id: Ib654b30a9d06a2aeed019b4754db920afe05d774
References: https://twitter.com/encthenet/status/1567644850471989248
(cherry picked from commit cc72081b0c32dbd089fb9601747f448b65414640)

2 years agoupdate workflows
Federico Caselli [Wed, 7 Sep 2022 20:08:55 +0000 (22:08 +0200)] 
update workflows

Change-Id: Iaec865386bb3e969efec3ac75dc27ead288eca5d

2 years agoVersion 1.4.42 placeholder
Mike Bayer [Wed, 7 Sep 2022 00:58:37 +0000 (20:58 -0400)] 
Version 1.4.42 placeholder

2 years ago- 1.4.41 rel_1_4_41
Mike Bayer [Wed, 7 Sep 2022 00:53:28 +0000 (20:53 -0400)] 
- 1.4.41

2 years agochangelog fixes
Mike Bayer [Wed, 7 Sep 2022 00:49:15 +0000 (20:49 -0400)] 
changelog fixes

Change-Id: Ie0217dfea32d08abf7934950b1e1b381e612bb56

2 years agoFix Azure Synapse connection error
Gord Thompson [Thu, 1 Sep 2022 17:10:20 +0000 (11:10 -0600)] 
Fix Azure Synapse connection error

Fixed regression caused by the fix for :ticket:`8231` released in 1.4.40
where connection would fail if the user does not have permission to query
the dm_exec_sessions or dm_pdw_nodes_exec_sessions system view when trying
to determine the current transaction isolation level.

Fixes: #8475
Change-Id: Ie2bcda92f2ef2d12360ddda47eb6e896313c71f2
(cherry picked from commit 645977088404da0ed6d72ae7638a7d23dcf1e8e7)

2 years agoMerge "run update_subclass anytime we add new clslevel dispatch" into rel_1_4
mike bayer [Thu, 1 Sep 2022 12:26:18 +0000 (12:26 +0000)] 
Merge "run update_subclass anytime we add new clslevel dispatch" into rel_1_4

2 years agofix minor typo subuqeries -> subqueries
bkcsfi [Wed, 31 Aug 2022 20:42:47 +0000 (16:42 -0400)] 
fix minor typo subuqeries -> subqueries

(cherry picked from commit 41268fa6352c514ba2d5f0b3ecc16019a63547b6)

2 years agorun update_subclass anytime we add new clslevel dispatch
Mike Bayer [Wed, 31 Aug 2022 15:07:23 +0000 (11:07 -0400)] 
run update_subclass anytime we add new clslevel dispatch

Fixed event listening issue where event listeners added to a superclass
would be lost if a subclass were created which then had its own listeners
associated. The practical example is that of the :class:`.sessionmaker`
class created after events have been associated with the
:class:`_orm.Session` class.

Fixes: #8467
Change-Id: I9bdba8769147e30110a09900d4a577e833ac3af9
(cherry picked from commit d3e0b8e750d864766148cdf1a658a601079eed46)

2 years agoFix typo in 'ORM Querying Guide' docs
Andrés Álvarez [Fri, 26 Aug 2022 16:55:12 +0000 (10:55 -0600)] 
Fix typo in 'ORM Querying Guide' docs

(cherry picked from commit 087efa784d4ba08118dc9a34a765afd5174f4287)

2 years agoFix doc snippet (#8414)
Daniel Dương [Tue, 30 Aug 2022 21:05:25 +0000 (18:05 -0300)] 
Fix doc snippet (#8414)

(cherry picked from commit ec65def6bffa94d1c89ae5896e4d7e85f9abe84a)

2 years agoMerge "include TableClause.schema in cache key" into rel_1_4
mike bayer [Tue, 30 Aug 2022 17:11:12 +0000 (17:11 +0000)] 
Merge "include TableClause.schema in cache key" into rel_1_4

2 years agoMerge "implement event for merge/load=False for mutable state setup" into rel_1_4
mike bayer [Tue, 30 Aug 2022 17:10:33 +0000 (17:10 +0000)] 
Merge "implement event for merge/load=False for mutable state setup" into rel_1_4

2 years agorestore test concurrency try 2
Federico Caselli [Mon, 29 Aug 2022 18:57:01 +0000 (20:57 +0200)] 
restore test concurrency try 2

Change-Id: I54730f9683a1de3f1379ca8d2a1cab8c485e7bcc
(cherry picked from commit d8e135a474bdc2147786ec8919facc8f6fdf84f6)

2 years agoinclude TableClause.schema in cache key
Mike Bayer [Tue, 30 Aug 2022 14:47:24 +0000 (10:47 -0400)] 
include TableClause.schema in cache key

Fixed issue where use of the :func:`_sql.table` construct, passing a string
for the :paramref:`_sql.table.schema` parameter, would fail to take the
"schema" string into account when producing a cache key, thus leading to
caching collisions if multiple, same-named :func:`_sql.table` constructs
with different schemas were used.

Fixes: #8441
Change-Id: Ic4b55b3e8ec53b4c88ba112691bdf60ea1d4c448
(cherry picked from commit 613642d9639f47ad11ab62a3fa71f6132edbaa0d)

2 years agoimplement event for merge/load=False for mutable state setup
Mike Bayer [Tue, 30 Aug 2022 14:25:47 +0000 (10:25 -0400)] 
implement event for merge/load=False for mutable state setup

Fixed issue in :mod:`sqlalchemy.ext.mutable` extension where collection
links to the parent object would be lost if the object were merged with
:meth:`.Session.merge` while also passing :paramref:`.Session.merge.load`
as False.

The event added here is currently private for expediency, but
is acceptable to become a public event at some point.

Fixes: #8446
Change-Id: I9e5b9f1f5a0c5a9781f51635d5e57b1134c9e866
(cherry picked from commit e15cf451affdef95b3248d1ea5c31ac923e661c3)

2 years agoapply consistent ORM mutable notes for all mutable SQL types
Mike Bayer [Tue, 30 Aug 2022 13:50:03 +0000 (09:50 -0400)] 
apply consistent ORM mutable notes for all mutable SQL types

in
https://github.com/sqlalchemy/sqlalchemy/discussions/8447
I was surprised that we didnt have any notes about using Mutable
for ARRAY classes, since we have them for HSTORE and JSON.

Add a consistent topic box for these so we have something to
point towards.

Change-Id: Idfa1b2cbee67024545f4fa299e4c875075ec7d3f
(cherry picked from commit 2f146b172ad228e40f1e8d5f1d2abc888ae5e669)

2 years agoMerge "refine ruleset to determine when poly adaption should be used" into rel_1_4
mike bayer [Tue, 30 Aug 2022 04:53:00 +0000 (04:53 +0000)] 
Merge "refine ruleset to determine when poly adaption should be used" into rel_1_4

2 years agorefine ruleset to determine when poly adaption should be used
Mike Bayer [Mon, 29 Aug 2022 14:43:36 +0000 (10:43 -0400)] 
refine ruleset to determine when poly adaption should be used

Fixed regression appearing in the 1.4 series where a joined-inheritance
query placed as a subquery within an enclosing query for that same entity
would fail to render the JOIN correctly for the inner query. The issue
manifested in two different ways prior and subsequent to version 1.4.18
(related issue #6595), in one case rendering JOIN twice, in the other
losing the JOIN entirely. To resolve, the conditions under which
"polymorphic loading" are applied have been scaled back to not be invoked
for simple joined inheritance queries.

Fixes: #8456
Change-Id: Ie4332fadb1dfc670cd31d098a6586a9f6976bcf7
(cherry picked from commit 137b50e1ecf1ddea1ff63d94f24f6445e6807dc9)

2 years agorun github pipeline on python 3.11
Mike Bayer [Thu, 25 Aug 2022 18:05:16 +0000 (14:05 -0400)] 
run github pipeline on python 3.11

Change-Id: I555c1e16c5347e67da4c70414b4677b2d3afebd5

2 years agotry out greenlet / cython on py311
Mike Bayer [Thu, 25 Aug 2022 18:05:16 +0000 (14:05 -0400)] 
try out greenlet / cython on py311

I've updated jenkins to see what happens

Change-Id: If71b3f6da98dacd21419e8ece2395bc5fd20d133
(cherry picked from commit e14a8e3295d289e256bf236d0461034f35b7fcc3)

2 years agointegrate connection.terminate() for supporting dialects
Mike Bayer [Tue, 23 Aug 2022 13:28:06 +0000 (09:28 -0400)] 
integrate connection.terminate() for supporting dialects

Integrated support for asyncpg's ``terminate()`` method call for cases
where the connection pool is recycling a possibly timed-out connection,
where a connection is being garbage collected that wasn't gracefully
closed, as well as when the connection has been invalidated. This allows
asyncpg to abandon the connection without waiting for a response that may
incur long timeouts.

Fixes: #8419
Change-Id: Ia575af779d5733b483a72dff3690b8bbbad2bb05
(cherry picked from commit 3b7e621aa728d9b01dbac4150e13ea2ef6af35a3)

2 years agomore function adjustments
Mike Bayer [Mon, 22 Aug 2022 17:55:08 +0000 (13:55 -0400)] 
more function adjustments

the inherited-members feature works very poorly
and inconsistently in sphinx.  just dont use it here as it
refuses to exclude ColumnOperators methods

Change-Id: Ic50865c9901e7225a99ff7f33454da15ff91b12f
(cherry picked from commit 25fa4c0250730958c39676007cc39df7b0ee2124)

2 years agoreformat functions.rst; document coalsce
Mike Bayer [Mon, 22 Aug 2022 17:43:59 +0000 (13:43 -0400)] 
reformat functions.rst; document coalsce

this file was all over the place autodocumenting all the
contents of functions.py with no regards to the heading
paragraph which seemed to be introducing the generic functions.
Use specific autoclass/autofunc docs as automodule is generally
unworkable.

Add missing docstring for coalesce function.

Fixes: #8415
Change-Id: I4c37e6153282ce99b9f5d674f6e802c25ef536e1
(cherry picked from commit 07961a8bd0b965d79855275b0eb80075b57c2d49)

2 years agoremove narrative "reconstructor" document
Mike Bayer [Fri, 19 Aug 2022 15:12:41 +0000 (11:12 -0400)] 
remove narrative "reconstructor" document

this event hook is not commonly used and this page does not
fit into the current narrative very well.  We should possibly
write a new paragraph regarding how instances load
at some point though the best place to put it is not clear.

(cherry picked from commit e7b2055866f315a77e1e19a832a5afdae90bfd9f)

2 years agoremove notes re: current pymssql DBAPI features
Mike Bayer [Fri, 19 Aug 2022 14:16:34 +0000 (10:16 -0400)] 
remove notes re: current pymssql DBAPI features

Fixes: #8337
Change-Id: Ib0c107bb386489dcb6d1683f29d0a9574dd96f1e
(cherry picked from commit 319e5a3d8e92ccc97faeeaecd55313131e5a611b)

2 years agofix some inaccuracies in with_variant doc
Mike Bayer [Fri, 19 Aug 2022 13:49:25 +0000 (09:49 -0400)] 
fix some inaccuracies in with_variant doc

* the table wont create on mysql/mariadb b.c. user_name had
  no length
* "utf-8" is not recognized by mysql/mariadb, use "utf8"
* mysql or mariadb name match is determined by the URL, not the
  actual DB that is detected (I know I made it work that way but
  I forgot)
* for the 1.4 backport only, will remove the "mariadb" part
  as we dont support that API, #8408

Fixes: #8408
Change-Id: I5b0a58a3f94a3450631e2405bd07d0a77599ae26
(cherry picked from commit 7f99c4ab55a80ee428b3466e9fa476d6ea03bfaf)

2 years agoset old declarative docs as orphan
Mike Bayer [Thu, 18 Aug 2022 17:56:50 +0000 (13:56 -0400)] 
set old declarative docs as orphan

these otherwise show up in the sidebar where they are
confusing

Change-Id: Ic7bdcd31207a135e2805241928ca2379a8189565
(cherry picked from commit e2e412f6a3354682ab792f3f9eefc537207a44b4)

2 years agomore abstractconcretebase clarity
Mike Bayer [Thu, 18 Aug 2022 15:54:04 +0000 (11:54 -0400)] 
more abstractconcretebase clarity

Change-Id: I9ddb6b1a2e0c0be1fe355a7ea714d0e16aa93b47
(cherry picked from commit a47d76ca25275344345b208def5f72292e8687b4)

2 years agoremove nonsensical note
Mike Bayer [Thu, 18 Aug 2022 15:29:25 +0000 (11:29 -0400)] 
remove nonsensical note

this note is not factually incorrect but it makes no sense
why this would be in the middle of the abstract concrete doc

Change-Id: Icd67d9d9a93ee72714bf85d8d5ca39c0af61f356
(cherry picked from commit acf14885833da238606e6a0df7c5ab256e477f2c)

2 years agoMerge "fill out all distinguising fields for AliasedInsp" into rel_1_4
mike bayer [Wed, 17 Aug 2022 22:23:48 +0000 (22:23 +0000)] 
Merge "fill out all distinguising fields for AliasedInsp" into rel_1_4

2 years agofill out all distinguising fields for AliasedInsp
Mike Bayer [Wed, 17 Aug 2022 17:06:51 +0000 (13:06 -0400)] 
fill out all distinguising fields for AliasedInsp

Hardened the cache key strategy for the :func:`_orm.aliased` and
:func:`_orm.with_polymorphic` constructs. While no issue involving actual
statements being cached can easily be demonstrated (if at all), these two
constructs were not including enough of what makes them unique in their
cache keys for caching on the aliased construct alone to be accurate.

Fixes: #8401
Change-Id: I13d14985b6965f398edd9494601d8ae89ac641f2
(cherry picked from commit a58f1b9c698dc7be29d43f2c4c21de8918943f77)

2 years agoMerge "refine transfer of cached ORM options for selectin, lazy" into rel_1_4
mike bayer [Wed, 17 Aug 2022 18:42:32 +0000 (18:42 +0000)] 
Merge "refine transfer of cached ORM options for selectin, lazy" into rel_1_4

2 years agorefine transfer of cached ORM options for selectin, lazy
Mike Bayer [Tue, 16 Aug 2022 18:25:12 +0000 (14:25 -0400)] 
refine transfer of cached ORM options for selectin, lazy

Fixed issue involving :func:`_orm.with_loader_criteria` where a closure
variable used as bound parameter value within the lambda would not carry
forward correctly into additional relationship loaders such as
:func:`_orm.selectinload` and :func:`_orm.lazyload` after the statement
were cached, using the stale originally-cached value instead.

This change brings forth a good refinement where we finally realize
we shouldn't be testing every ORM option with lots of switches, we
just let the option itself be given "here is your uncached version,
you are cached, tell us what to do!".   the current decision is
that strategy loader options used the cached in all cases as they
always have, with_loader_criteria uses the uncached, because the
uncached will have been invoked with new closure state that we
definitely need.   The only
edge that might not work is if with_loader_criteria referenced
an entity that is local to the query, namely a specific AliasedInsp,
however that's not a documented case for this.  if we had to do that,
then we perhaps would introduce a more complex reconcilation
logic, and this would also give us the hook to do that.

For this approach to work in 1.4, state.load_options has to
be ordered, so, this does the switch of load_options from set->tuple,
which has been in 2.0 for a long time.  if this change is not
feasbile, due to affecting other areas, we may have to scale
back this fix a bit, but for here, it's just two collections
without any deep impacts.

Fixes: #8399
Change-Id: Ided8e2123915131e3f11cf6b06d773039e73797a
(cherry picked from commit 860d582028f6bbbb39cbf17698f7d6b7a8e458ea)

2 years agoremove erroneous note about future metadata
Mike Bayer [Wed, 17 Aug 2022 13:17:33 +0000 (09:17 -0400)] 
remove erroneous note about future metadata

this change was already applied

Change-Id: I24cfdc1912b77f98ae6d0f3865cabd223553fc79
(cherry picked from commit 0eea54e84df104ffe8bc246eb82e4a7a2cf05079)

2 years agoimprove names for datatypes section
Mike Bayer [Tue, 9 Aug 2022 13:50:57 +0000 (09:50 -0400)] 
improve names for datatypes section

Continuing along #8362, if we look at the document here without
"this is the same text I've read for 14 years", we begin to see
that the title "Column and Data types" makes no sense at all,
is there a "column type" and a "Data type"?  I guess what I was
thinking at that time is that a type can be placed on a
Column, or it can be used whenever you have, you know, "data".
The phrase "SQL expression" wasn't discovered yet.

"SQL Datatype" is not spectacular but at least it's one term.
the new intro then is focused on the hierarchy layout so let's
name it that.

not amazing, but better than the duplicate name that made
no sense before.

Fixes: #8362
Change-Id: Iab37ef5605ec55f30284ac9a98bf7246f736675d
(cherry picked from commit 7e442cd0a9341ac828b4c4820818ad80ad9200fa)

2 years agoimprove typing intro
Mike Bayer [Mon, 8 Aug 2022 18:50:29 +0000 (14:50 -0400)] 
improve typing intro

Fixes: #8362
Change-Id: I38aa1727e94c50a9f06bd75d57ea1ca1cfffd2f3
(cherry picked from commit ac1d775d862e62561effcce54462f687dd79b8bb)

2 years agoVersion 1.4.41 placeholder
Mike Bayer [Mon, 8 Aug 2022 16:16:26 +0000 (12:16 -0400)] 
Version 1.4.41 placeholder

2 years ago- 1.4.40 rel_1_4_40
Mike Bayer [Mon, 8 Aug 2022 16:10:25 +0000 (12:10 -0400)] 
- 1.4.40

2 years agorepair doc warnings
Mike Bayer [Mon, 8 Aug 2022 16:08:30 +0000 (12:08 -0400)] 
repair doc warnings

Change-Id: I446105028539a34da90d6b8ae4812965cc398ee5

2 years agodeep compare CTEs before considering them conflicting
Mike Bayer [Fri, 5 Aug 2022 21:25:05 +0000 (17:25 -0400)] 
deep compare CTEs before considering them conflicting

Fixed issue where referencing a CTE multiple times in conjunction with a
polymorphic SELECT could result in multiple "clones" of the same CTE being
constructed, which would then trigger these two CTEs as duplicates. To
resolve, the two CTEs are deep-compared when this occurs to ensure that
they are equivalent, then are treated as equivalent.

Fixes: #8357
Change-Id: I1f634a9cf7a6c4256912aac1a00506aecea3b0e2
(cherry picked from commit 85fa363c846f4ed287565c43c32e2cca29470e25)

2 years agoMerge "Fix 'No transaction found' error on Synapse." into rel_1_4
mike bayer [Thu, 4 Aug 2022 13:37:41 +0000 (13:37 +0000)] 
Merge "Fix 'No transaction found' error on Synapse." into rel_1_4

2 years agoupdate quoted_name doc
Mike Bayer [Thu, 4 Aug 2022 13:26:47 +0000 (09:26 -0400)] 
update quoted_name doc

Fixes: #8339
Change-Id: If78bc9babfdc6a4dde4e65d72858ac7a402cbb4d
(cherry picked from commit dc5a1c482ee1a8faf15fd81db866e5f72c1c719f)

2 years agomore mysql 8.0.30 fixes
Mike Bayer [Thu, 4 Aug 2022 00:47:50 +0000 (20:47 -0400)] 
more mysql 8.0.30 fixes

Change-Id: I9df3506f364f4721404cf2022486bc31fd5c2ce6
(cherry picked from commit 0b57cc9564caba442febb76a224a96c2b263ba10)

2 years agoadjust mysql utf test
Mike Bayer [Wed, 3 Aug 2022 22:09:39 +0000 (18:09 -0400)] 
adjust mysql utf test

we've updated mysql on jenkins and this test seems to need
a small adjustment

Change-Id: I21508f667700cf8f3200f15af501a66a85f48779
(cherry picked from commit ea6fb4ff5bcffcf71cdbc587504f10f03fe921ca)

2 years agoglossary/association relationship: role->role_name (#8331)
Fabian Preiß [Wed, 3 Aug 2022 20:25:19 +0000 (22:25 +0200)] 
glossary/association relationship: role->role_name (#8331)

(cherry picked from commit b5485fe41828c21a555d0d5a6abf29ceb3b3147f)

2 years agosend in the dragons on async_scoped_session
Mike Bayer [Wed, 3 Aug 2022 16:08:54 +0000 (12:08 -0400)] 
send in the dragons on async_scoped_session

make it clear that async_scoped_session.remove() must
be called, else memory will build up.    Generally
discourage the whole pattern as well, as this is a
"framework" pattern and we don't really want to be supporting
frameworks.    Also indicate that scopefunc must be idempotent
and lightweight.

Fixes: #8340
Change-Id: Ibc3d21124ae73c3b25ee51966504bbb1975c36b2
(cherry picked from commit c2327ec60f3f3b52a4b3a0daeef39174d96d225e)

2 years agoFix 'No transaction found' error on Synapse.
Gord Thompson [Fri, 22 Jul 2022 12:31:24 +0000 (08:31 -0400)] 
Fix 'No transaction found' error on Synapse.

Fixed issue where the SQL Server dialect's query for the current isolation
level would fail on Azure Synapse Analytics, due to the way in which this
database handles transaction rollbacks after an error has occurred. The
initial query has been modified to no longer rely upon catching an error
when attempting to detect the appropriate system view. Additionally, to
better support this database's very specific "rollback" behavior,
implemented new parameter ``ignore_no_transaction_on_rollback`` indicating
that a rollback should ignore Azure Synapse error 'No corresponding
transaction found. (111214)', which is raised if no transaction is present
in conflict with the Python DBAPI.

Fixes: #8231
Closes: #8233
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8233
Pull-request-sha: c48bd44a9f53d00e5e94f1b8bf996711b6419562

Change-Id: I6407a03148f45cc9eba8fe1d31d4f59ebf9c7ef7
(cherry picked from commit 8fe3cd69c5f2d8f73e75fb19ae929273282fba57)

2 years agoreword yield_per a bit more
Mike Bayer [Tue, 2 Aug 2022 18:51:49 +0000 (14:51 -0400)] 
reword yield_per a bit more

I'm still not satisified with this section as it is still
too wordy and dense, but at least let's put a better description
of what yield_per actually is and why one might use it at the top.

Change-Id: I10f4d862d9c499044f5718fca0d27ac106289717
(cherry picked from commit 3ef9fa6d4ff8ade8915000b41c262caf4a88e064)

2 years agofix mypy test
Mike Bayer [Tue, 2 Aug 2022 15:45:09 +0000 (11:45 -0400)] 
fix mypy test

this change seems to be from 2.0 in
4fe222d9412df30fc15ace3d7a however does not apply to 1.4.

Change-Id: Ie736afaf18abf048f4bf5f5266e76aefa98e4e80

2 years agofix up SAVEPOINT docs
Mike Bayer [Tue, 2 Aug 2022 15:34:35 +0000 (11:34 -0400)] 
fix up SAVEPOINT docs

these contained a factual error that the entire session is
expired, which is no longer the case (I can't find exactly
when this was changed).  Additionally, added a PostgreSQL
specific example w/ IntegrityError as this is the most
common case for this.   Tried to tighten up other language
and make it as clear as possible.

Change-Id: I39160e7443964db59d1d5a2e0616084767813eea
(cherry picked from commit 37b8c5e755cefd9ae0fdf6816dae09b519be3b06)

2 years agoMerge "repair psycopg2 (and psycopg) multiple hosts format" into rel_1_4
mike bayer [Tue, 2 Aug 2022 13:49:58 +0000 (13:49 +0000)] 
Merge "repair psycopg2 (and psycopg) multiple hosts format" into rel_1_4

2 years agodocument @ sign in issue template, docs
Mike Bayer [Tue, 2 Aug 2022 13:33:51 +0000 (09:33 -0400)] 
document @ sign in issue template, docs

Fixes: #8328
Change-Id: I69a48c4499fe7e57aad242403186e69c4452b84b
(cherry picked from commit 7f45bcd114c797105921e06789b3753e7d8f6daa)

2 years agorepair psycopg2 (and psycopg) multiple hosts format
Mike Bayer [Mon, 1 Aug 2022 14:29:13 +0000 (10:29 -0400)] 
repair psycopg2 (and psycopg) multiple hosts format

Fixed issue in psycopg2 dialect where the "multiple hosts" feature
implemented for :ticket:`4392`, where multiple ``host:port`` pairs could be
passed in the query string as
``?host=host1:port1&host=host2:port2&host=host3:port3`` was not implemented
correctly, as it did not propagate the "port" parameter appropriately.
Connections that didn't use a different "port" likely worked without issue,
and connections that had "port" for some of the entries may have
incorrectly passed on that hostname. The format is now corrected to pass
hosts/ports appropriately.

As part of this change, maintained support for another multihost style that
worked unintentionally, which is comma-separated
``?host=h1,h2,h3&port=p1,p2,p3``. This format is more consistent with
libpq's query-string format, whereas the previous format is inspired by a
different aspect of libpq's URI format but is not quite the same thing.

If the two styles are mixed together, an error is raised as this is
ambiguous.

Fixes: #4392
Change-Id: Ic9cc0b0e6e90725e158d9efe73e042853dd1263f
(cherry picked from commit 93e6f4f05ba885b16accf0ad811160dd7d0eec70)

2 years agoUpdate to flake8 5.
Federico Caselli [Sun, 31 Jul 2022 09:56:07 +0000 (11:56 +0200)] 
Update to flake8 5.

Change-Id: I5a241a70efba68bcea9819ddce6aebc25703e68d
(cherry picked from commit f8c4dba4e9f130c18ce00597c036bc26ae7abf90)

2 years agouse inherited members for Query
Mike Bayer [Sat, 30 Jul 2022 19:14:23 +0000 (15:14 -0400)] 
use inherited members for Query

not sure why these four methods were here, they don't
get sorted when doing it this way.

Change-Id: I554f132df3f299858ca5b451a79fbd9dd1f520ee
(cherry picked from commit 14bfbadfdf9260a1c40f63b31641b27fe9de12a0)

2 years agoglossary: update the acronym definition (#8306)
bbben [Sat, 30 Jul 2022 18:43:59 +0000 (02:43 +0800)] 
glossary: update the acronym definition (#8306)

* glossary: fix typo

* add 'Read' to the CRUD definition

(cherry picked from commit b86112fd85c7810424308d3864a67462fbc9288c)

2 years agoglossary: primary_key needs value (#8298)
Fabian Preiß [Sat, 30 Jul 2022 10:47:15 +0000 (12:47 +0200)] 
glossary: primary_key needs value (#8298)

(cherry picked from commit 8076f9f590bdf9d7d138bae3408b81e59771dbd5)

2 years agolink to index correctly
Mike Bayer [Sat, 30 Jul 2022 04:30:28 +0000 (00:30 -0400)] 
link to index correctly

Fixes: #8303
Change-Id: If3568309e4dd3e9ef715b32f9ad90eeba7f662e8
(cherry picked from commit 0c30dcfb4ba45400cf7df9056c53e4ad7fef1ad2)

3 years agoUpdate metadata.rst (#8290)
Paul Lettich [Tue, 26 Jul 2022 21:28:28 +0000 (23:28 +0200)] 
Update metadata.rst (#8290)

add missing colon in docs

(cherry picked from commit 2ab519f59cf81307966dba3d5b8a176d45deb297)

3 years agoremove mypy_path workaround and ensure messages received
Mike Bayer [Sat, 23 Jul 2022 14:18:06 +0000 (10:18 -0400)] 
remove mypy_path workaround and ensure messages received

Fixes: #8281
Change-Id: Ice47880ba7924daff68aef6b1791f3c66849f550
(cherry picked from commit 4fe222d9412df30fc15ace3d7a7fd4365eb9e05a)

3 years agoclarify update perf test has only one test so far
Mike Bayer [Thu, 21 Jul 2022 13:41:50 +0000 (09:41 -0400)] 
clarify update perf test has only one test so far

this was pretty misleading as it shows up first in the
file listing

Change-Id: I6a92820e487a04632b651f9f6c631b32e338c043
(cherry picked from commit b9043754f039ff5b2bdf2379bd3d89eadd81e96d)

3 years agoMerge "check for TypeDecorator when handling getitem" into rel_1_4
mike bayer [Tue, 19 Jul 2022 17:57:22 +0000 (17:57 +0000)] 
Merge "check for TypeDecorator when handling getitem" into rel_1_4

3 years agocheck for TypeDecorator when handling getitem
Mike Bayer [Tue, 19 Jul 2022 14:50:05 +0000 (10:50 -0400)] 
check for TypeDecorator when handling getitem

Fixed issue where :class:`.TypeDecorator` would not correctly proxy the
``__getitem__()`` operator when decorating the :class:`.ARRAY` datatype,
without explicit workarounds.

Fixes: #7249
Change-Id: I3273572b4757e41fb5952639cb867314227d368a
(cherry picked from commit 1e01fab7e600c53284eabceceab5706e4074eb2e)

3 years agorender all three elements selected in bundle example
Mike Bayer [Tue, 19 Jul 2022 15:13:59 +0000 (11:13 -0400)] 
render all three elements selected in bundle example

Fixes: #8013
Change-Id: I9b5f800d94abd80d07ca5f58c24f111618415674
(cherry picked from commit eefc8c985400cd458e561d61299a2b81bdff1189)

3 years agoadd shield() in aexit
Federico Caselli [Fri, 17 Jun 2022 21:12:39 +0000 (23:12 +0200)] 
add shield() in aexit

Added ``asyncio.shield()`` to the connection and session release process
specifically within the ``__aexit__()`` context manager exit, when using
:class:`.AsyncConnection` or :class:`.AsyncSession` as a context manager
that releases the object when the context manager is complete. This appears
to help with task cancellation when using alternate concurrency libraries
such as ``anyio``, ``uvloop`` that otherwise don't provide an async context
for the connection pool to release the connection properly during task
cancellation.

Fixes: #8145
Change-Id: I0b1ea9c3a22a18619341cbb8591225fcd339042c
(cherry picked from commit 1acaf0b2e4859a274e753b5054dcde3d5c7ca10e)

3 years agouse concat() directly for contains, startswith, endswith
Mike Bayer [Sun, 17 Jul 2022 15:32:27 +0000 (11:32 -0400)] 
use concat() directly for contains, startswith, endswith

Adjusted the SQL compilation for string containment functions
``.contains()``, ``.startswith()``, ``.endswith()`` to force the use of the
string concatenation operator, rather than relying upon the overload of the
addition operator, so that non-standard use of these operators with for
example bytestrings still produces string concatenation operators.

To accommodate this, needed to add a new _rconcat operator function,
which is private, as well as a fallback in concat_op() that works
similarly to Python builtin ops.

Fixes: #8253
Change-Id: I2b7f56492f765742d88cb2a7834ded6a2892bd7e
(cherry picked from commit 85a88df13ab8d217331cf98392544a888b4d7df3)

3 years agoremove needlessly complex assoc proxy mixin example
Mike Bayer [Fri, 15 Jul 2022 16:53:37 +0000 (12:53 -0400)] 
remove needlessly complex assoc proxy mixin example

this is some very exotic example that doesn't really
explain anything new about mixins and only serves
to make the docs less accessible.

Change-Id: Ic51a12de3358f3a451bd7cf3542b375569499fc1
(cherry picked from commit 68d882387978d60dd354ba067de85ea298940376)

3 years agostep five
Mike Bayer [Fri, 15 Jul 2022 12:55:08 +0000 (08:55 -0400)] 
step five

Change-Id: Ib6242d676c800b4b679aaf7f33f641ebcaed5b33
(cherry picked from commit a0597341195ba7445ef1e9c69092e3bd29427aec)

3 years agodocument create_engine.isolation_level for PG
Mike Bayer [Wed, 13 Jul 2022 15:02:37 +0000 (11:02 -0400)] 
document create_engine.isolation_level for PG

Change-Id: I06eaede9e021eb0790929168e9bedb0c8b58140a
References: #8252
(cherry picked from commit a3a3299b5b9728a432ba900754047844ecfb98d6)

3 years agolink to main isolation level document
Mike Bayer [Wed, 13 Jul 2022 14:54:52 +0000 (10:54 -0400)] 
link to main isolation level document

this was already in 2.0.  a few more corrections coming

Change-Id: Id94eee9081fd5174bad2275f544010e7cb467454
references: #8252

3 years agoUpdate docs for association_proxy
Gord Thompson [Fri, 8 Jul 2022 17:50:54 +0000 (11:50 -0600)] 
Update docs for association_proxy

Make naming more consistent and explicit

Change-Id: If90de9ab8b10348d6d1547b9fd6e3b2c312d9ee8
(cherry picked from commit 9f295d1e9ce9ffbdd93e6d9e2537fd9a353c1a2f)

3 years agosupport "SELECT *" for ORM queries
Mike Bayer [Mon, 11 Jul 2022 01:24:17 +0000 (21:24 -0400)] 
support "SELECT *" for ORM queries

A :func:`_sql.select` construct that is passed a sole '*' argument for
``SELECT *``, either via string, :func:`_sql.text`, or
:func:`_sql.literal_column`, will be interpreted as a Core-level SQL
statement rather than as an ORM level statement. This is so that the ``*``,
when expanded to match any number of columns, will result in all columns
returned in the result. the ORM- level interpretation of
:func:`_sql.select` needs to know the names and types of all ORM columns up
front which can't be achieved when ``'*'`` is used.

If ``'*`` is used amongst other expressions simultaneously with an ORM
statement, an error is raised as this can't be interpreted correctly by the
ORM.

Fixes: #8235
Change-Id: Ic8e84491e14acdc8570704eadeaeaf6e16b1e870
(cherry picked from commit 3916bfc9ccf2904f69498075849a82ceee225b3a)

3 years agodocument using fetch() with Oracle
Mike Bayer [Thu, 7 Jul 2022 15:44:09 +0000 (11:44 -0400)] 
document using fetch() with Oracle

We implemented working FETCH support, but it's not
yet implied by limit/offset.  The docs make no mention
that this is available which is very misleading including
to maintainers.    Make it clear that fetch() support is
there right now, it's just not yet implicit with
limit/offset.

Change-Id: Ib2231dcdd80a8bf3ac4bbf590e1a8dfeac31e9da
References: #8221
(cherry picked from commit 805a1323b973a30af99ce506dd5c5c4ab96cff0f)

3 years agogeneralize sql server check for id col to accommodate ORM cases
Mike Bayer [Wed, 6 Jul 2022 01:05:18 +0000 (21:05 -0400)] 
generalize sql server check for id col to accommodate ORM cases

Fixed issues that prevented the new usage patterns for using DML with ORM
objects presented at :ref:`orm_dml_returning_objects` from working
correctly with the SQL Server pyodbc dialect.

Here we add a step to look in compile_state._dict_values more thoroughly
for the keys we need to determine "identity insert" or not, and also
add a new compiler variable dml_compile_state so that we can skip the
ORM's compile_state if present.

Fixes: #8210
Change-Id: Idbd76bb3eb075c647dc6c1cb78f7315c821e15f7
(cherry picked from commit 5806428800d2f1ac775156f90497a2fc3a644f35)

3 years agoMerge "move backref to "legacy"" into rel_1_4
mike bayer [Mon, 4 Jul 2022 18:14:04 +0000 (18:14 +0000)] 
Merge "move backref to "legacy"" into rel_1_4

3 years agoMerge "Support lambda expression in mypy plugin" into rel_1_4
mike bayer [Mon, 4 Jul 2022 18:13:42 +0000 (18:13 +0000)] 
Merge "Support lambda expression in mypy plugin" into rel_1_4

3 years agomove backref to "legacy"
Mike Bayer [Mon, 4 Jul 2022 17:05:37 +0000 (13:05 -0400)] 
move backref to "legacy"

in the interests of consistency as well as new typing features,
backref should be considered legacy and is fully superseded
by back_populates.

this commit is for 2.0 /1.4, in 2.0 further updates will be
made for new ORM syntaxes.

Change-Id: Idd3b7a3b07843b73304df69e476dc4239c60b3f8
(cherry picked from commit d49dfa74e86778eb5c581470405131ed9f9d0206)

3 years agofix formatting problems
Mike Bayer [Sun, 3 Jul 2022 15:09:16 +0000 (11:09 -0400)] 
fix formatting problems

Change-Id: Ib55fe1c60130a45bfbf28de5c74cfe7a30418bb3
(cherry picked from commit 4b3f204d07d53ae09b59ce8f33b534f26a605cd4)

3 years agodont use import * in any docs, ever
Mike Bayer [Sun, 3 Jul 2022 15:01:25 +0000 (11:01 -0400)] 
dont use import * in any docs, ever

(cherry picked from commit 9ab7b9a624cf5dfed93e0927eb4b3b62fe87e5ae)

3 years agochore: Set permissions for GitHub actions (#8117)
Naveen [Sat, 2 Jul 2022 21:58:16 +0000 (16:58 -0500)] 
chore: Set permissions for GitHub actions (#8117)

Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
(cherry picked from commit a8af28c99431fb62243f025cdea18099dde0c844)

3 years agoSupport lambda expression in mypy plugin
Cyril Chapellier [Thu, 30 Jun 2022 12:59:38 +0000 (14:59 +0200)] 
Support lambda expression in mypy plugin

Avoid `error: INTERNAL ERROR` when the default is a lambda

Fixes: #8196
Change-Id: I7346c693519b024c56156db6f4ffc9a45bb748d3
(cherry picked from commit 472dc0735c4d9385b05e5e2088dad9f507a59a63)

3 years agoclarify eager loading terminology
Mike Bayer [Fri, 1 Jul 2022 18:35:27 +0000 (14:35 -0400)] 
clarify eager loading terminology

Change-Id: Idb27ec5f09ef958d71738e1095b4be7a1377eecb
(cherry picked from commit 4b5ed6ad27b3b63ecf1b082653e2e3ee0abb887f)

3 years agorepair yield_per for non-SS dialects and add new options
Mike Bayer [Thu, 30 Jun 2022 23:10:06 +0000 (19:10 -0400)] 
repair yield_per for non-SS dialects and add new options

Implemented new :paramref:`_engine.Connection.execution_options.yield_per`
execution option for :class:`_engine.Connection` in Core, to mirror that of
the same :ref:`yield_per <orm_queryguide_yield_per>` option available in
the ORM. The option sets both the
:paramref:`_engine.Connection.execution_options.stream_results` option at
the same time as invoking :meth:`_engine.Result.yield_per`, to provide the
most common streaming result configuration which also mirrors that of the
ORM use case in its usage pattern.

Fixed bug in :class:`_engine.Result` where the usage of a buffered result
strategy would not be used if the dialect in use did not support an
explicit "server side cursor" setting, when using
:paramref:`_engine.Connection.execution_options.stream_results`. This is in
error as DBAPIs such as that of SQLite and Oracle already use a
non-buffered result fetching scheme, which still benefits from usage of
partial result fetching.   The "buffered" strategy is now used in all
cases where :paramref:`_engine.Connection.execution_options.stream_results`
is set.

Added :meth:`.FilterResult.yield_per` so that result implementations
such as :class:`.MappingResult`, :class:`.ScalarResult` and
:class:`.AsyncResult` have access to this method.

Fixes: #8199
Change-Id: I6dde3cbe483a1bf81e945561b60f4b7d1c434750
(cherry picked from commit e5a0cdb2eaa1d7f381e93d0529a7f8e6d5888877)

3 years agomore partition doc adjustments
Mike Bayer [Thu, 30 Jun 2022 19:00:08 +0000 (15:00 -0400)] 
more partition doc adjustments

the partition story is not very good, this is a ton
of different options and they have to all be used
simultaenously for the common case.

Change-Id: I62963b7db1230a2670dda0ce812086f9265a3cb7
(cherry picked from commit aae1696a64509e54efd7d59a137c5ea6743363a7)

3 years agoadd more cross-linking / notes for yield_per, partitions
Mike Bayer [Thu, 30 Jun 2022 17:33:30 +0000 (13:33 -0400)] 
add more cross-linking / notes for yield_per, partitions

Change-Id: I0f8db2532827c76a2751186638d22104230db843
references: #8198
(cherry picked from commit 59bafe0fbefe16269c72ac39e699e4127d49841f)

3 years agoMerge "produce column copies up the whole hierarchy first" into rel_1_4
mike bayer [Wed, 29 Jun 2022 16:52:57 +0000 (16:52 +0000)] 
Merge "produce column copies up the whole hierarchy first" into rel_1_4

3 years agofix documentation typo
Jefferson Oliveira [Wed, 29 Jun 2022 14:53:36 +0000 (11:53 -0300)] 
fix documentation typo

(cherry picked from commit 52317cec36e1807d06a9715e2bcc4067b7eb173f)

3 years agoproduce column copies up the whole hierarchy first
Mike Bayer [Tue, 28 Jun 2022 22:55:19 +0000 (18:55 -0400)] 
produce column copies up the whole hierarchy first

Fixed issue where a hierarchy of classes set up as an abstract or mixin
declarative classes could not declare standalone columns on a superclass
that would then be copied correctly to a :class:`_orm.declared_attr`
callable that wanted to make use of them on a descendant class.

Originally it looked like this would produce an ordering change,
however an adjustment to the flow for produce_column_copies
has avoided that for now.

Fixes: #8190
Change-Id: I4e2ee74edb110793eb42691c3e4a0e0535fba7e9
(cherry picked from commit 9d12d493eb38f958c2d50da28f83ccc6de01f0dc)

3 years ago8152: add documentation for postgresql dialect time and timestamp types
Daniel Hall [Tue, 28 Jun 2022 19:03:34 +0000 (15:03 -0400)] 
8152: add documentation for postgresql dialect time and timestamp types

add documentation for postgresql dialect time and timestamp types

This pull request is:

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

**Have a nice day!**

Closes: #8185
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8185
Pull-request-sha: 2b76fe080babd72f8e5615b34cb544abbc446a28

Change-Id: Ib71b35d106d0d0686e5551f07b88486b6c59624d
(cherry picked from commit 300ce85463474c0264b37c0f2a8baa5f3cf3d822)

3 years agoblock mariadb 1.1.2
Mike Bayer [Tue, 28 Jun 2022 14:18:58 +0000 (10:18 -0400)] 
block mariadb 1.1.2

regression causing unicode schema queries to fail

Change-Id: Ie66ca038357ec90804a357979d4fd22611c47340
References: https://jira.mariadb.org/browse/CONPY-209
(cherry picked from commit f19e50ab75cfc904acef31434c92542f3ab50d61)

3 years agoVersion 1.4.40 placeholder
Mike Bayer [Fri, 24 Jun 2022 16:20:36 +0000 (12:20 -0400)] 
Version 1.4.40 placeholder

3 years ago- 1.4.39 rel_1_4_39
Mike Bayer [Fri, 24 Jun 2022 16:15:11 +0000 (12:15 -0400)] 
- 1.4.39