]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
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

4 years agoRepair tests for older SQLite, timing, pypy
Mike Bayer [Wed, 3 Feb 2021 21:47:53 +0000 (16:47 -0500)] 
Repair tests for older SQLite, timing, pypy

Change-Id: I9e425d2415d18a893342244755c7748b546fb20d

4 years agoMerge "Improve noload documentation"
mike bayer [Wed, 3 Feb 2021 21:30:51 +0000 (21:30 +0000)] 
Merge "Improve noload documentation"

4 years agoMerge "Implement support for functions as FROM with columns clause support"
mike bayer [Wed, 3 Feb 2021 21:26:19 +0000 (21:26 +0000)] 
Merge "Implement support for functions as FROM with columns clause support"

4 years agoun-deprecate Oracle 2pc
Mike Bayer [Wed, 27 Jan 2021 20:29:29 +0000 (15:29 -0500)] 
un-deprecate Oracle 2pc

Oracle two-phase transactions at a rudimentary level are now no longer
deprecated. After receiving support from cx_Oracle devs we can provide for
basic xid + begin/prepare support with some limitations, which will work
more fully in an upcoming release of cx_Oracle. Two phase "recovery" is not
currently supported.

Fixes: #5884
Change-Id: I961c0ad14a530acc6b069bd9bfce99fc34124abc

4 years agoImplement support for functions as FROM with columns clause support
Mike Bayer [Sun, 17 Jan 2021 18:35:02 +0000 (13:35 -0500)] 
Implement support for functions as FROM with columns clause support

Implemented support for "table valued functions" along with additional
syntaxes supported by PostgreSQL, one of the most commonly requested
features. Table valued functions are SQL functions that return lists of
values or rows, and are prevalent in PostgreSQL in the area of JSON
functions, where the "table value" is commonly referred towards as the
"record" datatype. Table valued functions are also supported by Oracle and
SQL Server.

Moved from I5b093b72533ef695293e737eb75850b9713e5e03 due
to accidental push

Fixes: #3566
Change-Id: Iea36d04c80a5ed3509dcdd9ebf0701687143fef5

4 years agoMerge "Implement per-connection logging token"
mike bayer [Wed, 3 Feb 2021 20:00:51 +0000 (20:00 +0000)] 
Merge "Implement per-connection logging token"

4 years agoImplement per-connection logging token
Mike Bayer [Wed, 3 Feb 2021 16:53:18 +0000 (11:53 -0500)] 
Implement per-connection logging token

Added new execution option
:paramref:`_engine.Connection.execution_options.logging_token`. This option
will add an additional per-message token to log messages generated by the
:class:`_engine.Connection` as it executes statements. This token is not
part of the logger name itself (that part can be affected using the
existing :paramref:`_sa.create_engine.logging_name` parameter), so is
appropriate for ad-hoc connection use without the side effect of creating
many new loggers. The option can be set at the level of
:class:`_engine.Connection` or :class:`_engine.Engine`.

Fixes: #5911
Change-Id: Iec9c39b868b3578fcedc1c094dace5b6f64bacea

4 years agoAdd coercions to literal()
Mike Bayer [Wed, 3 Feb 2021 15:42:08 +0000 (10:42 -0500)] 
Add coercions to literal()

To prevent literal() from receiving a ClauseElement which
then leads to confusing results, add a new LiteralValueRole
coercion that does an _is_literal() check and implement
for literal().

Fixes: #5639
Change-Id: Ibd686544af2d7c013765278f984baf237de88caf

4 years agoImprove noload documentation
Federico Caselli [Tue, 2 Feb 2021 19:49:41 +0000 (20:49 +0100)] 
Improve noload documentation

Also add a link to the loading strategies doc from the
async orm docs

Fixes: #5832
Change-Id: I41170369273df7d323f7140cd05759567484dc4d

4 years agodon't fail if purge recyclebin fails/mutex on registry
Mike Bayer [Tue, 2 Feb 2021 16:26:55 +0000 (11:26 -0500)] 
don't fail if purge recyclebin fails/mutex on registry

the recyclebin purge is failing after SetInputSizesTest
on occasion.  try to reduce transaction overhead and don't
error out if the purge fails.

ensure _CONFIGURE_MUTEX is used when mutating or
iterating the _mapper_registries collection.

Change-Id: I9d9cd53b92419a2ad97bae5ee8bdd2657b6e408f

4 years agoMerge "reorganize mapper compile/teardown under registry"
mike bayer [Mon, 1 Feb 2021 23:13:42 +0000 (23:13 +0000)] 
Merge "reorganize mapper compile/teardown under registry"

4 years agoreorganize mapper compile/teardown under registry
Mike Bayer [Sat, 30 Jan 2021 16:55:22 +0000 (11:55 -0500)] 
reorganize mapper compile/teardown under registry

Mapper "configuration", which occurs within the
:func:`_orm.configure_mappers` function, is now organized to be on a
per-registry basis. This allows for example the mappers within a certain
declarative base to be configured, but not those of another base that is
also present in memory. The goal is to provide a means of reducing
application startup time by only running the "configure" process for sets
of mappers that are needed. This also adds the
:meth:`_orm.registry.configure` method that will run configure for the
mappers local in a particular registry only.

Fixes: #5897
Change-Id: I14bd96982d6d46e241bd6baa2cf97471d21e7caa

4 years agocherry-pick changelog update for 1.3.24
Mike Bayer [Mon, 1 Feb 2021 20:56:44 +0000 (15:56 -0500)] 
cherry-pick changelog update for 1.3.24

4 years agocherry-pick changelog from 1.3.23
Mike Bayer [Mon, 1 Feb 2021 20:56:44 +0000 (15:56 -0500)] 
cherry-pick changelog from 1.3.23

4 years agoset identifier length for MySQL constraints to 64
Mike Bayer [Sat, 30 Jan 2021 21:57:50 +0000 (16:57 -0500)] 
set identifier length for MySQL constraints to 64

