]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
5 years agoimprove linux build 5241/head
Federico Caselli [Thu, 9 Apr 2020 21:02:12 +0000 (23:02 +0200)] 
improve linux build

Change-Id: I9bde5fb2cd9997c620d8ee3173fcd7fc6d80cae7

5 years agoallow for no spaced near the = in the tag_build
Federico Caselli [Wed, 8 Apr 2020 22:56:42 +0000 (00:56 +0200)] 
allow for no spaced near the = in the tag_build

Change-Id: I67b524025467fc2ee1faf34f3fe241a19b9c72f3

5 years agoremove duplicated pip update command
Federico Caselli [Wed, 8 Apr 2020 22:43:48 +0000 (00:43 +0200)] 
remove duplicated pip update command

Change-Id: I5f1d888a13dbdf4c9ded85a6922c9ffcdaea5a0f

5 years agoremove tag_build from setup.cfg
Federico Caselli [Wed, 8 Apr 2020 22:27:09 +0000 (00:27 +0200)] 
remove tag_build from setup.cfg

Change-Id: I547aecb28cda29607371138bf3a0c559a786c818

5 years agoAdd github workflow to generate wheel running after a release has beed created
Federico Caselli [Wed, 8 Apr 2020 20:17:42 +0000 (22:17 +0200)] 
Add github workflow to generate wheel running after a release has beed created

Change-Id: I916491f8f6bdbf7de7970a0ad4b24b9965003786

5 years agotop link to 2.0 from the 1.4 docs
Mike Bayer [Wed, 8 Apr 2020 15:39:54 +0000 (11:39 -0400)] 
top link to 2.0 from the 1.4 docs

as these two versions are highly interrelated

Change-Id: I353ba3d40584781a547435e3ba2b3c36d926ba94

5 years agocherry-pick changelog update for 1.3.17
Mike Bayer [Wed, 8 Apr 2020 02:47:20 +0000 (22:47 -0400)] 
cherry-pick changelog update for 1.3.17

5 years agocherry-pick changelog from 1.3.16
Mike Bayer [Wed, 8 Apr 2020 02:47:20 +0000 (22:47 -0400)] 
cherry-pick changelog from 1.3.16

5 years agoMerge "Use dot-separated name resolution for relationship target"
mike bayer [Wed, 8 Apr 2020 01:48:20 +0000 (01:48 +0000)] 
Merge "Use dot-separated name resolution for relationship target"

5 years agoUse dot-separated name resolution for relationship target
Mike Bayer [Tue, 7 Apr 2020 21:37:14 +0000 (17:37 -0400)] 
Use dot-separated name resolution for relationship target

The string argument accepted as the first positional argument by the
:func:`.relationship` function when using the Declarative API is no longer
interpreted using the Python ``eval()`` function; instead, the name is dot
separated and the names are looked up directly in the name resolution
dictionary without treating the value as a Python expression.  However,
passing a string argument to the other :func:`.relationship` parameters
that necessarily must accept Python expressions will still use ``eval()``;
the documentation has been clarified to ensure that there is no ambiguity
that this is in use.

Fixes: #5238
Change-Id: Id802f403190adfab0ca034afe2214ba10fd9cfbb

5 years agoGracefully skip isolation level if no row returned
Mike Bayer [Tue, 7 Apr 2020 23:21:01 +0000 (19:21 -0400)] 
Gracefully skip isolation level if no row returned

Fixed issue in MySQL dialect when connecting to a psuedo-MySQL database
such as that provided by ProxySQL, the up front check for isolation level
when it returns no row will not prevent the dialect from continuing to
connect. A warning is emitted that the isolation level could not be
detected.

Fixes: #5239
Change-Id: I4a240386a0d38bd90733819495ce50e37fe2234c

5 years agoMerge "Add github action workflow to run tests on master and on pr to master"
mike bayer [Tue, 7 Apr 2020 16:19:55 +0000 (16:19 +0000)] 
Merge "Add github action workflow to run tests on master and on pr to master"

5 years agoMerge "Broaden is[not]_distinct_from support"
mike bayer [Tue, 7 Apr 2020 01:04:09 +0000 (01:04 +0000)] 
Merge "Broaden is[not]_distinct_from support"

5 years agoMerge "Clean up (engine|db).execute for oracle"
mike bayer [Mon, 6 Apr 2020 21:54:52 +0000 (21:54 +0000)] 
Merge "Clean up (engine|db).execute for oracle"

5 years agoClean up (engine|db).execute for oracle
Gord Thompson [Tue, 31 Mar 2020 15:59:16 +0000 (09:59 -0600)] 
Clean up (engine|db).execute for oracle

Change-Id: I6064fe348394152b2a47e83e43c469a153d34d27

5 years agoEnsure length parameter of Enum is adapted to new objects
Mike Bayer [Mon, 6 Apr 2020 20:19:23 +0000 (16:19 -0400)] 
Ensure length parameter of Enum is adapted to new objects

Ensure length parameter added to Enum in
Iea05dc8cd9e33959bb968b394fb10a7dd068c873 is correctly propagated
to new enum objects adapted from this one.

