]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
4 years agoFix typo in docs 6013/head
michaeltoohig [Mon, 8 Mar 2021 04:32:07 +0000 (15:32 +1100)] 
Fix typo in docs

4 years agoMerge "Add supported database version for internal dialects"
mike bayer [Sun, 7 Mar 2021 18:11:41 +0000 (18:11 +0000)] 
Merge "Add supported database version for internal dialects"

4 years agoAdd supported database version for internal dialects
Federico Caselli [Sat, 13 Feb 2021 20:20:58 +0000 (21:20 +0100)] 
Add supported database version for internal dialects

Change-Id: I08d150f1780a0f3a848c0edcd40013b5593d18f0

4 years agoMerge "Ignore flake8 F401 on specific files"
mike bayer [Sun, 7 Mar 2021 16:33:40 +0000 (16:33 +0000)] 
Merge "Ignore flake8 F401 on specific files"

4 years agoMerge "Ensure all Query statements compile w/ orm, fix test harness"
mike bayer [Sun, 7 Mar 2021 16:32:19 +0000 (16:32 +0000)] 
Merge "Ensure all Query statements compile w/ orm, fix test harness"

4 years agoMerge "Fix named CHECK constraint name omitted on repeated creates"
mike bayer [Sun, 7 Mar 2021 16:30:34 +0000 (16:30 +0000)] 
Merge "Fix named CHECK constraint name omitted on repeated creates"

4 years agoMerge "Replace reset_agent with direct call from connection"
mike bayer [Sun, 7 Mar 2021 16:27:56 +0000 (16:27 +0000)] 
Merge "Replace reset_agent with direct call from connection"

4 years agoReplace reset_agent with direct call from connection
Mike Bayer [Fri, 5 Mar 2021 22:34:10 +0000 (17:34 -0500)] 
Replace reset_agent with direct call from connection

Fixed a regression where the "reset agent" of the connection pool wasn't
really being utilized by the :class:`_engine.Connection` when it were
closed, and also leading to a double-rollback scenario that was somewhat
wasteful.   The newer architecture of the engine has been updated so that
the connection pool "reset-on-return" logic will be skipped when the
:class:`_engine.Connection` explicitly closes out the transaction before
returning the pool to the connection.

Fixes: #6004
Change-Id: I5d2ac16cac71aa45a00b4b7481d7268bd828a168

4 years agoFix named CHECK constraint name omitted on repeated creates
Gord Thompson [Sat, 6 Mar 2021 19:19:13 +0000 (12:19 -0700)] 
Fix named CHECK constraint name omitted on repeated creates

Fixed issue where the CHECK constraint generated by :class:`_types.Boolean`
or :class:`_types.Enum` would fail to render the naming convention
correctly after the first compilation, due to an unintended change of state
within the name given to the constraint. This issue was first introduced in
0.9 in the fix for issue #3067, and the fix revises the approach taken at
that time which appears to have been more involved than what was needed.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #6007
Change-Id: I7ecff0a9d86191520f6841b3922a5af5a6971fba

4 years agoimprove targeting and labeling for unary() in columns clause
Mike Bayer [Sat, 6 Mar 2021 02:52:03 +0000 (21:52 -0500)] 
improve targeting and labeling for unary() in columns clause