The rule to limit index names to 64 also applies to all
DDL names, such as those coming from naming conventions.
Add another limiting variable for constraint names and
create test cases against all constraint types.

Additionally, codified in the test suite MySQL's lack of
support for naming of a FOREIGN KEY constraint after
the name was given, which apparently assigns the name to an
associated KEY but not the constraint itself, until MySQL 8
and MariaDB 10.5 which appear to have resolved the
behavior.  However it's not clear how Alembic hasn't had
issues reported with this so far.

Fixed long-lived bug in MySQL dialect where the maximum identifier length
of 255 was too long for names of all types of constraints, not just
indexes, all of which have a size limit of 64. As metadata naming
conventions can create too-long names in this area, apply the limit to the
identifier generator within the DDL compiler.

Fixes: #5898
Change-Id: I79549474845dc29922275cf13321c07598dcea08

4 years agoMerge "Use schema._copy_expression() fully in column collection constraints"
mike bayer [Fri, 29 Jan 2021 23:22:01 +0000 (23:22 +0000)] 
Merge "Use schema._copy_expression() fully in column collection constraints"

4 years agoUse schema._copy_expression() fully in column collection constraints
Gord Thompson [Mon, 25 Jan 2021 18:24:25 +0000 (11:24 -0700)] 
Use schema._copy_expression() fully in column collection constraints

Fixed issue where using :meth:`_schema.Table.to_metadata` (called
:meth:`_schema.Table.tometadata` in 1.3) in conjunction with a PostgreSQL
:class:`_postgresql.ExcludeConstraint` that made use of ad-hoc column
expressions would fail to copy correctly.

Fixes: #5850
Change-Id: I062480afb23f6f60962b7b55bc93f5e4e6ff05e4

4 years agoClarify Column.index / Column.unique parameters
Mike Bayer [Fri, 29 Jan 2021 18:43:38 +0000 (13:43 -0500)] 
Clarify Column.index / Column.unique parameters

These parameters need to be more clear that they cause a
constraint / index object to be generated.  Clarify the rules
by which this occurs and include contextual information about
naming conventions as well.

Change-Id: I8dc96ead4457215abed391fd1b9f732a1eef6e09
References: #5887

4 years agoMerge "Render NULL for bindparam w/ None value/literal_binds, warn"
mike bayer [Thu, 28 Jan 2021 22:19:10 +0000 (22:19 +0000)] 
Merge "Render NULL for bindparam w/ None value/literal_binds, warn"

4 years agoRender NULL for bindparam w/ None value/literal_binds, warn
Mike Bayer [Thu, 28 Jan 2021 19:53:02 +0000 (14:53 -0500)] 
Render NULL for bindparam w/ None value/literal_binds, warn

Adjusted the "literal_binds" feature of :class:`_sql.Compiler` to render
NULL for a bound parameter that has ``None`` as the value, either
explicitly passed or omitted. The previous error message "bind parameter
without a renderable value" is removed, and a missing or ``None`` value
will now render NULL in all cases. Previously, rendering of NULL was
starting to happen for DML statements due to internal refactorings, but was
not explicitly part of test coverage, which it now is.

While no error is raised, when the context is within that of a column
comparison, and the operator is not "IS"/"IS NOT", a warning is emitted
that this is not generally useful from a SQL perspective.

Fixes: #5888
Change-Id: Id5939d8dbfb1156a9f8a7f7e76cf18327155331a

4 years agoAllow Oracle CLOB/NCLOB/BLOB in returning
Mike Bayer [Thu, 28 Jan 2021 16:04:29 +0000 (11:04 -0500)] 
Allow Oracle CLOB/NCLOB/BLOB in returning

Fixed bug in Oracle dialect where retriving a CLOB/BLOB column via
:meth:`_dml.Insert.returning` would fail as the LOB value would need to be
read when returned; additionally, repaired support for retrieval of Unicode
values via RETURNING under Python 2.

As of yet, we still don't know how to reproduce the
ORA-24813 error indicated in the issue.

Fixes: #5812
Change-Id: I666f893e762dfa4d34dd2e324480565b226fb3a4

4 years agoRepair incorrect symbol PyDict_GetItemWithError for Python 2
Mike Bayer [Wed, 27 Jan 2021 17:57:47 +0000 (12:57 -0500)] 
Repair incorrect symbol PyDict_GetItemWithError for Python 2

* ensure on python 2 correct cflags to fail on undefined
symbols take effect

* fail for implicit function declaration

* python 2 does not publish PyDict_GetItemWithError but has
it as _PyDict_GetItemWIthError but only as of Python 2.7.12

Change-Id: I007509afddf7f44ca64e52fa9140be39f815fa7a

4 years agoMerge "Fix many spell glitches in docstrings and comments"
mike bayer [Tue, 26 Jan 2021 23:12:33 +0000 (23:12 +0000)] 
Merge "Fix many spell glitches in docstrings and comments"

4 years agoMerge "Improve c implementation of immutabledict"
mike bayer [Tue, 26 Jan 2021 23:07:40 +0000 (23:07 +0000)] 
Merge "Improve c implementation of immutabledict"

4 years agoMerge "Replace with_labels() and apply_labels() in ORM/Core"
mike bayer [Tue, 26 Jan 2021 22:31:21 +0000 (22:31 +0000)] 
Merge "Replace with_labels() and apply_labels() in ORM/Core"

4 years agoAdd dbapimaster builds to tox.ini
Mike Bayer [Tue, 26 Jan 2021 22:21:06 +0000 (17:21 -0500)] 
Add dbapimaster builds to tox.ini

For the Jenkins dbapi-master build, we can no longer
put git URLs in a constraints file, so just use tox.ini
itself to provide alternate dependencies.

Change-Id: Id6b53c511954ec31371810da85eea7b5a58dbc0d

4 years agoadd sqlalchemy to FUNDING
Mike Bayer [Tue, 26 Jan 2021 21:53:34 +0000 (16:53 -0500)] 
add sqlalchemy to FUNDING

Change-Id: I764189f0360b97948c6222a3ff422d7259a55ef2