Fixes: #5183
`

Change-Id: I7f20d926f73ec8260938963df87e29894c7e55e2

5 years agoMerge "Add length parameter in `Enum`"
mike bayer [Mon, 6 Apr 2020 20:11:20 +0000 (20:11 +0000)] 
Merge "Add length parameter in `Enum`"

5 years agoAdd length parameter in `Enum`
Federico Caselli [Tue, 24 Mar 2020 20:06:04 +0000 (21:06 +0100)] 
Add length parameter in `Enum`

The `Enum` type now supports the parameter `Enum.length`
to specify the length of the VARCHAR column to create when using
non native enums by setting `Enum.native_enum` to `False`

Fixes: #5183
Change-Id: Iea05dc8cd9e33959bb968b394fb10a7dd068c873

5 years agoMerge "fix typo on testing.skip_if assertion"
mike bayer [Mon, 6 Apr 2020 16:51:32 +0000 (16:51 +0000)] 
Merge "fix typo on testing.skip_if assertion"

5 years agoApply fix to ComputedReflectionFixtureTest
Gord Thompson [Sat, 4 Apr 2020 19:39:50 +0000 (13:39 -0600)] 
Apply fix to ComputedReflectionFixtureTest

Avoid errors for dialects without schema support.
Also fix typo in test name.

Fixes: #5230
Change-Id: Id0f759b591a6119069b0fc5fc3b02addb85b0597

5 years agoEnsure context.attrbutes dictionary is reset each time
Mike Bayer [Sat, 4 Apr 2020 21:18:46 +0000 (17:18 -0400)] 
Ensure context.attrbutes dictionary is reset each time

A memory growth issue was identified in this test which
caused the profiling results to be inaccurate.

Change-Id: I248dcce5833feada947bc91bdf09a8f925d31d65

5 years agoKey subqueryloaders on the property object, not string key
Mike Bayer [Fri, 3 Apr 2020 20:00:22 +0000 (16:00 -0400)] 
Key subqueryloaders on the property object, not string key

Fixed bug in :func:`.orm.selectinload` loading option where two or more
loaders that represent different relationships with the same string key
name as referenced from a single :func:`.orm.with_polymorphic` construct
with multiple subclass mappers would fail to invoke each subqueryload
separately, instead making use of a single string-based slot that would
prevent the other loaders from being invoked.

Fixes: #5228
Change-Id: Id0d1db8029ca88c13c0068115fe673adb7a68407

5 years agoAdd github action workflow to run tests on master and on pr to master
Federico Caselli [Fri, 3 Apr 2020 18:11:24 +0000 (14:11 -0400)] 
Add github action workflow to run tests on master and on pr to master

Trying the pr to check if it works right away

### Description
<!-- Describe your changes in detail -->

### 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
- [x] 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: #5222
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5222
Pull-request-sha: afbb8567525f3841554d3ba599ef4d713c78e647

Change-Id: I4981b02f900e76e446cf42e6cc6495ffc0883951

5 years agoRun autoflush for column attribute load operations
Mike Bayer [Fri, 3 Apr 2020 00:45:44 +0000 (20:45 -0400)] 
Run autoflush for column attribute load operations

The "autoflush" behavior of :class:`.Query` will now trigger for nearly
all ORM level attribute load operations, including when a deferred
column is loaded as well as when an expired column is loaded.   Previously,
autoflush on load of expired or unloaded attributes was limited to
relationship-bound attributes only.   However, this led to the issue
where column-based attributes that also depended on other rows, or even
other columns in the same row, in order to express the correct value,
would show an effectively stale value when accessed as there could be
pending changes in the session left to be flushed.    Autoflush
is now disabled only in some cases where attributes are being unexpired in
the context of a history operation.

Fixes: #5226
Change-Id: Ibd965b30918cd273ae020411a704bf2bb1891f59

5 years agoBroaden is[not]_distinct_from support
Gord Thompson [Thu, 2 Apr 2020 17:51:11 +0000 (11:51 -0600)] 
Broaden is[not]_distinct_from support

Added support for .is[not]_distinct_from to SQL Server, MySQL, and Oracle.

Fixes: #5137
Change-Id: I3b4d3b199821a55687f83c9a5b63a95d07a64cd5

5 years agoRepair caching / traversals for values
Mike Bayer [Wed, 1 Apr 2020 22:31:16 +0000 (18:31 -0400)] 
Repair caching / traversals for values

The test suite wasn't running the copy_internals most fixtures,
enable that and try to get all cases working.

Set up selectable.values to do tuple conversion within compilation
step.  at the same time, disable caching for selectable.values
for the moment and make it equivalent to dml_multi_values.

fix cache / compare / copy cases for dml_values and dml_multi_values
which weren't fully tested or covered.

Change-Id: I484ca6e9cb2b66c2e6a321698f2abc0838db1460

5 years agoTry to measure new style caching in the ORM, take two
Mike Bayer [Mon, 9 Mar 2020 21:12:35 +0000 (17:12 -0400)] 
Try to measure new style caching in the ORM, take two

Supercedes: If78fbb557c6f2cae637799c3fec2cbc5ac248aaf

Trying to see if by making the cache key memoized, we
still can have the older "identity" form of caching
which is the cheapest of all, at the same time as the
newer "cache key each time" version that is not nearly
as cheap; but still much cheaper than no caching at all.

Also needed is a per-execution update of _keymap when
we invoke from a cached select, so that Column objects
that are anonymous or otherwise adapted will match up.
this is analogous to the adaption of bound parameters
from the cache key.

Adds test coverage for the keymap / construct_params()
 changes related to caching.  Also hones performance
to a large extent for statement construction and
cache key generation.

Also includes a new memoized attribute
approach that vastly simplifies the previous approach
of "group_expirable_memoized_property" and finally
integrates cleanly with _clone(), _generate(), etc.
no more hardcoding of attributes is needed, as well
as that most _reset_memoization() calls are no longer
needed as the reset is inherent in a _generate() call;
this also has dramatic performance improvements.

Change-Id: I95c560ffcbfa30b26644999412fb6a385125f663

5 years agoFix databases -> dialects
Mike Bayer [Wed, 1 Apr 2020 17:51:35 +0000 (13:51 -0400)] 
Fix databases -> dialects

The change in I5343a2d270ed5a8c654b9fe13dff40cdf54649ed
left the name "databases" present in one spot, which is usually
not reached unless tests are being run on only partial files
where not every dialect has been imported.

Change-Id: I5a8776b412eaf2476f8a93eebc31448b6f9218ee

5 years agofix typo on testing.skip_if assertion
Federico Caselli [Tue, 31 Mar 2020 19:13:21 +0000 (21:13 +0200)] 
fix typo on testing.skip_if assertion

Change-Id: I3f2eeffb0b59971a6025f9ce69250d6421751d16

5 years agoMerge "Clean up (engine|db).execute for sqlite"
mike bayer [Tue, 31 Mar 2020 16:30:41 +0000 (16:30 +0000)] 
Merge "Clean up (engine|db).execute for sqlite"

5 years agoMerge "Clean up (engine|db).execute for mysql"
mike bayer [Tue, 31 Mar 2020 16:29:00 +0000 (16:29 +0000)] 
Merge "Clean up (engine|db).execute for mysql"

5 years agoMerge "Clean up .execute calls in PostgreSQL tests"
mike bayer [Tue, 31 Mar 2020 16:28:23 +0000 (16:28 +0000)] 
Merge "Clean up .execute calls in PostgreSQL tests"

5 years agoClean up .execute calls in PostgreSQL tests
Gord Thompson [Sat, 28 Mar 2020 23:34:05 +0000 (17:34 -0600)] 
Clean up .execute calls in PostgreSQL tests

Fixes: #5220
Change-Id: I789e45dffc2b177ebb15ea3268bb965be8b06397

5 years agoClean up (engine|db).execute for sqlite
Gord Thompson [Tue, 31 Mar 2020 13:19:13 +0000 (07:19 -0600)] 
Clean up (engine|db).execute for sqlite

Change-Id: Ie43e5b3a34ecc64ab77410e42f3e8de8bbc1e2d8

5 years agoClean up (engine|db).execute for mysql
Gord Thompson [Tue, 31 Mar 2020 12:33:55 +0000 (06:33 -0600)] 
Clean up (engine|db).execute for mysql

Change-Id: Ibc3509630a7c418b500ec7c6587f311326b75c93

5 years agoFix one more db.execute in mssql test
Gord Thompson [Tue, 31 Mar 2020 12:04:59 +0000 (06:04 -0600)] 
Fix one more db.execute in mssql test

Change-Id: Ia34da0d3bbaaa3e98a5318191a38a5c3354061c9

5 years agoFix sqlite memory req
Mike Bayer [Mon, 30 Mar 2020 19:04:53 +0000 (15:04 -0400)] 
Fix sqlite memory req

this is only used by test/requirements.py right now for the
profiling tests but it was not returning the correct answer
during a regenerate operation.

Change-Id: Id9747b4fe562b8bea9b21c465b626b1b19e6956b

5 years agoupdates to 2.0 migration notes
Mike Bayer [Mon, 30 Mar 2020 18:06:28 +0000 (14:06 -0400)] 
updates to 2.0 migration notes

- make sure when we refer to 2.0 code we use the future.select()
pattern, not session.query()

- add more imports to examples

- note code examples that are "new" vs. "old"

Change-Id: I001e180231783cc77192013bf0a1501c7540e90f

5 years agoRemove ORDER BY pk from subqueryload, selectinload
Mike Bayer [Mon, 30 Mar 2020 15:04:24 +0000 (11:04 -0400)] 
Remove ORDER BY pk from subqueryload, selectinload

Modified the queries used by subqueryload and selectinload to no longer
ORDER BY the primary key of the parent entity;  this ordering was there to
allow the rows as they come in to be copied into lists directly with a
minimal level of Python-side collation.   However, these ORDER BY clauses
can negatively impact the performance of the query as in many scenarios
these columns are derived from a subquery or are otherwise not actual
primary key columns such that SQL planners cannot make use of indexes. The
Python-side collation uses the native itertools.group_by() to collate the
incoming rows, and has been modified to allow multiple
row-groups-per-parent to be assembled together using list.extend(), which
should still allow for relatively fast Python-side performance.  There will
still be an ORDER BY present for a relationship that includes an explicit
order_by parameter, however this is the only ORDER BY that will be added to
the query for both kinds of loading.

Fixes: #5162
Change-Id: I8befd1303c1af7cc24cbf005f39bc01c8b2745f3

5 years agoMerge "String compiler can now literal compile datetime objects"
mike bayer [Mon, 30 Mar 2020 13:57:08 +0000 (13:57 +0000)] 
Merge "String compiler can now literal compile datetime objects"

5 years agoMerge "Add a third labeling mode for SELECT statements"
mike bayer [Mon, 30 Mar 2020 13:06:04 +0000 (13:06 +0000)] 
Merge "Add a third labeling mode for SELECT statements"

5 years agoAdd a third labeling mode for SELECT statements
Mike Bayer [Sun, 29 Mar 2020 18:24:39 +0000 (14:24 -0400)] 
Add a third labeling mode for SELECT statements

Enhanced the disambiguating labels feature of the
:func:`~.sql.expression.select` construct such that when a select statement
is used in a subquery, repeated column names from different tables are now
automatically labeled with a unique label name, without the need to use the
full "apply_labels()" feature that conbines tablename plus column name.
The disambigated labels are available as plain string keys in the .c
collection of the subquery, and most importantly the feature allows an ORM
:func:`.orm.aliased` construct against the combination of an entity and an
arbitrary subquery to work correctly, targeting the correct columns despite
same-named columns in the source tables, without the need for an "apply
labels" warning.

The existing labeling style is now called
LABEL_STYLE_TABLENAME_PLUS_COL.  This labeling style will remain used
throughout the ORM as has been the case for over a decade, however,
the new disambiguation scheme could theoretically replace this scheme
entirely.  The new scheme would dramatically alter how SQL looks
when rendered from the ORM to be more succinct but arguably harder
to read.

The tablename_columnname scheme used by Join.c is unaffected here,
as that's still hardcoded to that scheme.

Fixes: #5221
Change-Id: Ib47d9e0f35046b3afc77bef6e65709b93d0c3026

5 years agoMerge "Remove support for python 3.4"
mike bayer [Mon, 30 Mar 2020 01:47:50 +0000 (01:47 +0000)] 
Merge "Remove support for python 3.4"

5 years agoRemove support for python 3.4
Federico Caselli [Sun, 29 Mar 2020 18:57:08 +0000 (20:57 +0200)] 
Remove support for python 3.4

Also remove no longer used compat code

Change-Id: Ifda239fd84b425e43f4028cb55a5b3b8efa4dfc6

5 years agoString compiler can now literal compile datetime objects
Federico Caselli [Tue, 24 Mar 2020 21:55:46 +0000 (22:55 +0100)] 
String compiler can now literal compile datetime objects

Add ability to literal compile a :class:`DateTime`, :class:`Date`
or :class:"Time" when using the string dialect for debugging purposes.
This change does not impact real dialect implementation that retain
their current behavior.

Fixes: #5052
Change-Id: Ia3fad2be905c6d35b0106b9a2388c7508f067e90

5 years agoMerge "Repair queries from #5134 to ORDER BY outside the subquery"
mike bayer [Sun, 29 Mar 2020 18:41:55 +0000 (18:41 +0000)] 
Merge "Repair queries from #5134 to ORDER BY outside the subquery"

5 years agoRepair queries from #5134 to ORDER BY outside the subquery
Mike Bayer [Sun, 29 Mar 2020 16:06:29 +0000 (12:06 -0400)] 
Repair queries from #5134 to ORDER BY outside the subquery

ORDER BY has to be on the outermost query to guarantee ordering
as these tests were failing for SQL Server.   Also add
new tests that don't use from_self() as this is also going to
be removed in 2.0.

Also propose some from_self() alternatives.  References #5221

Change-Id: Ia2a669f45fcaada607e73d9225849fd74d25f6e5

5 years agoFix typo in resultproxy.c and test compatibility with python 3.5
Federico Caselli [Sat, 28 Mar 2020 10:04:44 +0000 (11:04 +0100)] 
Fix typo in resultproxy.c and test compatibility with python 3.5

- Fix typo in resultproxy.c that would error on windows.
- add -Wundef to C flags when linux is detected so that undefined
symbols emit a warning
- a few adjustments for tests to succeed on python 3.5
- note minimum version still documented here as 3.4 but this should
move to at least 3.5 if not 3.6 for SQLAlchemy 1.4

Change-Id: Ia93ee1cb5c52e51e72eb0a24c100421c5157d04b

5 years agointroduce "autobegin" concept for Connection
Mike Bayer [Thu, 26 Mar 2020 21:26:57 +0000 (17:26 -0400)] 
introduce "autobegin" concept for Connection

because engine.connect() and engine.begin() should feature
identical internal behavior, with the sole exception that
one rolls back and the end and the other commits at the end,
while also supporting execution options like transaction isolation level
at the connection level, include that engine.connect() will
return a connection that uses autobegin in the same way as the
session will.   This is solely to support the "begin" event
noting that a transaction is begun which is tracked on the
connection.    Behavior and design should be very similar to that
of the ORM session and "Transaction" should no longer be a very
explicit object.

Change-Id: I9c317d242ca7a435de0f17b1618355e29a10d1bc

5 years agotypo: missing comma 5215/head
michitaro.koike [Thu, 26 Mar 2020 07:09:42 +0000 (16:09 +0900)] 
typo: missing comma

5 years agoFix typos in migration_20 documentation
Federico Caselli [Wed, 25 Mar 2020 19:47:25 +0000 (20:47 +0100)] 
Fix typos in migration_20 documentation

Change-Id: I9ea9fc5bffe8615de432e2bb113e0a14bdf05e54

5 years agoMerge "Correct ambiguous func / class links"
mike bayer [Wed, 25 Mar 2020 17:28:29 +0000 (17:28 +0000)] 
Merge "Correct ambiguous func / class links"

5 years agoMerge "Deprecate add of columns in order by with distinct"
mike bayer [Wed, 25 Mar 2020 15:37:26 +0000 (15:37 +0000)] 
Merge "Deprecate add of columns in order by with distinct"

5 years agoCorrect ambiguous func / class links
Mike Bayer [Wed, 25 Mar 2020 15:34:19 +0000 (11:34 -0400)] 
Correct ambiguous func / class links

:func:`.sql.expression.select`, :func:`.sql.expression.insert`
and :class:`.sql.expression.Insert` were hitting many ambiguous
symbol errors, due to future.select, as well as the PG/MySQL
variants of Insert.

Change-Id: Iac862bfc172a7f7f0cbba5353a83dc203bed376c

5 years agoDeprecate add of columns in order by with distinct
Federico Caselli [Sat, 15 Feb 2020 11:34:37 +0000 (12:34 +0100)] 
Deprecate add of columns in order by with distinct

Deprecate automatic addition of order by column in a query with a distinct

Fixes: #5134
Change-Id: I467a39379c496be7e84a05f11ba9f8ca2bcc6e32

5 years agoMerge "Implement autocommit isolation level for pysqlite"
mike bayer [Tue, 24 Mar 2020 21:11:26 +0000 (21:11 +0000)] 
Merge "Implement autocommit isolation level for pysqlite"

5 years agoMerge "Implement SQL VALUES in core."
mike bayer [Tue, 24 Mar 2020 19:55:44 +0000 (19:55 +0000)] 
Merge "Implement SQL VALUES in core."

5 years agoMerge "Convert schema_translate to a post compile"
mike bayer [Tue, 24 Mar 2020 19:53:14 +0000 (19:53 +0000)] 
Merge "Convert schema_translate to a post compile"

5 years agoMerge "Improve the method ``__str__`` of :class:`ColumnCollection`"
mike bayer [Tue, 24 Mar 2020 19:51:37 +0000 (19:51 +0000)] 
Merge "Improve the method ``__str__`` of :class:`ColumnCollection`"

5 years agoImprove the method ``__str__`` of :class:`ColumnCollection`
Federico Caselli [Mon, 23 Mar 2020 20:17:01 +0000 (21:17 +0100)] 
Improve the method ``__str__`` of :class:`ColumnCollection`

The change avoids confusing a :class:`ColumnCollection` with a python list since the
previous string representation was the same.

Fixes: #5191
Change-Id: Icdbc08f9991d31ce86372505e3614740eaee56e2

5 years agoAdd link to whats new in 2.0 doc
Mike Bayer [Tue, 24 Mar 2020 18:46:46 +0000 (14:46 -0400)] 
Add link to whats new in 2.0 doc

Change-Id: Iff54f3db8ccf47802f61837956afae0c5d441f68

5 years agoConvert schema_translate to a post compile
Mike Bayer [Mon, 23 Mar 2020 18:52:05 +0000 (14:52 -0400)] 
Convert schema_translate to a post compile

Revised the :paramref:`.Connection.execution_options.schema_translate_map`
feature such that the processing of the SQL statement to receive a specific
schema name occurs within the execution phase of the statement, rather than
at the compile phase.   This is to support the statement being efficiently
cached.   Previously, the current schema being rendered into the statement
for a particular run would be considered as part of the cache key itself,
meaning that for a run against hundreds of schemas, there would be hundreds
of cache keys, rendering the cache much less performant.  The new behavior
is that the rendering is done in a similar  manner as the "post compile"
rendering added in 1.4 as part of :ticket:`4645`, :ticket:`4808`.

Fixes: #5004
Change-Id: Ia5c89eb27cc8dc2c5b8e76d6c07c46290a7901b6

5 years agoImplement autocommit isolation level for pysqlite
Gord Thompson [Sat, 22 Feb 2020 13:44:05 +0000 (06:44 -0700)] 
Implement autocommit isolation level for pysqlite

Fixes: #5164
Change-Id: I190b9de552dfed9f2a33babf82e42465ef09c82a

5 years agoImplement SQL VALUES in core.
Gord Thompson [Fri, 20 Dec 2019 00:58:52 +0000 (19:58 -0500)] 
Implement SQL VALUES in core.

Added a core :class:`Values` object that enables a VALUES construct
to be used in the FROM clause of an SQL statement for databases that
support it (mainly PostgreSQL and SQL Server).

Fixes: #4868
Closes: #5030
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5030
Pull-request-sha: 84684038a8efa93b460318e0db53f6c644554588

Change-Id: Ib8109b63bc1a9dc04ab987c5322ca3375f7e824d

5 years agoReword changelog for issue #5207
Mike Bayer [Tue, 24 Mar 2020 16:51:53 +0000 (12:51 -0400)] 
Reword changelog for issue #5207

SQLAlchemy can remain using setuptools even when pep-517 is
the standard installation process.   We are omitting the file
for now because it leads to new pip installation issues that need
to be worked out in the greater pip community before SQLAlchemy
opts into this system.

Change-Id: I40b196100c6f16ae1291fcb7f8b5196bba14a300

5 years agoMerge "Remove deprecated elements from selectable.py; remove lockmode"
mike bayer [Mon, 23 Mar 2020 18:55:02 +0000 (18:55 +0000)] 
Merge "Remove deprecated elements from selectable.py; remove lockmode"

5 years agoRemove deprecated elements from selectable.py; remove lockmode
Mike Bayer [Sun, 2 Feb 2020 16:39:37 +0000 (11:39 -0500)] 
Remove deprecated elements from selectable.py; remove lockmode

Removed autocommit and legacy "for update" / "lockmode" elements
from selectable.py / query.py.  lockmode was removed from
selectable in 693938dd6fb2f3ee3e031aed4c62355ac97f3ceb
however was not removed from the ORM.

Also removes the ignore_nonexistent_tables option on
join().

Change-Id: I0cfcf9e6a8d4ef6432c9e25ef75173b3b3f5fd87
Partially-fixes: #4643

5 years agoImplement autocommit isolation level for cx_oracle
Gord Thompson [Thu, 12 Mar 2020 18:54:37 +0000 (12:54 -0600)] 
Implement autocommit isolation level for cx_oracle

As part of this change Oracle also gets the concept of a
default isolation level, however since Oracle does not provide a
fixed method of knowing what the isolation level would be without a
server side transaction actually in progress, for now we hardcode
just to "READ COMMITTED".

Enhanced the test suite for isolation level testing in the dialect
test suite and added features to requirements so that the supported
isolation levels can be reported generically for dialects.

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

5 years agoMerge "Test instance for matching class hierarchy on get_from_identity"
mike bayer [Sun, 22 Mar 2020 16:47:04 +0000 (16:47 +0000)] 
Merge "Test instance for matching class hierarchy on get_from_identity"

5 years agoTest instance for matching class hierarchy on get_from_identity
Mike Bayer [Sat, 21 Mar 2020 21:26:24 +0000 (17:26 -0400)] 
Test instance for matching class hierarchy on get_from_identity

Fixed issue where a lazyload that uses session-local "get" against a target
many-to-one relationship where an object with the correct primary key is
present, however it's an instance of a sibling class, does not correctly
return None as is the case when the lazy loader actually emits a load for
that row.

Fixes: #5210
Change-Id: I89f9946cfeba61d89a272435f76a5a082b1da30c

5 years agoMerge "Deprecate plain string in execute and introduce `exec_driver_sql`"
mike bayer [Sun, 22 Mar 2020 15:04:59 +0000 (15:04 +0000)] 
Merge "Deprecate plain string in execute and introduce `exec_driver_sql`"

5 years agoDeprecate plain string in execute and introduce `exec_driver_sql`
Federico Caselli [Sat, 14 Mar 2020 13:02:44 +0000 (14:02 +0100)] 
Deprecate plain string in execute and introduce `exec_driver_sql`

Execution of literal sql string is deprecated in the
:meth:`.Connection.execute` and a warning is raised when used stating
that it will be coerced to :func:`.text` in a future release.
To execute a raw sql string the new connection method
:meth:`.Connection.exec_driver_sql` was added, that will retain the previous
behavior, passing the string to the DBAPI driver unchanged.
Usage of scalar or tuple positional parameters in :meth:`.Connection.execute`
is also deprecated.

Fixes: #4848
Fixes: #5178
Change-Id: I2830181054327996d594f7f0d59c157d477c3aa9

5 years agoRemove pyproject.toml from distribution
Mike Bayer [Sat, 21 Mar 2020 14:16:47 +0000 (10:16 -0400)] 
Remove pyproject.toml from distribution

SQLAlchemy does not want to opt-in to pep-517 at this time
as this would require a custom build backend interface
which we have not built yet, and the standard is not
widely adopted at this time in any case.  Per
[1] [2], the presence of this file indicates a positive opt-in
to pep-517, so it must be omitted from source distributions.

[1] https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
[2] https://www.python.org/dev/peps/pep-0517/#id5

Fixes: #5207
Change-Id: If8d26a9edf942047920d273d8be778df7a018b3e

5 years agoClarify Alembic vs. Migrate
Mike Bayer [Fri, 20 Mar 2020 20:40:47 +0000 (16:40 -0400)] 
Clarify Alembic vs. Migrate

Migrate is fully legacy at this point so continue to mention
it to provide clarity, but ensure it isn't suggested
as a real alternative.  It's unclear if Migrate will be able
to support SQLAlchemy 2.0.

Change-Id: Ia81aaccbd18f197ab533b083e87cc4d04ea05839

5 years agoEmphasize context managers when working with Core
Mike Bayer [Fri, 20 Mar 2020 19:21:10 +0000 (15:21 -0400)] 
Emphasize context managers when working with Core

Prep the main documentation for the changes coming up in 1.4
by first removing references to engine.execute() outside
of the "connectionless" section, and using context managers
in all cases.  For features that have always been confusing
and are going away, add a note that this feature will
be going away.

Change-Id: I94583444734e36f5432c32cb37f88a9fad15634a

5 years agoCorrect misleading guidance on multiprocessing
Mike Bayer [Fri, 20 Mar 2020 15:17:47 +0000 (11:17 -0400)] 
Correct misleading guidance on multiprocessing

Link the connections intro to the dedicated section
on multiprocessing rather than stating that a separate
engine per process is needed, since this is inaccurate
and vague.

Change-Id: I48c66f88a90db918e864cd198c6aed335e28c7e6

5 years agoDon't include PG INCLUDE columns as regular index columns
mike bayer [Wed, 18 Mar 2020 23:05:20 +0000 (19:05 -0400)] 
Don't include PG INCLUDE columns as regular index columns

Fixed issue where a "covering" index, e.g. those which have an  INCLUDE
clause, would be reflected including all the columns in INCLUDE clause as
regular columns.  A warning is now emitted if these additional columns are
detected indicating that they are currently ignored.  Note that full
support for "covering" indexes is part of :ticket:`4458`.  Pull request
courtesy Marat Sharafutdinov.

Fixes: #5205
Closes: #5206
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5206
Pull-request-sha: 512a3817bb21991142add2d192fa7ce9b285369d

Change-Id: I3196a2bf77dc5a6abd85b2fbf0ebff1b30d4fb00

5 years agoMerge "updated doc string to show `NOT (EXISTS` instead of `NOT EXISTS`, as …"
mike bayer [Wed, 18 Mar 2020 17:01:25 +0000 (17:01 +0000)] 
Merge "updated doc string to show `NOT (EXISTS` instead of `NOT EXISTS`, as …"

5 years agoMerge "import the module as passed before we look in sys.modules"
mike bayer [Tue, 17 Mar 2020 18:08:30 +0000 (18:08 +0000)] 
Merge "import the module as passed before we look in sys.modules"

5 years agoimport the module as passed before we look in sys.modules
Mike Bayer [Fri, 13 Mar 2020 22:37:25 +0000 (18:37 -0400)] 
import the module as passed before we look in sys.modules

in I2e291eba4297867fc0ddb5d875b9f7af34751d01, the importer
is importing tokens[0:-1] and then the final token as the name;
this doesn't always work for the two example modules of "xml.dom"
and "wsgiref.simple_server".  import the complete path we will
pull from sys.modules directly.

Change-Id: I833a770f4c3e7463fa56234d891870083e48cc73

5 years agoFix "special_key" attribute name in association proxy documentation
Mike Bayer [Tue, 17 Mar 2020 02:06:15 +0000 (22:06 -0400)] 
Fix "special_key" attribute name in association proxy documentation

Fixes: #5204
Change-Id: I1366be823d753bdcd92c98b948bdfa7960a27eb7

5 years agoSupport inspection of computed column
Federico Caselli [Sat, 14 Mar 2020 12:57:42 +0000 (13:57 +0100)] 
Support inspection of computed column

Added support for reflection of "computed" columns, which are now returned
as part of the structure returned by :meth:`.Inspector.get_columns`.
When reflecting full :class:`.Table` objects, computed columns will
be represented using the :class:`.Computed` construct.

Also improve the documentation in :meth:`Inspector.get_columns`, correctly
listing all the returned keys.

Fixes: #5063
Fixes: #4051
Closes: #5064
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5064
Pull-request-sha: ba00fc321ce468f8885aad23b3dd33c789e50fbe

Change-Id: I789986554fc8ac7f084270474d0b2c12046b1cc2

5 years agoupdated doc string to show `NOT (EXISTS` instead of `NOT EXISTS`, as …
jonathan vanasco [Sat, 14 Mar 2020 12:27:43 +0000 (08:27 -0400)] 
updated doc string to show `NOT (EXISTS` instead of `NOT EXISTS`, as …

…that is what SqlAlchemy now renders.

SqlAlchemy currently renders `NOT (EXISTS` not `NOT EXISTS`. This fixes the example SQL.

### Description
The change is a docstring only.

### Checklist

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

Change-Id: Iee826a1754d76c93c014b44374e0f9aeabb8d0b6

5 years agoMerge "Fix IntegerTest for sqlalchemy-firebird"
mike bayer [Fri, 13 Mar 2020 21:11:59 +0000 (21:11 +0000)] 
Merge "Fix IntegerTest for sqlalchemy-firebird"

5 years agoFix tests failing for SQLite file databases; repair provisioning
Gord Thompson [Wed, 26 Feb 2020 19:50:01 +0000 (12:50 -0700)] 
Fix tests failing for SQLite file databases; repair provisioning

1. ensure provision.py loads dialect implementations when running
reap_dbs.py.   Reapers haven't been working since
598f2f7e557073f29563d4d567f43931fc03013f .

2. add some exclusion rules to allow the sqlite_file target to work;
add to tox.

3. add reap dbs target for SQLite, repair SQLite drop_db routine
which also wasn't doing the right thing for memory databases
etc.

4. Fix logging in provision files, as the main provision logger
is the one that's enabled by reap_dbs and maybe others, have all
the provision files use the provision logger.

Fixes: #5180
Fixes: #5168
Change-Id: Ibc1b0106394d20f5bcf847f37b09d185f26ac9b5

5 years agoDisable sqlite_file tests by default, take two
Mike Bayer [Fri, 13 Mar 2020 16:14:12 +0000 (12:14 -0400)] 
Disable sqlite_file tests by default, take two

We need no tests to run for sqlite_file until we merge
a full fix for it.   We'd like Jenkins to include this target.

Change-Id: I2737fa462572f08e2925b232a8f24d1ecd26b3ac

5 years agoInclude schema in all_tab_comments query
Mike Bayer [Fri, 13 Mar 2020 03:11:18 +0000 (23:11 -0400)] 
Include schema in all_tab_comments query

Fixed regression / incorrect fix caused by fix for :ticket:`5146` where the
Oracle dialect reads from the "all_tab_comments" view to get table comments
but fails to accommodate for the current owner of the table being
requested, causing it to read the wrong comment if multiple tables of the
same name exist in multiple schemas.

Fixes: #5146
Change-Id: Id79fbaa81b0e36cd4af60c48e4ab35c593ace057

5 years agoDont raise on pytest deprecation warnings
Mike Bayer [Thu, 12 Mar 2020 23:44:37 +0000 (19:44 -0400)] 
Dont raise on pytest deprecation warnings

py.test 5.4.0 emits deprecation warnings for pytest.Class.
make sure we don't raise for these, and log the code that will
be used for 5.4.0 when we bump requirements.

Fixes: #5201
Change-Id: I83e0402c4a6b2365a63b58d052c6989df3a37328

5 years agoAdd placeholder for sqlite file database
Mike Bayer [Thu, 12 Mar 2020 23:12:09 +0000 (19:12 -0400)] 
Add placeholder for sqlite file database

So that we can enable this in jenkins until
 Ibc1b0106394d20f5bcf847f37b09d185f26ac9b5 is merged.

Change-Id: Ia704e75bf3767e02d448a6af02530dfc89c9920b

5 years agoRemove trailing slashes in pre-commit config
Mike Bayer [Thu, 12 Mar 2020 00:47:25 +0000 (20:47 -0400)] 
Remove trailing slashes in pre-commit config

See https://github.com/sqlalchemy/dogpile.cache/pull/176

Change-Id: Id9a75546d4d0eae93ad837a77c6ffa9249efff5c

5 years agoMerge "Fix link in docs of query_expression and with_expression"
mike bayer [Wed, 11 Mar 2020 18:39:09 +0000 (18:39 +0000)] 
Merge "Fix link in docs of query_expression and with_expression"

5 years agoFix link in docs of query_expression and with_expression
Federico Caselli [Wed, 11 Mar 2020 18:09:41 +0000 (19:09 +0100)] 
Fix link in docs of query_expression and with_expression

Ref #5198

Change-Id: I566c2f7bbe08e9017e09e133079bef1c38469595

5 years agoMerge "Add missing changelog"
mike bayer [Wed, 11 Mar 2020 18:09:08 +0000 (18:09 +0000)] 
Merge "Add missing changelog"

5 years agoMerge "Rework select(), CompoundSelect() in terms of CompileState"
mike bayer [Wed, 11 Mar 2020 18:08:03 +0000 (18:08 +0000)] 
Merge "Rework select(), CompoundSelect() in terms of CompileState"

5 years agoAdd missing changelog
Federico Caselli [Wed, 11 Mar 2020 12:49:57 +0000 (13:49 +0100)] 
Add missing changelog

Add a changelog plus migration notes for the behavior
that's been improved by #4656, #4689

Original patch I2e291eba4297867fc0ddb5d875b9f7af34751d01

Change-Id: Ie956f55ba79b2a4f7a0c972a47c767de2ffd0081

5 years agocherry-pick changelog update for 1.3.16
Mike Bayer [Wed, 11 Mar 2020 16:36:59 +0000 (12:36 -0400)] 
cherry-pick changelog update for 1.3.16

5 years agocherry-pick changelog from 1.3.15
Mike Bayer [Wed, 11 Mar 2020 16:36:59 +0000 (12:36 -0400)] 
cherry-pick changelog from 1.3.15

5 years agoRepair broken call to sys.exc_info()
Mike Bayer [Wed, 11 Mar 2020 14:41:12 +0000 (10:41 -0400)] 
Repair broken call to sys.exc_info()

Fixed regression in 1.3.14 due to :ticket:`4849` where a sys.exc_info()
call failed to be invoked correctly when a flush error would occur. Test
coverage has been added for this exception case.

Fixes: #5196
Change-Id: Ib59a58a3a9d4c9c6f4b751201b794816a9f70225

5 years agoReword implicit left join error; ensure deterministic FROM for columns
Mike Bayer [Tue, 10 Mar 2020 22:48:42 +0000 (18:48 -0400)] 
Reword implicit left join error; ensure deterministic FROM for columns

Adjusted the error message emitted by :meth:`.Query.join` when a left hand
side can't be located that the :meth:`.Query.select_from` method is the
best way to resolve the issue.  Also, within the 1.3 series, used a
deterministic ordering when determining the FROM clause from a given column
entity passed to :class:`.Query` so that the same expression is determined
each time.

Fixes: #5194
Change-Id: I2e4065fd31e98c57edf2f11d5e831be44d2c1ea2

5 years agoMerge "Also run black --check in the tox pep8 env"
mike bayer [Tue, 10 Mar 2020 21:27:15 +0000 (21:27 +0000)] 
Merge "Also run black --check in the tox pep8 env"