Fixed regression where usage of the standalone :func:`_sql.distinct()` used
in the form of being directly SELECTed would fail to be locatable in the
result set by column identity, which is how the ORM locates columns. While
standalone :func:`_sql.distinct()` is not oriented towards being directly
SELECTed (use :meth:`_sql.select.distinct` for a regular
``SELECT DISTINCT..``) , it was usable to a limited extent in this way
previously (but wouldn't work in subqueries, for example). The column
targeting for unary expressions such as "DISTINCT <col>" has been improved
so that this case works again, and an additional improvement has been made
so that usage of this form in a subquery at least generates valid SQL which
was not the case previously.

The change additionally enhances the ability to target elements in
``row._mapping`` based on SQL expression objects in ORM-enabled
SELECT statements, including whether the statement was invoked by
``connection.execute()`` or ``session.execute()``.

Fixes: #6008
Change-Id: I5cfa39435f5418861d70a7db8f52ab4ced6a792e

4 years agoMerge "Clarify COMMIT/ROLLBACK logging when autocommit is turned on"
mike bayer [Fri, 5 Mar 2021 21:21:59 +0000 (21:21 +0000)] 
Merge "Clarify COMMIT/ROLLBACK logging when autocommit is turned on"

4 years agoEnsure all Query statements compile w/ orm, fix test harness
Mike Bayer [Fri, 5 Mar 2021 21:02:38 +0000 (16:02 -0500)] 
Ensure all Query statements compile w/ orm, fix test harness

Fixed regression where :meth:`_orm.Query.join` would produce no effect if
the query itself as well as the join target were against a
:class:`_schema.Table` object, rather than a mapped class. This was part of
a more systemic issue where the legacy ORM query compiler would not be
correctly used from a :class:`_orm.Query` if the statement produced had not
ORM entities present within it.

Also repair the assert_compile() method, which was using
Query._compile_state() which was bypassing the bug.   A handful
of ORM tests with Query objects and Core-only objects were actually
failing if the default compilation path were used.

Fixes: #6003
Change-Id: I97478b2d06bf6c01fe1f09ee118e1f2ac4c849bc

4 years agoClarify COMMIT/ROLLBACK logging when autocommit is turned on
Mike Bayer [Fri, 5 Mar 2021 17:27:09 +0000 (12:27 -0500)] 
Clarify COMMIT/ROLLBACK logging when autocommit is turned on

Improved engine logging to note ROLLBACK and COMMIT which is logged while
the DBAPI driver is in AUTOCOMMIT mode. These ROLLBACK/COMMIT are library
level and do not have any effect when AUTOCOMMIT is in effect, however it's
still worthwhile to log as these indicate where SQLAlchemy sees the
"transaction" demarcation.

Fixes: #6002
Change-Id: I723636515193e0addc86dd0a3132bc23deadb81b

4 years agoreduce confusion over "one choice" verbiage
Mike Bayer [Fri, 5 Mar 2021 17:45:11 +0000 (12:45 -0500)] 
reduce confusion over "one choice" verbiage

I was trying to be funny with the "one and a half" choices
but this has been misleading some users, so clarify what
is meant.

Change-Id: I5451aa992ba870e0435e9b49eabb0e35b9976d59

4 years agoensure composite refresh handler synced w/ mutable composite
Mike Bayer [Fri, 5 Mar 2021 04:38:34 +0000 (23:38 -0500)] 
ensure composite refresh handler synced w/ mutable composite

Fixed issue where the :class:`_mutable.MutableComposite` construct could be
placed into an invalid state when the parent object was already loaded, and
then covered by a subsequent query, due to the composite properties'
refresh handler replacing the object with a new one not handled by the
mutable extension.

Fixes: #6001
Change-Id: Ieebd8e6afe6b65f8902cc12dec1efb968f5438ef

4 years agoMerge "Fix aggregate_order_by issue"
mike bayer [Thu, 4 Mar 2021 19:11:52 +0000 (19:11 +0000)] 
Merge "Fix aggregate_order_by issue"

4 years agouse zimports 0.3
Mike Bayer [Thu, 4 Mar 2021 16:11:48 +0000 (11:11 -0500)] 
use zimports 0.3

Change-Id: Ice8b9f9c1ef1446b6813e5bc9332f1323234cb5f

4 years agoFix aggregate_order_by issue
Gord Thompson [Thu, 4 Mar 2021 13:55:53 +0000 (06:55 -0700)] 
Fix aggregate_order_by issue

Fixes: #5989
Using array_agg() with aggregate_order_by() in
postgresql would sometimes return ARRAY(NullType)
instead of ARRAY(actual_type).

Change-Id: I05a0b2b7ea59291e3c04575578adcc337296e5a8

4 years agoIgnore flake8 F401 on specific files
Federico Caselli [Mon, 8 Feb 2021 21:12:06 +0000 (22:12 +0100)] 
Ignore flake8 F401 on specific files

Uses the flake8 option per-file-ignores that was introduced in a recent
version of flake8 (3.7.+) to avoid having lots of "noqa" in import
only files

Change-Id: Ib4871d63bad7e578165615df139cbf6093479201

4 years agoRemove passive_deletes warning for many-to-one
Mike Bayer [Tue, 2 Mar 2021 23:48:08 +0000 (18:48 -0500)] 
Remove passive_deletes warning for many-to-one

Removed very old warning that states that passive_deletes is not intended
for many-to-one relationships. While it is likely that in many cases
placing this parameter on a many-to-one relationship is not what was
intended, there are use cases where delete cascade may want to be
disallowed following from such a relationship.

Change-Id: I07adb726633f73f26296add4ec70376d5dcf8817
References: #5983

4 years agoadd missing copyright to asyncio files
Mike Bayer [Tue, 2 Mar 2021 21:25:09 +0000 (16:25 -0500)] 
add missing copyright to asyncio files

Change-Id: I6028b70bba76d6d9e1042762423d61f83644c085

4 years agoconvert AsyncSession.delete into awaitable
Mike Bayer [Tue, 2 Mar 2021 16:16:49 +0000 (11:16 -0500)] 
convert AsyncSession.delete into awaitable

The API for :meth:`_asyncio.AsyncSession.delete` is now an awaitable;
this method cascades along relationships which must be loaded in a
similar manner as the :meth:`_asyncio.AsyncSession.merge` method.

Fixes: #5998
Change-Id: Iae001efe99a1dcc47598b4a2491d17c4157fbbfa

4 years agoMerge remote-tracking branch 'origin/pr/5972'
Mike Bayer [Mon, 1 Mar 2021 14:04:54 +0000 (09:04 -0500)] 
Merge remote-tracking branch 'origin/pr/5972'

Change-Id: I754960d6fb68ef8413734f0dd6c17236f6dea16e

4 years agoMerge "disable all raiseload within the unit of work process."
mike bayer [Mon, 1 Mar 2021 12:38:11 +0000 (12:38 +0000)] 
Merge "disable all raiseload within the unit of work process."

4 years agodoc clarification re: schema translate
Mike Bayer [Mon, 1 Mar 2021 12:33:13 +0000 (07:33 -0500)] 
doc clarification re: schema translate

add tip that ORM session should use an option engine for schema
translate

Change-Id: I5807b486275cac72087be5217fff7c878783435f
References: #5978

4 years agodisable all raiseload within the unit of work process.
Mike Bayer [Fri, 26 Feb 2021 04:20:05 +0000 (23:20 -0500)] 
disable all raiseload within the unit of work process.

The unit of work process now turns off all "lazy='raise'" behavior
altogether when a flush is proceeding.  While there are areas where the UOW
is sometimes loading things that aren't ultimately needed, the lazy="raise"
strategy is not helpful here as the user often does not have much control
or visibility into the flush process.

Fixes: #5984
Change-Id: I23f2e332a5faa5c7c29823c9be9434d129676a5a

4 years agoMerge "support stringify for plain CTE"
mike bayer [Sun, 28 Feb 2021 16:16:09 +0000 (16:16 +0000)] 
Merge "support stringify for plain CTE"

4 years agosupport stringify for plain CTE
Mike Bayer [Sat, 27 Feb 2021 17:48:54 +0000 (12:48 -0500)] 
support stringify for plain CTE

Altered the compilation for the :class:`.CTE` construct so that a string is
returned representing the inner SELECT statement if the :class:`.CTE` is
stringified directly, outside of the context of an enclosing SELECT; This
is the same behavior of :meth:`_FromClause.alias` and
:meth:`_SelectStatement.subquery`. Previously, a blank string would be
returned as the CTE is normally placed above a SELECT after that SELECT has
been generated, which is generally misleading when debugging.

Change-Id: Id3007c28e4a7a56d867e850bb890752946bd8f6f
References: #5988

4 years agoAdd missing colon before code block in docs
Federico Caselli [Fri, 26 Feb 2021 20:30:32 +0000 (21:30 +0100)] 
Add missing colon before code block in docs

Change-Id: Iee0ec6906fe21674a16c20dfd267468ebfe39c3f

4 years agoMerge "document declarative base made non-dynamically"
mike bayer [Fri, 26 Feb 2021 15:28:30 +0000 (15:28 +0000)] 
Merge "document declarative base made non-dynamically"

4 years agoMerge "implement visit_unsupported_compilation for TypeCompiler"
mike bayer [Fri, 26 Feb 2021 15:25:19 +0000 (15:25 +0000)] 
Merge "implement visit_unsupported_compilation for TypeCompiler"

4 years agoMerge "Revert AppenderQuery modifications from ORM"
mike bayer [Fri, 26 Feb 2021 15:24:15 +0000 (15:24 +0000)] 
Merge "Revert AppenderQuery modifications from ORM"

4 years agoMerge "Add reflection_options to automapbase.prepare()"
mike bayer [Fri, 26 Feb 2021 15:22:28 +0000 (15:22 +0000)] 
Merge "Add reflection_options to automapbase.prepare()"

4 years agoRevert AppenderQuery modifications from ORM
Mike Bayer [Thu, 25 Feb 2021 22:07:06 +0000 (17:07 -0500)] 
Revert AppenderQuery modifications from ORM

We are unfortunately stuck with this class completely
until we get rid of "dynamic" altogether.    The usage
contract includes the "query_class" mixin feature where
users add their own methods, and this use case  very
well in line with 2.0's contract.  As Query is not going away
in any case this has to stay in "legacy" style, there's no
point trying to change it as the new version was still fully
dependent on Query.

Fixes: #5981
Change-Id: I1bc623b17d976b4bb417ab623248d4ac227db74d

4 years agoimplement visit_unsupported_compilation for TypeCompiler
Mike Bayer [Thu, 25 Feb 2021 21:18:12 +0000 (16:18 -0500)] 
implement visit_unsupported_compilation for TypeCompiler

Fixed regression where the "unsupported compilation error" for unknown
datatypes would fail to raise correctly.

Fixes: #5979
Change-Id: I984fe95666813832ab5bdfc568322e2aa7cc3db0

4 years agoAdd reflection_options to automapbase.prepare()
Gord Thompson [Tue, 16 Feb 2021 19:35:32 +0000 (12:35 -0700)] 
Add reflection_options to automapbase.prepare()

Fixes: #5942
Change-Id: If72ccca93fbe303799b1bacb7339c4c85e4251aa

4 years agomutex asyncpg / aiomysql connection state changes
Mike Bayer [Tue, 23 Feb 2021 02:49:09 +0000 (21:49 -0500)] 
mutex asyncpg / aiomysql connection state changes

Added an ``asyncio.Lock()`` within SQLAlchemy's emulated DBAPI cursor,
local to the connection, for the asyncpg dialect, so that the space between
the call to ``prepare()`` and ``fetch()`` is prevented from allowing
concurrent executions on the connection from causing interface error
exceptions, as well as preventing race conditions when starting a new
transaction. Other PostgreSQL DBAPIs are threadsafe at the connection level
so this intends to provide a similar behavior, outside the realm of server
side cursors.

Apply the same idea to the aiomysql dialect which also would
otherwise be subject to corruption if the connection were used
concurrently.

While this is an issue which can also occur with the threaded
connection libraries, we anticipate asyncio users are more likely
to attempt using the same connection in multiple awaitables
at a time, even though this won't achieve concurrency for that
use case, as the asyncio programming style is very encouraging
of this.  As the failure modes are also more complicated under
asyncio, we'd rather not have this being reported.

Fixes: #5967
Change-Id: I3670ba0c8f0b593c587c5aa7c6c61f9e8c5eb93a

4 years agodocument declarative base made non-dynamically
Mike Bayer [Sat, 20 Feb 2021 17:19:30 +0000 (12:19 -0500)] 
document declarative base made non-dynamically

officially document how to make declarative base
non-dynamically such that mypy and similar tools
can process it without plugins

Change-Id: I884f9a7c06c4a8b8111948a2dd64e308e7dce4fc
References: #4609

4 years agodon't assume ordering in test_update_explicit_returning
Mike Bayer [Thu, 25 Feb 2021 00:43:29 +0000 (19:43 -0500)] 
don't assume ordering in test_update_explicit_returning

Change-Id: I25b090f4974255b6852defd45d1c9afb07b61080

4 years agoMerge "mssql+pyodbc specify ampersand separator"
mike bayer [Thu, 25 Feb 2021 00:37:12 +0000 (00:37 +0000)] 
Merge "mssql+pyodbc specify ampersand separator"

4 years agoMerge "Minor optimization to the code"
mike bayer [Wed, 24 Feb 2021 16:33:52 +0000 (16:33 +0000)] 
Merge "Minor optimization to the code"

4 years agoAdd example for cx_Oracle SessionPool use
Mike Bayer [Wed, 24 Feb 2021 15:57:35 +0000 (10:57 -0500)] 
Add example for cx_Oracle SessionPool use

Change-Id: I88fe16764922ac567a89b8ac2c87402b9b693de9

4 years agomssql+pyodbc specify ampersand separator
Gord Thompson [Wed, 24 Feb 2021 15:51:55 +0000 (08:51 -0700)] 
mssql+pyodbc specify ampersand separator

Specify that ampersand (not semicolon) must be used to separate
additional keyword arguments in hostname connections.

Change-Id: Id5b3276e6da8d42f5384e3cc4f5272f6e20aa61c

4 years agoAs of 1.1, there are five object states 5972/head
John Whitlock [Wed, 24 Feb 2021 15:41:02 +0000 (09:41 -0600)] 
As of 1.1, there are five object states

4 years agorefer to row elements as "elements", not columns
Mike Bayer [Tue, 23 Feb 2021 03:14:41 +0000 (22:14 -0500)] 
refer to row elements as "elements", not columns

disambiguate between the "elements of a row" and
a "column" which is taken to mean a database column, and
remove confusing terms like "single-column ORM entity".

Change-Id: I7304bdb6dd0f60ab0c36ef3ae40b1f36b29ea291

4 years agodocument TypeDecorator schemes for MONEY
Mike Bayer [Mon, 22 Feb 2021 14:55:21 +0000 (09:55 -0500)] 
document TypeDecorator schemes for MONEY

this type apparently returns strings so document
cast/processing options.

Change-Id: Idc19527dcf76e1c2d966425716c0fcf60cbba5dc
References: #5965

4 years agoadd versions for pre-commit tools
Mike Bayer [Sat, 20 Feb 2021 20:54:43 +0000 (15:54 -0500)] 
add versions for pre-commit tools

latest pre-commit is warning for use of "master" so apply version
numbers

Change-Id: I441ae9e29f53f1c99825c12f5fa03163e88ee9ea

4 years agoTypo stream_resuls -> stream_results 5960/head
Charlie Denton [Fri, 19 Feb 2021 16:29:49 +0000 (16:29 +0000)] 
Typo stream_resuls -> stream_results

4 years agoMerge "Deprecate and rename schema .copy() methods"
mike bayer [Fri, 19 Feb 2021 00:57:08 +0000 (00:57 +0000)] 
Merge "Deprecate and rename schema .copy() methods"

4 years agoFix test that incorrectly used ; as query separator
Federico Caselli [Thu, 18 Feb 2021 21:21:54 +0000 (22:21 +0100)] 
Fix test that incorrectly used ; as query separator

Change-Id: I31e9973930d90184bbabda0bff6346eca4e00c37

4 years agoDeprecate and rename schema .copy() methods
Gord Thompson [Wed, 17 Feb 2021 18:58:27 +0000 (11:58 -0700)] 
Deprecate and rename schema .copy() methods

Fixes: #5953
Change-Id: I1e69a1628e408f06b43efbc0cc52fc0ad1e8cbc4

4 years agoMerge "Update the create wheel action:"
mike bayer [Thu, 18 Feb 2021 20:21:27 +0000 (20:21 +0000)] 
Merge "Update the create wheel action:"

4 years agoUpdate the create wheel action:
Federico Caselli [Thu, 18 Feb 2021 20:05:05 +0000 (21:05 +0100)] 
Update the create wheel action:

- use manylinux1 for python 2 since manylinux2010 has dropped
  support for it
- use a different action to upload the artifacts to the release so
  that a single step can be used
- also generate manylinux2014 wheels for python3

Change-Id: Ibc1cc31737a90c40afc7988308c58b471d2fec2f

4 years agoMinor optimization to the code
Federico Caselli [Thu, 18 Feb 2021 18:12:45 +0000 (19:12 +0100)] 
Minor optimization to the code

* remove the c version of distill params since it's actually slower than
the python one
* add a function to langhelpers to check if the cextensions are active
* minor cleanup to the OrderedSet implementation

Change-Id: Iec3d0c3f0f42cdf51f802aaca342ba37b8783b85

4 years agoFix a reflection error for MSSQL 2005
Federico Caselli [Thu, 18 Feb 2021 17:57:02 +0000 (18:57 +0100)] 
Fix a reflection error for MSSQL 2005

The reflection of filtered indexes broke index reflection error
for MSSQL 2005 that does not support that them

Fixes #5930

Change-Id: I5d1f4fa8ba5bca31e91981076e4ee476ddfba49a

4 years agoFix typo on tutorial/data.rst
Federico Caselli [Thu, 18 Feb 2021 17:51:18 +0000 (18:51 +0100)] 
Fix typo on tutorial/data.rst

Change-Id: Ib7f7a92e2ae15c732659525170118288aebad9a2

4 years agoExtract table names when comparing to nrte error
Mike Bayer [Thu, 18 Feb 2021 15:43:16 +0000 (10:43 -0500)] 
Extract table names when comparing to nrte error

Fixed issue where the process of joining two tables could fail if one of
the tables had an unrelated, unresolvable foreign key constraint which
would raise :class:`_exc.NoReferenceError` within the join process, which
nonetheless could be bypassed to allow the join to complete. The logic
which tested the exception for signficance within the process would make
assumptions about the construct which would fail.

Fixes: #5952
Change-Id: I492dacd082ddcf8abb1310ed447a6ed734595bb7

4 years agoUpdate declarative_mixins.rst 5946/head
serzey [Tue, 16 Feb 2021 09:10:03 +0000 (10:10 +0100)] 
Update declarative_mixins.rst

Variables ta and tb should be instances of TypeA and TypeB respectively.

4 years agoVersion 1.4.0 placeholder
Mike Bayer [Mon, 15 Feb 2021 20:00:41 +0000 (15:00 -0500)] 
Version 1.4.0 placeholder

4 years ago- 1.4.0b3 rel_1_4_0b3
Mike Bayer [Mon, 15 Feb 2021 19:49:10 +0000 (14:49 -0500)] 
- 1.4.0b3

4 years agonext release is 1.4.0b3
Mike Bayer [Mon, 15 Feb 2021 19:48:33 +0000 (14:48 -0500)] 
next release is 1.4.0b3

Change-Id: I2c941b47c667e83fef9687da31fe20d59d2ea5c8

4 years agozzzeeksphinx 1.2.1 needed w/ sphinx 3.5.0
Mike Bayer [Mon, 15 Feb 2021 19:40:31 +0000 (14:40 -0500)] 
zzzeeksphinx 1.2.1 needed w/ sphinx 3.5.0

Change-Id: Ie81ac4dfaf53b2ff7df37603b473509f320726be

4 years agoMerge "Support legacy select(<iterable>) in addition to select(<list>) in v1.4"
mike bayer [Mon, 15 Feb 2021 19:33:05 +0000 (19:33 +0000)] 
Merge "Support legacy select(<iterable>) in addition to select(<list>) in v1.4"

4 years agoSupport legacy select(<iterable>) in addition to select(<list>) in v1.4
Oliver Rice [Sat, 13 Feb 2021 19:21:55 +0000 (14:21 -0500)] 
Support legacy select(<iterable>) in addition to select(<list>) in v1.4

Fixed regression where use of an arbitrary iterable with the
:func:`_sql.select` function was not working, outside of plain lists. The
forwards/backwards compatibility logic here now checks for a wider range of
incoming "iterable" types including that a ``.c`` collection from a
selectable can be passed directly. Pull request compliments of Oliver Rice.

Fixes: #5935
Closes: #5936
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5936
Pull-request-sha: 575ab3e7df30fc8da03752d102c8eeb6cb3a3e3d

Change-Id: Icd972f1078d9ea96c47a64133079f00d9b0a66f3

4 years agoAccept ColumnCollection in update_on_conflict(set_=
Gord Thompson [Sat, 13 Feb 2021 21:43:21 +0000 (14:43 -0700)] 
Accept ColumnCollection in update_on_conflict(set_=

Fixes: #5939
Change-Id: I21d7125765028e2a98d5ef4c32d8e7e457aa2d12

4 years agoMerge remote-tracking branch 'origin/pr/5943'
Mike Bayer [Mon, 15 Feb 2021 18:13:07 +0000 (13:13 -0500)] 
Merge remote-tracking branch 'origin/pr/5943'

Change-Id: I19161c700eab1c30103fea2971ca5574d3207b5c

4 years agofix repeated footnote
Mike Bayer [Mon, 15 Feb 2021 16:21:41 +0000 (11:21 -0500)] 
fix repeated footnote

Change-Id: Ibd8239907c3cf747d0d9a0fb670e37c9913871f8

4 years agoBumy Sphinx 5943/head
Sam Bull [Mon, 15 Feb 2021 10:36:30 +0000 (10:36 +0000)] 
Bumy Sphinx

4 years agoMerge "Allow update.returing() to work with from_statement()"
mike bayer [Sun, 14 Feb 2021 21:54:59 +0000 (21:54 +0000)] 
Merge "Allow update.returing() to work with from_statement()"

4 years agoAllow update.returing() to work with from_statement()
Mike Bayer [Sun, 14 Feb 2021 04:21:04 +0000 (23:21 -0500)] 
Allow update.returing() to work with from_statement()

The ORM used in :term:`2.0 style` can now return ORM objects from the rows
returned by an UPDATE..RETURNING or INSERT..RETURNING statement, by
supplying the construct to :meth:`_sql.Select.from_statement` in an ORM
context.

Change-Id: I59c9754ff1cb3184580dd5194ecd2971d4e7f8e8
References: #5940

4 years agoAdd emphasis to URL documentation re: URL encoding
Mike Bayer [Sun, 14 Feb 2021 19:36:27 +0000 (14:36 -0500)] 
Add emphasis to URL documentation re: URL encoding

Fixes: #5715
Change-Id: I2ac16541d34f49b25070e00c43596bcd71aff72d

4 years agofix typos
Mike Bayer [Sun, 14 Feb 2021 17:13:56 +0000 (12:13 -0500)] 
fix typos

Change-Id: Ifb9e75e5af9412224b1e75491c497ba67e2018d4

4 years agoexpand and further generalize bound parameter translate
Mike Bayer [Sat, 13 Feb 2021 22:13:51 +0000 (17:13 -0500)] 
expand and further generalize bound parameter translate

Continued with the improvement made as part of :ticket:`5653` to further
support bound parameter names, including those generated against column
names, for names that include colons, parenthesis, and question marks, as
well as improved test support, so that bound parameter names even if they
are auto-derived from column names should have no problem including for
parenthesis in psycopg2's "pyformat" style.

As part of this change, the format used by the asyncpg DBAPI adapter (which
is local to SQLAlchemy's asyncpg diaelct) has been changed from using
"qmark" paramstyle to "format", as there is a standard and internally
supported SQL string escaping style for names that use percent signs with
"format" style (i.e. to double percent signs), as opposed to names that use
question marks with "qmark" style (where an escaping system is not defined
by pep-249 or Python).

Fixes: #5941
Change-Id: Id86f5af81903d7063a8e3505e60df56490f85358

4 years ago[doc/build/changelog/migration_20.rst] Remove and 5937/head
Samuel Marks [Sat, 13 Feb 2021 12:15:39 +0000 (23:15 +1100)] 
[doc/build/changelog/migration_20.rst] Remove and

4 years agoFurther refine labeling for renamed columns
Mike Bayer [Thu, 11 Feb 2021 19:05:49 +0000 (14:05 -0500)] 
Further refine labeling for renamed columns

Forked from I22f6cf0f0b3360e55299cdcb2452cead2b2458ea
we are attempting to decide the case for columns mapped
under a different name.   since the .key feature of
Column seems to support this fully, see if an annotation
can be used to indicate an effective .key for a column.

The effective change is that the labeling of column expressions
in rows has been improved to retain the original name of the ORM
attribute even if used in a subquery.

References: #5933
Change-Id: If251f556f7d723f50d349f765f1690d6c679d2ef

4 years agoMerge "Apply consistent labeling for all future style ORM queries"
mike bayer [Fri, 12 Feb 2021 17:10:21 +0000 (17:10 +0000)] 
Merge "Apply consistent labeling for all future style ORM queries"

4 years agoMerge "test Function(?:Element)._bind_param() with in_()"
mike bayer [Thu, 11 Feb 2021 23:29:39 +0000 (23:29 +0000)] 
Merge "test Function(?:Element)._bind_param() with in_()"

4 years agoPrepare to ship 1.4.0b3
Mike Bayer [Thu, 11 Feb 2021 23:27:56 +0000 (18:27 -0500)] 
Prepare to ship 1.4.0b3

Due to #5933 and to a lesser degree #5934,
put out 1.4.0b3 so that it gets some coverage before release.

Change-Id: Ic5538e2f64e811b34d7c3dc03307073a55a63a87

4 years agoApply consistent labeling for all future style ORM queries
Mike Bayer [Thu, 11 Feb 2021 19:05:49 +0000 (14:05 -0500)] 
Apply consistent labeling for all future style ORM queries

Fixed issue in new 1.4/2.0 style ORM queries where a statement-level label
style would not be preserved in the keys used by result rows; this has been
applied to all combinations of Core/ORM columns / session vs. connection
etc. so that the linkage from statement to result row is the same in all
cases.

also repairs a cache key bug where query.from_statement()
vs. select().from_statement() would not be disambiguated; the
compile options were not included in the cache key for
FromStatement.

Fixes: #5933
Change-Id: I22f6cf0f0b3360e55299cdcb2452cead2b2458ea

4 years agotest Function(?:Element)._bind_param() with in_()
Mike Bayer [Thu, 11 Feb 2021 22:51:15 +0000 (17:51 -0500)] 
test Function(?:Element)._bind_param() with in_()

Fixed 1.4 regression where the :meth:`_functions.Function.in_` method was
not covered by tests and failed to function properly in all cases.

Fixes: #5934
Change-Id: I93423a296e391aabd5594cb670d36b91ced0231d

4 years agoDon't pre-calc inserted primary key if no getter
Mike Bayer [Wed, 10 Feb 2021 15:36:52 +0000 (10:36 -0500)] 
Don't pre-calc inserted primary key if no getter

the _setup_ins_pk_from_empty() method provides a placeholder
result for inserted_primary_key_rows that is not typically
going to be invoked.  For an executemany (or even execute)
that isn't already stating it wants primary key values
up front, defer this computation until explicitly requested.

Change-Id: I6295eafbccc96a0422b9cac34e79db7924c702ca
References: https://github.com/sqlalchemy/sqlalchemy/discussions/5893#discussioncomment-356155

4 years agoturn section into a bulleted list
Mike Bayer [Wed, 10 Feb 2021 15:13:45 +0000 (10:13 -0500)] 
turn section into a bulleted list

Change-Id: I18f047a999bd48d6d0e3c495a0ca675b042c1bb6
(cherry picked from commit 95916d658c9c0a812f3ed33830260a0924439035)

4 years agoMerge "Detect non async driver on engine creation"
mike bayer [Tue, 9 Feb 2021 20:29:57 +0000 (20:29 +0000)] 
Merge "Detect non async driver on engine creation"

4 years agoupdate the intro to accommodate for the 1.4/2.0 overview
Mike Bayer [Tue, 9 Feb 2021 19:23:11 +0000 (14:23 -0500)] 
update the intro to accommodate for the 1.4/2.0 overview

Change-Id: Ida77a4d89a2cb8a67a4608831f66a5ab533e0472

4 years agoMerge "Add identifier_preparer per-execution context for schema translates"
mike bayer [Mon, 8 Feb 2021 22:56:25 +0000 (22:56 +0000)] 
Merge "Add identifier_preparer per-execution context for schema translates"

4 years agoMerge "Use slots in the aiomysql proxy classes"
mike bayer [Mon, 8 Feb 2021 18:41:20 +0000 (18:41 +0000)] 
Merge "Use slots in the aiomysql proxy classes"

4 years agoAdd identifier_preparer per-execution context for schema translates
Mike Bayer [Mon, 8 Feb 2021 16:58:15 +0000 (11:58 -0500)] 
Add identifier_preparer per-execution context for schema translates

Fixed bug where the "schema_translate_map" feature failed to be taken into
account for the use case of direct execution of
:class:`_schema.DefaultGenerator` objects such as sequences, which included
the case where they were "pre-executed" in order to generate primary key
values when implicit_returning was disabled.

Fixes: #5929
Change-Id: I3fed1d0af28be5ce9c9bb572524dcc8411633f60

4 years agoMerge branch 'master' of ssh://gerrit.sqlalchemy.org:29418/sqlalchemy/sqlalchemy
Mike Bayer [Sun, 7 Feb 2021 14:57:38 +0000 (09:57 -0500)] 
Merge branch 'master' of ssh://gerrit.sqlalchemy.org:29418/sqlalchemy/sqlalchemy

Change-Id: Idc5c09e2953c998aa5b9a49715e23026bba2e851

4 years agoDocument implicit IO points in ORM
Mike Bayer [Sun, 7 Feb 2021 14:51:48 +0000 (09:51 -0500)] 
Document implicit IO points in ORM

I purposely didn't spend much documentation writing
about implicit IO when I first pushed out the asyncio
extension because I wanted to get a sense on what kinds
of issues people had.   Now we know and the answer is
predictably "all of them".  List out all the known
implicit IO points and how to avoid them.  Also rename
the "adapting lazy loads" section, so that the title is less
suggestive that this is a necessary technique.

References: #5926

Change-Id: I3933b74bd37a5b06989531adbeade34347db679b

4 years agoUse slots in the aiomysql proxy classes
Federico Caselli [Sat, 6 Feb 2021 16:54:42 +0000 (17:54 +0100)] 
Use slots in the aiomysql proxy classes

Add slots in the proxy cursor and connection classes in the aiomysql dialect

Change-Id: If72fccf0cc16557a7e3a0c9450733c8337bec15a

4 years agoDetect non async driver on engine creation
Federico Caselli [Sat, 6 Feb 2021 11:11:54 +0000 (12:11 +0100)] 
Detect non async driver on engine creation

An error is raised when creating an async engine with an
incompatible dbapi. Before the error was raised only when
first using the engine.

Change-Id: I977952b4c03ae51f568749ad744c545197bcd887
Reference: #5920

4 years agoTrack a second from_linter for lateral subqueries
Mike Bayer [Fri, 5 Feb 2021 18:38:28 +0000 (13:38 -0500)] 
Track a second from_linter for lateral subqueries

Fixed bug where the "cartesian product" assertion was not correctly
accommodating for joins between tables that relied upon the use of LATERAL
to connect from a subquery to another subquery in the enclosing context.

Additionally, enabled from_linting for the base assert_compile(),
however it remains off by default; to enable by default we would
have to make sure it isn't set for DDL compiles and there's also
a lot of tests that would also need to turn it off, so leaving
this off for expediency.

Fixes: #5924
Change-Id: I22604baf572f8c4d96befcc610b3dcb79c13fc4a

4 years agoMerge remote-tracking branch 'origin/pr/5883'
Mike Bayer [Fri, 5 Feb 2021 14:24:38 +0000 (09:24 -0500)] 
Merge remote-tracking branch 'origin/pr/5883'

Change-Id: I221871acc0569df58b1665b2a90b440e102a9c55

4 years agoAccommodate column-based naming conventions for pk constraint
Mike Bayer [Thu, 4 Feb 2021 17:09:54 +0000 (12:09 -0500)] 
Accommodate column-based naming conventions for pk constraint

Repaired / implemented support for primary key constraint naming
conventions that use column names/keys/etc as part of the convention. In
particular, this includes that the :class:`.PrimaryKeyConstraint` object
that's automatically associated with a :class:`.schema.Table` will update
its name as new primary key :class:`_schema.Column` objects are added to
the table and then to the constraint. Internal failure modes related to
this constraint construction process including no columns present, no name
present or blank name present are now accommodated.

Fixes: #5919
Change-Id: Ic2800b50f4a4cd5978bec48cefea0a2e198e0123

4 years agoorm/session.py - comment grammar fix 5917/head
Maciej Brencz [Thu, 4 Feb 2021 09:44:34 +0000 (10:44 +0100)] 
orm/session.py - comment grammar fix

4 years agoVersion 1.4.0 placeholder
Mike Bayer [Wed, 3 Feb 2021 23:30:26 +0000 (18:30 -0500)] 
Version 1.4.0 placeholder

4 years ago- 1.4.0b2 rel_1_4_0b2
Mike Bayer [Wed, 3 Feb 2021 23:15:11 +0000 (18:15 -0500)] 
- 1.4.0b2

4 years agoadd asyncio as a changelog section
Mike Bayer [Wed, 3 Feb 2021 23:04:07 +0000 (18:04 -0500)] 
add asyncio as a changelog section

Change-Id: I84eabb0f96ed857927dcbd368568ec51c155c0f8
(cherry picked from commit d003904086db442fce87165500054b37c887b385)

4 years agoMerge "un-deprecate Oracle 2pc"
mike bayer [Wed, 3 Feb 2021 21:58:08 +0000 (21:58 +0000)] 
Merge "un-deprecate Oracle 2pc"

4 years agofix gc related race in weakdict popitem
Mike Bayer [Wed, 3 Feb 2021 21:56:58 +0000 (16:56 -0500)] 
fix gc related race in weakdict popitem

Change-Id: I88c19b6d3c97a714f7e4bf22812a23e095f9dcba