4 years agoReplace with_labels() and apply_labels() in ORM/Core
Gord Thompson [Sat, 9 Jan 2021 21:56:38 +0000 (14:56 -0700)] 
Replace with_labels() and apply_labels() in ORM/Core

Replace :meth:`_orm.Query.with_labels` and
:meth:`_sql.GenerativeSelect.apply_labels` with explicit getters and
setters ``get_label_style`` and ``set_label_style`` to accommodate the
three supported label styles: ``LABEL_STYLE_DISAMBIGUATE_ONLY`` (default),
``LABEL_STYLE_TABLENAME_PLUS_COL``, and ``LABEL_STYLE_NONE``.

In addition, for Core and "future style" ORM queries,
``LABEL_STYLE_DISAMBIGUATE_ONLY`` is now the default label style. This
style differs from the existing "no labels" style in that labeling is
applied in the case of column name conflicts; with ``LABEL_STYLE_NONE``, a
duplicate column name is not accessible via name in any case.

For legacy ORM queries using :class:`_query.Query`, the table-plus-column
names labeling style applied by ``LABEL_STYLE_TABLENAME_PLUS_COL``
continues to be used so that existing test suites and logging facilities
see no change in behavior by default, however this style of labeling is no
longer required for SQLAlchemy queries to function, as result sets are
commonly matched to columns using a positional approach since SQLAlchemy
1.0.

Within test suites, all use of apply_labels()  / use_labels
now uses the new methods.    New tests added to
test/sql/test_deprecations.py nad test/orm/test_deprecations.py
to cover just the old apply_labels() method call.  Tests
in ORM that made explicit use apply_labels()/ etc. where it isn't needed
for the ORM to work correctly use default label style now.

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

4 years agoFill-out dataclass-related attr resolution
Mike Bayer [Mon, 25 Jan 2021 22:59:35 +0000 (17:59 -0500)] 
Fill-out dataclass-related attr resolution

Fixed issue where mixin attribute rules were not taking
effect correctly for attributes pulled from dataclasses
using the approach added in #5745.

Fixes: #5876
Change-Id: I45099a42de1d9611791e72250fe0edc69bed684c

4 years agoImprove c implementation of immutabledict
Federico Caselli [Mon, 25 Jan 2021 20:39:42 +0000 (21:39 +0100)] 
Improve c implementation of immutabledict

Avoids using the call methods and instead uses the dict c interface.

Fixes: #5871
Change-Id: I7a1211104da319b0793a149f1a24f9f95c9f6630

4 years agoAdd more docs on engine connecting w/ URL parameters
Mike Bayer [Mon, 25 Jan 2021 18:22:34 +0000 (13:22 -0500)] 
Add more docs on engine connecting w/ URL parameters

We have a special section for connect_args but didn't appropriately
introduce that URL keywords may be used as well, which otherwise
does not seem to be documented in a generalized way.  Add
this additional detail and contrast between URL query string
and connect_args including providing some transparency for
how to see what URL query string parameters will do for a given
dialect, as we do not handle these parameters consistently
right now.

Change-Id: I2227554732e307d4b525a9931e8d03ccc2c16726
References: #5874

4 years agoMerge "Limit AsyncAdaptedQueue to Python 3.7"
mike bayer [Sun, 24 Jan 2021 23:39:48 +0000 (23:39 +0000)] 
Merge "Limit AsyncAdaptedQueue to Python 3.7"

4 years agoMerge "Remove errant assertion from unit of work"
mike bayer [Sun, 24 Jan 2021 23:38:35 +0000 (23:38 +0000)] 
Merge "Remove errant assertion from unit of work"

4 years agoun-ignore mike's favorite testing filenames
Mike Bayer [Sun, 24 Jan 2021 22:26:36 +0000 (17:26 -0500)] 
un-ignore mike's favorite testing filenames

As im using vscode I'd like these filenames to show up
in filesearch but I'd like to keep "ignore .gitignore files"
turned on.   I've moved these names to my own local
.git/info/exclude instead.

Change-Id: Iee6192d42d0630bf1b26cb9c1d3c2f8acab6caf4

4 years agoRemove errant assertion from unit of work
Mike Bayer [Sat, 23 Jan 2021 23:02:17 +0000 (18:02 -0500)] 
Remove errant assertion from unit of work

Fixed ORM unit of work regression where an errant "assert primary_key"
statement interferes with primary key generation sequences that don't
actually consider the columns in the table to use a real primary key
constraint, instead using :paramref:`_orm.mapper.primary_key` to establish
certain columns as "primary".

Also remove errant "identity" requirement which does not seem to
represent any current backend and is applied to
test/sql/test_defaults.py->AutoIncrementTest, but these tests work
on all backends.

Fixes: #5867
Change-Id: I4502ca5079d824d7b4d055194947aa1a00effde7

4 years agoLimit AsyncAdaptedQueue to Python 3.7
Federico Caselli [Sun, 24 Jan 2021 19:49:06 +0000 (14:49 -0500)] 
Limit AsyncAdaptedQueue to Python 3.7

Tests here are failing for python 3.6 due to the lack
of asyncio.run().   It seems to be non-trivial to vendor
a working version of this in Python 3.6 as the tests here
are running it in alternate threads.

The python documentation imports everything directly from the
asyncio package, and it seems that py < 3.8 does not have the
asyncio.exception module

Closes: #5865
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5865
Pull-request-sha: 35cc1fa3f6ff962676f571ae30851f4b4d96762a

Change-Id: I9398c9fb2aa87f3228ce2f59277de732091bd541

4 years agoFix many spell glitches in docstrings and comments
Lele Gaifax [Sun, 24 Jan 2021 18:59:03 +0000 (13:59 -0500)] 
Fix many spell glitches in docstrings and comments

These were revealed by running `pylint --disable all --enable spelling --spelling-dict en_US` over all sources.

Closes: #5868
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5868
Pull-request-sha: bb249195d92e3b806e81ecf1192d5a1b3cd5db48

Change-Id: I96080ec93a9fbd20ce21e9e16265b3c77f22bb14

4 years agoMerge "include negation symbol in numeric default match"
mike bayer [Sat, 23 Jan 2021 18:07:41 +0000 (18:07 +0000)] 
Merge "include negation symbol in numeric default match"

4 years agoMerge "remove __allowlist__"
mike bayer [Sat, 23 Jan 2021 18:05:24 +0000 (18:05 +0000)] 
Merge "remove __allowlist__"

4 years agoMerge "Improve error message when await_ call errors"
mike bayer [Sat, 23 Jan 2021 15:33:50 +0000 (15:33 +0000)] 
Merge "Improve error message when await_ call errors"

4 years agoremove __allowlist__
Mike Bayer [Sat, 23 Jan 2021 15:31:20 +0000 (10:31 -0500)] 
remove __allowlist__

this testing element is not used

Change-Id: I484c9a9f070122545fcdabe5a7f13b0bfca17023

4 years agoMerge "Removed some legacy terms in favor of modern equivalents. (D&I)"
mike bayer [Sat, 23 Jan 2021 15:27:52 +0000 (15:27 +0000)] 
Merge "Removed some legacy terms in favor of modern equivalents. (D&I)"

4 years agoinclude negation symbol in numeric default match
Mike Bayer [Sat, 23 Jan 2021 08:00:56 +0000 (03:00 -0500)] 
include negation symbol in numeric default match

Fixed bug where MySQL server default reflection would fail for numeric
values with a negation symbol present.

Fixes: #5860
Change-Id: I02cacdb4f9ec7d9113c27bf0d9214c4e14f4d4f9

4 years agoFix a couple of bugs in the asyncio implementation
Federico Caselli [Sat, 9 Jan 2021 12:25:55 +0000 (13:25 +0100)] 
Fix a couple of bugs in the asyncio implementation

Log an informative message if a connection is not closed
and the gc is reclaiming it when using an async dpapi, that
does not support running IO at that stage.

The ``AsyncAdaptedQueue`` used by default on async dpapis
should instantiate a queue only when it's first used
to avoid binding it to a possibly wrong event loop.

Fixes: #5823
Change-Id: Ibfc50e209b1937ae3d6599ae7997f028c7a92c33

4 years agoImprove error message when await_ call errors
Federico Caselli [Tue, 12 Jan 2021 21:00:59 +0000 (22:00 +0100)] 
Improve error message when await_ call errors

Fixes: #5832
Change-Id: Ia2ed8f1d1ec54e5f6e1a8f817a69446fdb3b7f6d

4 years agoRemoved some legacy terms in favor of modern equivalents. (D&I)
jonathan vanasco [Thu, 21 Jan 2021 17:25:04 +0000 (12:25 -0500)] 
Removed some legacy terms in favor of modern equivalents. (D&I)

Migrated testing fixture:
`TestBase.__whitelist__` -> `TestBase.__allowlist__`

Migrated tox commands from deprecated to current:
`whitelist_externals` > `allowlist_externals`

Migrated test_session:
`blacklist` -> `blocklist`

Change-Id: I395d5ee977ff22fa703276b9b873cc96c59b9a35

4 years agoRevert "Implement support for functions as FROM with columns clause support"
Mike Bayer [Thu, 21 Jan 2021 16:15:06 +0000 (11:15 -0500)] 
Revert "Implement support for functions as FROM with columns clause support"

This reverts commit 05a31f2708590161d4b3b4c7ff65196c99b4a22b.

Atom has this little button called "push" and just pushes to master,
I wasn't even *on* master.  oops

4 years agoImplement support for functions as FROM with columns clause support
Mike Bayer [Sun, 17 Jan 2021 18:35:02 +0000 (13:35 -0500)] 
Implement support for functions as FROM with columns clause support

WIP

Fixes: #3566
Change-Id: I5b093b72533ef695293e737eb75850b9713e5e03

4 years agoMerge "chain joins from SelectState context, not Select"
mike bayer [Wed, 20 Jan 2021 23:52:52 +0000 (23:52 +0000)] 
Merge "chain joins from SelectState context, not Select"

4 years agoAdd missing changelog file
Mike Bayer [Wed, 20 Jan 2021 22:08:35 +0000 (17:08 -0500)] 
Add missing changelog file

In 8860117c9655a4bdeafeba we forgot to add the changelog file.

Fixes: #5169
Change-Id: Ia7a106e9e49aacbfd788eaec46b7826e8e4e065a

4 years agochain joins from SelectState context, not Select
Mike Bayer [Wed, 20 Jan 2021 22:06:14 +0000 (17:06 -0500)] 
chain joins from SelectState context, not Select

Fixed issue in new :meth:`_sql.Select.join` method where chaining from the
current JOIN wasn't looking at the right state, causing an expression like
"FROM a JOIN b <onclause>, b JOIN c <onclause>" rather than
"FROM a JOIN b <onclause> JOIN c <onclause>".

Added :meth:`_sql.Select.outerjoin_from` method to complement
:meth:`_sql.Select.join_from`.

Fixes: #5858
Change-Id: I1346ebe0963bbd1e4bf868650e3ee1d6d3072f04

4 years agoMerge "Document Table/Column accessors"
mike bayer [Wed, 20 Jan 2021 14:26:19 +0000 (14:26 +0000)] 
Merge "Document Table/Column accessors"

4 years agoDocument Table/Column accessors
Mike Bayer [Tue, 19 Jan 2021 20:14:46 +0000 (15:14 -0500)] 
Document Table/Column accessors

As Sphinx will not allow us to add attributes to the
.rst file while maintaining order, these have to be added
as class-level attributes.

Inlcude notes that "index" and "unique" parameters, while
indicated by Column.index / Column.unique, do not actually
indicate if the column is part of an index.

Fixes: #5851
Change-Id: I18fbaf6c504c4b1005b4c51057f80397fb48b387

4 years agoMerge "Disallow non-native psycopg2 Unicode in Python 3; update docs"
mike bayer [Tue, 19 Jan 2021 19:49:45 +0000 (19:49 +0000)] 
Merge "Disallow non-native psycopg2 Unicode in Python 3; update docs"

4 years agoDisallow non-native psycopg2 Unicode in Python 3; update docs
Federico Caselli [Tue, 12 Jan 2021 21:14:38 +0000 (22:14 +0100)] 
Disallow non-native psycopg2 Unicode in Python 3; update docs

Fixed issue where the psycopg2 dialect would silently pass the
``use_native_unicode=False`` flag without actually having any effect under
Python 3, as the psycopg2 DBAPI uses Unicode unconditionally under Python
3.  This usage now raises an :class:`_exc.ArgumentError` when used under
Python 3. Added test support for Python 2.

Additionally, added documentation for client_encoding parameter
that may be passed to libpq directly via psycopg2.

Change-Id: I40ddf6382c157fa9399c21f0e01064197ea100f8

4 years agoMerge "More replacements of mapper to map_imperatively"
mike bayer [Mon, 18 Jan 2021 21:58:49 +0000 (21:58 +0000)] 
Merge "More replacements of mapper to map_imperatively"

4 years agorestore greenlet req
Mike Bayer [Mon, 18 Jan 2021 21:11:21 +0000 (16:11 -0500)] 
restore greenlet req

greenlet 1.0 is now released, so as openstack builds are up again and the upstream pip bug
is fixed, let's now try to restore the requirements we had as we'd
rather not have users confused about why asyncio doesn't work without
additional packages.

Change-Id: I33fe4eb754f3043f28f37be036df7a602917bac2

4 years agoMerge "``Identity`` implies ``nullable=False``."
mike bayer [Sun, 17 Jan 2021 01:31:03 +0000 (01:31 +0000)] 
Merge "``Identity`` implies ``nullable=False``."

4 years agointroduce generalized decorator to prevent invalid method calls
Mike Bayer [Sat, 16 Jan 2021 17:39:51 +0000 (12:39 -0500)] 
introduce generalized decorator to prevent invalid method calls

This introduces the ``_exclusive_against()`` utility decorator
that can be used to prevent repeated invocations of methods that
typically should only be called once.

An informative error message is now raised for a selected set of DML
methods (currently all part of :class:`_dml.Insert` constructs) if they are
called a second time, which would implicitly cancel out the previous
setting.  The methods altered include:
:class:`_sqlite.Insert.on_conflict_do_update`,
:class:`_sqlite.Insert.on_conflict_do_nothing` (SQLite),
:class:`_postgresql.Insert.on_conflict_do_update`,
:class:`_postgresql.Insert.on_conflict_do_nothing` (PostgreSQL),
:class:`_mysql.Insert.on_duplicate_key_update` (MySQL)

Fixes: #5169
Change-Id: I9278fa87cd3470dcf296ff96bb0fb17a3236d49d

4 years ago``Identity`` implies ``nullable=False``.
Federico Caselli [Thu, 7 Jan 2021 20:22:52 +0000 (21:22 +0100)] 
``Identity`` implies ``nullable=False``.

Altered the behavior of the :class:`_schema.Identity` construct such that
when applied to a :class:`_schema.Column`, it will automatically imply that
the value of :paramref:`_sql.Column.nullable` should default to ``False``,
in a similar manner as when the :paramref:`_sql.Column.primary_key`
parameter is set to ``True``.   This matches the default behavior of all
supporting databases where ``IDENTITY`` implies ``NOT NULL``.  The
PostgreSQL backend is the only one that supports adding ``NULL`` to an
``IDENTITY`` column, which is here supported by passing a ``True`` value
for the :paramref:`_sql.Column.nullable` parameter at the same time.

Fixes: #5775
Change-Id: I0516d506ff327cff35cda605e8897a27440e0373

4 years agoMerge "update aiomysql extra to match asyncpg, also dedupe asyncio extras"
mike bayer [Sat, 16 Jan 2021 01:23:20 +0000 (01:23 +0000)] 
Merge "update aiomysql extra to match asyncpg, also dedupe asyncio extras"

4 years agoMerge "Create explicit GC ordering between ConnectionFairy/ConnectionRecord"
mike bayer [Sat, 16 Jan 2021 01:22:03 +0000 (01:22 +0000)] 
Merge "Create explicit GC ordering between ConnectionFairy/ConnectionRecord"

4 years agoMerge "Guard against re-entrant autobegin in Core, ORM"
mike bayer [Sat, 16 Jan 2021 01:14:54 +0000 (01:14 +0000)] 
Merge "Guard against re-entrant autobegin in Core, ORM"

4 years agoGuard against re-entrant autobegin in Core, ORM
Mike Bayer [Fri, 15 Jan 2021 23:24:56 +0000 (18:24 -0500)] 
Guard against re-entrant autobegin in Core, ORM

Fixed bug in "future" version of :class:`.Engine` where emitting SQL during
the :meth:`.EngineEvents.do_begin` event hook would cause a re-entrant
condition due to autobegin, including the recipe documented for SQLite to
allow for savepoints and serializable isolation support.

Fixed issue in new :class:`_orm.Session` similar to that of the
:class:`_engine.Connection` where the new "autobegin" logic could be
tripped into a re-entrant state if SQL were executed within the
:meth:`.SessionEvents.after_transaction_create` event hook.

Also repair the new "testing_engine" pytest fixture to
set up for "future" engine appropriately, which wasn't working
leading to the test_execute.py tests not using the future
engine since recent f1e96cb0874927a475d0c11139.

Fixes: #5845
Change-Id: Ib2432d8c8bd753e24be60720ec47affb2df15a4a

4 years agorun handle error for commit/rollback fail and cancel transaction
Mike Bayer [Fri, 15 Jan 2021 22:23:52 +0000 (17:23 -0500)] 
run handle error for commit/rollback fail and cancel transaction

Fixed bug in asyncpg dialect where a failure during a "commit" or less
likely a "rollback" should cancel the entire transaction; it's no longer
possible to emit rollback. Previously the connection would continue to
await a rollback that could not succeed as asyncpg would reject it.

Fixes: #5824
Change-Id: I5a4916740c269b410f4d1a78ed25191de344b9d0

4 years agoMerge "Add missing requirements to suite tests"
mike bayer [Fri, 15 Jan 2021 20:19:15 +0000 (20:19 +0000)] 
Merge "Add missing requirements to suite tests"

4 years agoMore replacements of mapper to map_imperatively
Federico Caselli [Fri, 15 Jan 2021 19:30:46 +0000 (20:30 +0100)] 
More replacements of mapper to map_imperatively

Ref: #5829
Change-Id: I6778fde8d2af66011c7a98beeb6d1b690c748afc

4 years agoAdd missing requirements to suite tests
Gord Thompson [Fri, 15 Jan 2021 13:35:01 +0000 (06:35 -0700)] 
Add missing requirements to suite tests

Fixes: #5841
Change-Id: I53e8405e6ca8c3fd6909744632b76db724d9eb1f

4 years agoMerge "update execute() arg formats in modules and tests"
mike bayer [Fri, 15 Jan 2021 18:40:44 +0000 (18:40 +0000)] 
Merge "update execute() arg formats in modules and tests"

4 years agoMerge "Replace mapper with map_imperatively in mapping styles example"
mike bayer [Fri, 15 Jan 2021 18:20:10 +0000 (18:20 +0000)] 
Merge "Replace mapper with map_imperatively in mapping styles example"

4 years agoupdate execute() arg formats in modules and tests
Mike Bayer [Wed, 6 Jan 2021 15:43:19 +0000 (10:43 -0500)] 
update execute() arg formats in modules and tests

continuing with producing a SQLAlchemy 1.4.0b2 that internally
does not emit any of its own 2.0 deprecation warnings,
migrate the *args and **kwargs passed to execute() methods
that now must be a single list or dictionary.

Alembic 1.5 is again waiting on this internal consistency to
be present so that it can pass all tests with no 2.0
deprecation warnings.

Change-Id: If6b792e57c8c5dff205419644ab68e631575a2fa

4 years agoMerge "Add mssql+turbodbc to external dialect list"
mike bayer [Fri, 15 Jan 2021 14:53:57 +0000 (14:53 +0000)] 
Merge "Add mssql+turbodbc to external dialect list"

4 years agoCreate explicit GC ordering between ConnectionFairy/ConnectionRecord
Mike Bayer [Thu, 14 Jan 2021 23:07:14 +0000 (18:07 -0500)] 
Create explicit GC ordering between ConnectionFairy/ConnectionRecord

Fixed issue where connection pool would not return connections to the pool
or otherwise be finalized upon garbage collection under pypy if the checked
out connection fell out of scope without being closed.   This is a long
standing issue due to pypy's difference in GC behavior that does not call
weakref finalizers if they are relative to another object that is also
being garbage collected.  A strong reference to the related record is now
maintained so that the weakref has a strong-referenced "base" to trigger
off of.

Fixes: #5842
Change-Id: Id5448fdacb6cceaac1ea40b2fbc851f052ed8e86

4 years agoallow Executable to be accepted by Session.execute()
Mike Bayer [Fri, 15 Jan 2021 04:01:13 +0000 (23:01 -0500)] 
allow Executable to be accepted by Session.execute()

Fixed an issue where the API to create a custom executable SQL construct
using the ``sqlalchemy.ext.compiles`` extension according to the
documentation that's been up for many years would no longer function if
only ``Executable, ClauseElement`` were used as the base classes,
additional classes were needed if wanting to use
:meth:`_orm.Session.execute`. This has been resolved so that those extra
classes aren't needed.

Change-Id: I99b8acd88515c2a52842d62974199121e64c0381

4 years agofix double is_none()
Mike Bayer [Fri, 15 Jan 2021 04:34:11 +0000 (23:34 -0500)] 
fix double is_none()

I added an extra is_none() by mistake the other day and for
some reason it sneaked past flake8.  it's breaking all the
builds so get it back in

Change-Id: I17b311341169571efa856e062c6be7e8f362618f

4 years agoMerge "Use UnsupportedCompilationError for no default compiler"
mike bayer [Thu, 14 Jan 2021 18:55:59 +0000 (18:55 +0000)] 
Merge "Use UnsupportedCompilationError for no default compiler"

4 years agoUse UnsupportedCompilationError for no default compiler
Mike Bayer [Thu, 14 Jan 2021 16:18:58 +0000 (11:18 -0500)] 
Use UnsupportedCompilationError for no default compiler

Fixed issue where the stringification that is sometimes called when
attempting to generate the "key" for the ``.c`` collection on a selectable
would fail if the column were an unlabeled custom SQL construct using the
``sqlalchemy.ext.compiler`` extension, and did not provide a default
compilation form; while this seems like an unusual case, it can get invoked
for some ORM scenarios such as when the expression is used in an "order by"
in combination with joined eager loading.  The issue is that the lack of a
default compiler function was raising :class:`.CompileError` and not
:class:`.UnsupportedCompilationError`.

Fixes: #5836
Change-Id: I5af243b2c70c7dcca4b212a3869c3017a50c132b

4 years agoFix docs typo: subuqery -> subquery
Evan Moore [Thu, 14 Jan 2021 08:22:48 +0000 (03:22 -0500)] 
Fix docs typo: subuqery -> subquery

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

### Description
Fixes #5839
(sorry, realized just now that an issue wasn't required)

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [x] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #5840
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5840
Pull-request-sha: b6f6af929fab4dab771565f6373b0275acbca793

Change-Id: I0b4c9b2d893e8141ee1cd21742a9b111fe371bac

4 years agoMerge "reinvent xdist hooks in terms of pytest fixtures"
mike bayer [Thu, 14 Jan 2021 03:40:22 +0000 (03:40 +0000)] 
Merge "reinvent xdist hooks in terms of pytest fixtures"

4 years agoreinvent xdist hooks in terms of pytest fixtures
Mike Bayer [Sun, 10 Jan 2021 18:44:14 +0000 (13:44 -0500)] 
reinvent xdist hooks in terms of pytest fixtures

To allow the "connection" pytest fixture and others work
correctly in conjunction with setup/teardown that expects
to be external to the transaction, remove and prevent any usage
of "xdist" style names that are hardcoded by pytest to run
inside of fixtures, even function level ones.   Instead use
pytest autouse fixtures to implement our own
r"setup|teardown_test(?:_class)?" methods so that we can ensure
function-scoped fixtures are run within them.   A new more
explicit flow is set up within plugin_base and pytestplugin
such that the order of setup/teardown steps, which there are now
many, is fully documented and controllable.   New granularity
has been added to the test teardown phase to distinguish
between "end of the test" when lock-holding structures on
connections should be released to allow for table drops,
vs. "end of the test plus its teardown steps" when we can
perform final cleanup on connections and run assertions
that everything is closed out.

From there we can remove most of the defensive "tear down everything"
logic inside of engines which for many years would frequently dispose
of pools over and over again, creating for a broken and expensive
connection flow.  A quick test shows that running test/sql/ against
a single Postgresql engine with the new approach uses 75% fewer new
connections, creating 42 new connections total, vs. 164 new
connections total with the previous system.

As part of this, the new fixtures metadata/connection/future_connection
have been integrated such that they can be combined together
effectively.  The fixture_session(), provide_metadata() fixtures
have been improved, including that fixture_session() now strongly
references sessions which are explicitly torn down before
table drops occur afer a test.

Major changes have been made to the
ConnectionKiller such that it now features different "scopes" for
testing engines and will limit its cleanup to those testing
engines corresponding to end of test, end of test class, or
end of test session.   The system by which it tracks DBAPI
connections has been reworked, is ultimately somewhat similar to
how it worked before but is organized more clearly along
with the proxy-tracking logic.  A "testing_engine" fixture
is also added that works as a pytest fixture rather than a
standalone function.  The connection cleanup logic should
now be very robust, as we now can use the same global
connection pools for the whole suite without ever disposing
them, while also running a query for PostgreSQL
locks remaining after every test and assert there are no open
transactions leaking between tests at all.  Additional steps
are added that also accommodate for asyncio connections not
explicitly closed, as is the case for legacy sync-style
tests as well as the async tests themselves.

As always, hundreds of tests are further refined to use the
new fixtures where problems with loose connections were identified,
largely as a result of the new PostgreSQL assertions,
many more tests have moved from legacy patterns into the newest.

An unfortunate discovery during the creation of this system is that
autouse fixtures (as well as if they are set up by
@pytest.mark.usefixtures) are not usable at our current scale with pytest
4.6.11 running under Python 2.  It's unclear if this is due
to the older version of pytest or how it implements itself for
Python 2, as well as if the issue is CPU slowness or just large
memory use, but collecting the full span of tests takes over
a minute for a single process when any autouse fixtures are in
place and on CI the jobs just time out after ten minutes.
So at the moment this patch also reinvents a small version of
"autouse" fixtures when py2k is running, which skips generating
the real fixture and instead uses two global pytest fixtures
(which don't seem to impact performance) to invoke the
"autouse" fixtures ourselves outside of pytest.
This will limit our ability to do more with fixtures
until we can remove py2k support.

py.test is still observed to be much slower in collection in the
4.6.11 version compared to modern 6.2 versions, so add support for new
TOX_POSTGRESQL_PY2K and TOX_MYSQL_PY2K environment variables that
will run the suite for fewer backends under Python 2.  For Python 3
pin pytest to modern 6.2 versions where performance for collection
has been improved greatly.

Includes the following improvements:

Fixed bug in asyncio connection pool where ``asyncio.TimeoutError`` would
be raised rather than :class:`.exc.TimeoutError`.  Also repaired the
:paramref:`_sa.create_engine.pool_timeout` parameter set to zero when using
the async engine, which previously would ignore the timeout and block
rather than timing out immediately as is the behavior with regular
:class:`.QueuePool`.

For asyncio the connection pool will now also not interact
at all with an asyncio connection whose ConnectionFairy is
being garbage collected; a warning that the connection was
not properly closed is emitted and the connection is discarded.
Within the test suite the ConnectionKiller is now maintaining
strong references to all DBAPI connections and ensuring they
are released when tests end, including those whose ConnectionFairy
proxies are GCed.

Identified cx_Oracle.stmtcachesize as a major factor in Oracle
test scalability issues, this can be reset on a per-test basis
rather than setting it to zero across the board.  the addition
of this flag has resolved the long-standing oracle "two task"
error problem.

For SQL Server, changed the temp table style used by the
"suite" tests to be the double-pound-sign, i.e. global,
variety, which is much easier to test generically.  There
are already reflection tests that are more finely tuned
to both styles of temp table within the mssql test
suite.  Additionally, added an extra step to the
"dropfirst" mechanism for SQL Server that will remove
all foreign key constraints first as some issues were
observed when using this flag when multiple schemas
had not been torn down.

Identified and fixed two subtle failure modes in the
engine, when commit/rollback fails in a begin()
context manager, the connection is explicitly closed,
and when "initialize()" fails on the first new connection
of a dialect, the transactional state on that connection
is still rolled back.

Fixes: #5826
Fixes: #5827
Change-Id: Ib1d05cb8c7cf84f9a4bfd23df397dc23c9329bfe

4 years agoupdate aiomysql extra to match asyncpg, also dedupe asyncio extras
Thomas Grainger [Wed, 13 Jan 2021 18:15:52 +0000 (13:15 -0500)] 
update aiomysql extra to match asyncpg, also dedupe asyncio extras

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

### Description
currently the asyncio extra-deps are duplicated between every async driver (or it seems they are supposed to be). This updates all async drivers to depend on the `sqlalchemy[asyncio]` extra using the `%(asyncio)s` shorthand

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #5830
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5830
Pull-request-sha: 9146e5f1391015b284fd96def8c04e36a7c985d2

Change-Id: I1865cc67b4cdf9f73a7effbfcb86cf2c1f824644

4 years agoAdd mssql+turbodbc to external dialect list
Gord Thompson [Tue, 12 Jan 2021 19:58:22 +0000 (12:58 -0700)] 
Add mssql+turbodbc to external dialect list

Fixes: #5834
Change-Id: I1f207b84751e7e3425aa9e8e393787eeb9b595b7

4 years agoprovide FAQ entry for percent sign escaping in SQL compiler
Mike Bayer [Wed, 13 Jan 2021 14:06:50 +0000 (09:06 -0500)] 
provide FAQ entry for percent sign escaping in SQL compiler

this is coming up more than once so provide a document

Change-Id: I23dcd4c7a6527b2f33502e67ffad4335f895e6f9

4 years agoremove greenlet from default requires
Mike Bayer [Tue, 12 Jan 2021 22:59:03 +0000 (17:59 -0500)] 
remove greenlet from default requires

openstack builds are broken right now and the greenlet != 4.1.17
is blocking me from getting them to work, as greenlet has not
released yet.   greenlet is set up for the "asyncio"
dependency and for tox, need to get openstack working
for now.

Change-Id: Idc7057e93f97cd6e606bb32a9d2b046f157bb4b9

4 years agoReplace mapper with map_imperatively in mapping styles example
Federico Caselli [Tue, 12 Jan 2021 21:26:34 +0000 (22:26 +0100)] 
Replace mapper with map_imperatively in mapping styles example

Fixes: #5829
Change-Id: Iad49b038a6061c1b699b31400a199bf65ced6156

4 years agoMerge remote-tracking branch 'origin/pr/5809' into master
Mike Bayer [Mon, 11 Jan 2021 18:46:52 +0000 (13:46 -0500)] 
Merge remote-tracking branch 'origin/pr/5809' into master

Change-Id: I08b2ba039ed44147cf2dafc91d569d646138e697

4 years agoImprove ``run_sync`` documentation in asyncio ext
Federico Caselli [Wed, 6 Jan 2021 09:46:29 +0000 (10:46 +0100)] 
Improve ``run_sync`` documentation in asyncio ext

Change-Id: I202458ab6d81e29053118c9fb9c205b865c8d2ba
Ref: #5817

4 years agoImplement connection binding for AsyncSession
Mike Bayer [Thu, 7 Jan 2021 03:56:14 +0000 (22:56 -0500)] 
Implement connection binding for AsyncSession

Implemented "connection-binding" for :class:`.AsyncSession`, the ability to
pass an :class:`.AsyncConnection` to create an :class:`.AsyncSession`.
Previously, this use case was not implemented and would use the associated
engine when the connection were passed.  This fixes the issue where the
"join a session to an external transaction" use case would not work
correctly for the :class:`.AsyncSession`.  Additionally, added methods
:meth:`.AsyncConnection.in_transaction`,
:meth:`.AsyncConnection.in_nested_transaction`,
:meth:`.AsyncConnection.get_transaction`.

The :class:`.AsyncEngine`, :class:`.AsyncConnection` and
:class:`.AsyncTransaction` objects may be compared using Python ``==`` or
``!=``, which will compare the two given objects based on the "sync" object
they are proxying towards. This is useful as there are cases particularly
for :class:`.AsyncTransaction` where multiple instances of
:class:`.AsyncTransaction` can be proxying towards the same sync
:class:`_engine.Transaction`, and are actually equivalent.   The
:meth:`.AsyncConnection.get_transaction` method will currently return a new
proxying :class:`.AsyncTransaction` each time as the
:class:`.AsyncTransaction` is not otherwise statefully associated with its
originating :class:`.AsyncConnection`.

Fixes: #5811
Change-Id: I5a3a6b2f088541eee7b0e0f393510e61bc9f986b

4 years agoMerge "Remove special rule for TypeDecorator of TypeDecorator"
mike bayer [Thu, 7 Jan 2021 20:58:55 +0000 (20:58 +0000)] 
Merge "Remove special rule for TypeDecorator of TypeDecorator"

4 years agoUpdate connect args for pymysql 1.0.0; aiomysql fixes
Mike Bayer [Thu, 7 Jan 2021 17:20:51 +0000 (12:20 -0500)] 
Update connect args for pymysql 1.0.0; aiomysql fixes

Fixed deprecation warnings that arose as a result of the release of PyMySQL
1.0, including deprecation warnings for the "db" and "passwd" parameters
now replaced with "database" and "password".

For the 1.4 version of this patch, we are also changing tox.ini
to refer to a local branch of aiomysql that fixes pymysql
compatibility issues.

Fixes: #5821
Change-Id: I93876b52b2d96b52308f22aeb4f244ac5766a82f

4 years agorepair transaction scope in test_nullPKsOK_BtoA for mssql
Mike Bayer [Thu, 7 Jan 2021 16:01:31 +0000 (11:01 -0500)] 
repair transaction scope in test_nullPKsOK_BtoA for mssql

In the bound metadata removal we also mixed use of
connection/engine in this test which is causing a hang
on SQL Server.

Change-Id: Ibbee06654d0d549968db5e0bf9daa5bef27cdbe1

4 years agorepair ORM tests that use deferrable FKs
Mike Bayer [Wed, 6 Jan 2021 17:50:22 +0000 (12:50 -0500)] 
repair ORM tests that use deferrable FKs

after the bound metadata merge the unitofwork.TransactionTest
became deprecations.AutocommitClosesOnFail and was found to
be not actually running correctly on SQLite.  This test
should only run on a backend that has deferrable FKs,
which includes PostgreSQL; so add that to requirements.  this
in turn requires clarification of test_naturalpks that the
"deferrable FKs" req there is more about Oracle and its lack
of ON UPDATE cascades.

Change-Id: I867a164679274940803852c1af0920da74683bfa

4 years agoMerge "remove more bound metadata"
mike bayer [Wed, 6 Jan 2021 15:25:21 +0000 (15:25 +0000)] 
Merge "remove more bound metadata"