]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
7 years ago- convert to spaces
Mike Bayer [Mon, 31 Jul 2017 12:30:45 +0000 (08:30 -0400)] 
- convert to spaces
- restore unreleased directories

Change-Id: Ia5c1142ffbdba6372f800c2e2521660ab62d9c4f
(cherry picked from commit a1160414b8dc798a1cf1b8c71a68c6cdc3526384)

8 years agoRevert cx_Oracle WITH_UNICODE change under > 5.0
Mike Bayer [Fri, 28 Jul 2017 19:05:25 +0000 (15:05 -0400)] 
Revert cx_Oracle WITH_UNICODE change under > 5.0

Fixed performance regression caused by the fix for :ticket:`3937` where
cx_Oracle as of version 5.3 dropped the ``.UNICODE`` symbol from its
namespace,  which was interpreted as cx_Oracle's "WITH_UNICODE" mode being
turned on unconditionally, which invokes functions on the SQLAlchemy
side which convert all strings to unicode unconditionally and causing
a performance impact.  In fact, per cx_Oracle's author the
"WITH_UNICODE" mode has been removed entirely as of 5.1, so the expensive unicode
conversion functions are no longer necessary and are disabled if
cx_Oracle 5.1 or greater is detected under Python 2.  The warning against
"WITH_UNICODE" mode that was removed under :ticket:`3937` is also restored.

Change-Id: Iddd38d81a5adb27c953a5ee2eae5529a21da16e1
Fixes: #4035
(cherry picked from commit 7997d7fdc3634e7dba9fd0113b8b85ef311bfeaa)

8 years ago- 1.1.13
Mike Bayer [Fri, 28 Jul 2017 19:16:17 +0000 (15:16 -0400)] 
- 1.1.13
- 1.0.19

Change-Id: I476213fe905a51826feeddb4e1c97416c2bac558

8 years ago- 1.1.12 rel_1_1_12
Mike Bayer [Mon, 24 Jul 2017 21:18:33 +0000 (17:18 -0400)] 
- 1.1.12

8 years ago- 1.0.18 release date
Mike Bayer [Mon, 24 Jul 2017 21:14:51 +0000 (17:14 -0400)] 
- 1.0.18 release date

(cherry picked from commit f00391a070d9031941bb1c17aecb265b566a6a5b)

Change-Id: Ib9e96acddc871fddbb7eb94993f0994248f8a85d

8 years agoMerge "Ensure we check for boolean condition when we inspect __exit__()" into rel_1_1
mike bayer [Mon, 24 Jul 2017 20:55:00 +0000 (16:55 -0400)] 
Merge "Ensure we check for boolean condition when we inspect __exit__()" into rel_1_1

8 years agoMerge "Guard all indexed access in WeakInstanceDict" into rel_1_1
mike bayer [Mon, 24 Jul 2017 18:50:11 +0000 (14:50 -0400)] 
Merge "Guard all indexed access in WeakInstanceDict" into rel_1_1

8 years agoMake flush logic slightly clearer in tutorial.
Feanil Patel [Sun, 23 Jul 2017 13:17:39 +0000 (09:17 -0400)] 
Make flush logic slightly clearer in tutorial.

Improve the wording of how sessions commit changes.
(cherry picked from commit c9b37f9689dca784a0a5d932cd8f0cd133c436cc)

8 years agoEnsure we check for boolean condition when we inspect __exit__()
Mike Bayer [Mon, 24 Jul 2017 16:13:05 +0000 (12:13 -0400)] 
Ensure we check for boolean condition when we inspect __exit__()

Fixed issue in testing fixtures which was incompatible with a change
made as of Python 3.6.2 involving context managers.

Change-Id: I0f12aa6cc15cba89153f7e4888ac347e7ce599c7
Fixes: #4034
(cherry picked from commit 7d4005156b5a48989dae7c4424faafc03cc8410d)

8 years agoGuard all indexed access in WeakInstanceDict
Mike Bayer [Mon, 17 Jul 2017 15:06:22 +0000 (11:06 -0400)] 
Guard all indexed access in WeakInstanceDict

Added ``KeyError`` checks to all methods within
:class:`.WeakInstanceDict` where a check for ``key in dict`` is
followed by indexed access to that key, to guard against a race against
garbage collection that under load can remove the key from the dict
after the code assumes its present, leading to very infrequent
``KeyError`` raises.

Change-Id: I881cc2899f7961d29a0549f44149a2615ae7a4ea
Fixes: #4030
(cherry picked from commit 1a75f676d75b5daf67455d6e85b7b4df6f2316dc)

8 years ago- Merge directory holder README from 1.0.x and also 1.0's changelog
Mike Bayer [Mon, 24 Jul 2017 14:50:37 +0000 (10:50 -0400)] 
- Merge directory holder README from 1.0.x and also 1.0's changelog

Change-Id: I588eebd027b4ad3428bd522f36a6f1cd77f105bb
(cherry picked from commit 39c72682b85c1d3912ced383733d03eca7a43845)

8 years ago- move to file-per-changelog for unreleased change notes,
Mike Bayer [Sat, 22 Jul 2017 20:32:01 +0000 (16:32 -0400)] 
- move to file-per-changelog for unreleased change notes,
so that we no longer have to rely upon merges within
the changelog files.   because gerrit doesn't allow us
to use custom merge engines unlike git, we have no ability
to merge multiple changes into the changelog files without
going through conflicts.   new version of changelog
in git supports these new patterns.

Change-Id: I588eebd027b4ad3428bd522f36a6f1cd77f105bb
(cherry picked from commit 39c72682b85c1d3912ced383733d03eca7a43845)

8 years agoMerge "Check for column object in eval_none, not propkey" into rel_1_1
mike bayer [Wed, 19 Jul 2017 20:22:10 +0000 (16:22 -0400)] 
Merge "Check for column object in eval_none, not propkey" into rel_1_1

8 years agoCheck for column object in eval_none, not propkey
Mike Bayer [Tue, 18 Jul 2017 15:41:12 +0000 (11:41 -0400)] 
Check for column object in eval_none, not propkey

Fixed bug involving JSON NULL evaluation logic added in 1.1 as part
of :ticket:`3514` where the logic would not accommodate ORM
mapped attributes named differently from the :class:`.Column`
that was mapped.

Change-Id: I1848afcfb63ad7f074f315d8d3097666069b42be
Fixes: #4031
(cherry picked from commit e2ede596adff3ce584f8c43ba024cafabc509a06)

8 years agoCheck for non-entity when inspecting for subqueryload
Mike Bayer [Tue, 18 Jul 2017 18:58:26 +0000 (14:58 -0400)] 
Check for non-entity when inspecting for subqueryload

Fixed issue where adding additional non-entity columns to
a query that includes an entity with subqueryload relationships
would fail, due to an inspection added in 1.1.11 as a result of
:ticket:`4011`.

Change-Id: I8ef082be649125bdc07b428cb9b0a77a65d73671
Fixes: #4033
(cherry picked from commit 3d41ea09a899b06feedd02864a69b8dc833f5a6b)

8 years agoReplace Session class with session instance
Tom Sitter [Wed, 12 Jul 2017 15:54:25 +0000 (11:54 -0400)] 
Replace Session class with session instance

The Session class was used instead of the session instance which resulted in an attribute error.
(cherry picked from commit 43f41fbfaa8f3030148c131628c5e9fe8fda9f66)

8 years agoFix typo, foriegn -> foreign
Pablo Marti [Mon, 10 Jul 2017 17:43:58 +0000 (19:43 +0200)] 
Fix typo, foriegn -> foreign
(cherry picked from commit c6b46759829633e6745b561861891a8ffb85fbb8)

8 years ago- remove intersphinx usage, the overhead of re-fetching
Mike Bayer [Sun, 9 Jul 2017 17:02:59 +0000 (13:02 -0400)] 
- remove intersphinx usage, the overhead of re-fetching
inventory on every build not worth it

Change-Id: I3c4506b246d0f327c4b56afa723975daee984476
(cherry picked from commit a66979fe1efaa93ba25b1bcd8b67ea2eae2fc48b)

8 years agoAdd support for CACHE and ORDER to sequences
David Moore [Wed, 5 Jul 2017 19:06:49 +0000 (15:06 -0400)] 
Add support for CACHE and ORDER to sequences

Added new keywords :paramref:`.Sequence.cache` and
:paramref:`.Sequence.order` to :class:`.Sequence`, to allow rendering
of the CACHE parameter understood by Oracle and PostgreSQL, and the
ORDER parameter understood by Oracle.  Pull request
courtesy David Moore.

Change-Id: I082c3f8ef56ef89dbaad5da9d5695be5313b0614
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/96
(cherry picked from commit faa6609dac2ce6e55e0f690df3ba88c13133ec5c)

8 years ago- 1.1.12 placeholder
Mike Bayer [Wed, 5 Jul 2017 20:08:02 +0000 (16:08 -0400)] 
- 1.1.12 placeholder

Change-Id: Ibf559430163717fc58d0e72f28c1e2f0051b26bc

8 years agoInclude missing import in example
Michael Stewart [Fri, 30 Jun 2017 21:02:20 +0000 (14:02 -0700)] 
Include missing import in example
(cherry picked from commit 1db3029abc371c0808fb622ae2bd716ada81281a)

8 years agoadded link for CrateDB support
Jodok Batlogg [Fri, 23 Jun 2017 19:16:18 +0000 (21:16 +0200)] 
added link for CrateDB support

(cherry picked from commit 9f1a375f10cb7af558a9549081a0e792546aca21)

8 years ago- 1.1.12 prep
Mike Bayer [Mon, 19 Jun 2017 15:01:58 +0000 (11:01 -0400)] 
- 1.1.12 prep

Change-Id: Ibc3f1490ccf5c8e6d467340b2b73f9ddfebfb83c

8 years ago- 1.1.11 rel_1_1_11
Mike Bayer [Mon, 19 Jun 2017 14:42:56 +0000 (10:42 -0400)] 
- 1.1.11

8 years agoMerge "Handle SHOW VARIABLES returning no row" into rel_1_1
mike bayer [Fri, 16 Jun 2017 22:39:59 +0000 (18:39 -0400)] 
Merge "Handle SHOW VARIABLES returning no row" into rel_1_1

8 years agoHandle SHOW VARIABLES returning no row
Mike Bayer [Fri, 16 Jun 2017 17:30:25 +0000 (13:30 -0400)] 
Handle SHOW VARIABLES returning no row

MySQL 5.7 has introduced permission limiting for the "SHOW VARIABLES"
command; the MySQL dialect will now handle when SHOW returns no
row, in particular for the initial fetch of SQL_MODE, and will
emit a warning that user permissions should be modified to allow the
row to be present.

Change-Id: I98e7a69230da397b17eae07b7e9d024fa7aeeb26
Fixes: #4007
(cherry picked from commit 5650a0c306391216a9c9ce1961c5b548e534b5eb)

8 years agoRepair WithinGroup.get_children()
Mike Bayer [Fri, 16 Jun 2017 13:58:03 +0000 (09:58 -0400)] 
Repair WithinGroup.get_children()

Fixed AttributeError which would occur in :class:`.WithinGroup`
construct during an iteration of the structure.

Change-Id: I563882d93c8c32292463a605b636aa60c77e9406
Fixes: #4012
(cherry picked from commit 3a314fcea8539133947d5ec8e42a6c86e30fdf9a)

8 years agoSet complete FROM list for subquery eagerload's orig query
Mike Bayer [Thu, 15 Jun 2017 17:12:16 +0000 (13:12 -0400)] 
Set complete FROM list for subquery eagerload's orig query

Instead of checking that the "orig_entity" we receive applies
as a correct FROM element for the subquery we're building,
set the FROM clause of the query to exactly what it already
is based on column_descriptions (assuming there is no FROM
list already), thereby ensuring that the FROM list will remain
intact, regardless of what orig_entity turns out to be and
what the target_cols ultimately refer towards.

Fixed issue with subquery eagerloading which continues on from
the series of issues fixed in :ticket:`2699`, :ticket:`3106`,
:ticket:`3893` involving that the "subquery" contains the correct
FROM clause when beginning from a joined inheritance subclass
and then subquery eager loading onto a relationship from
the base class, while the query also includes criteria against
the subclass. The fix in the previous tickets did not accommodate
for additional subqueryload operations loading more deeply from
the first level, so the fix has been further generalized.

Change-Id: Ic909590814f71e577d8266b1dbc4c393dc48e019
Fixes: #4011
(cherry picked from commit 6d2a03c1ec21cc428c91476c170ad7dbe219926c)

8 years ago- fix the col length missing just like in master...
Mike Bayer [Thu, 15 Jun 2017 22:47:33 +0000 (18:47 -0400)] 
- fix the col length missing just like in master...

Change-Id: I172999198217b9a09f136664f5a7e38e7e099df6

8 years agoMerge test case from 770e1e399cb0c91db73a551e1962ccbb57f42e76,
Mike Bayer [Thu, 15 Jun 2017 20:06:23 +0000 (16:06 -0400)] 
Merge test case from 770e1e399cb0c91db73a551e1962ccbb57f42e76,
which applies to a 1.2 regression

Change-Id: Ic99508dbf48e63b97975cb06fcb84e73135e0f4f

8 years ago- repair "types" imports in postgresql/test_types, master
Mike Bayer [Fri, 9 Jun 2017 15:06:13 +0000 (11:06 -0400)] 
- repair "types" imports in postgresql/test_types, master
using "sqltypes" now

Change-Id: Ic327eb8b5708739c9e225512f85a44b05e50be49

8 years agoRender ARRAY index embedded between type and COLLATE
Mike Bayer [Thu, 8 Jun 2017 16:55:23 +0000 (12:55 -0400)] 
Render ARRAY index embedded between type and COLLATE

Fixed bug where using :class:`.ARRAY` with a string type that
features a collation would fail to produce the correct syntax
within CREATE TABLE.

The "COLLATE" must appear to the right of the array dimensions,
so we are using regexp substitution to insert the brackets in the
appropriate place.  A more heavyweight solution would be that datatypes
know how to split up their base type vs. modifiers, but as this is
so specific to Postgresql ARRAY it's better to handle these cases
more locally.

Change-Id: I394c3c673eb60689e51b5301e51651972cfdb4c0
Fixes: #4006
(cherry picked from commit ec422fb70e0044ed42dcfda5fb1a7a65db322cf1)

8 years agoParse for Postgresql version w/ "beta"
Mike Bayer [Wed, 7 Jun 2017 16:30:22 +0000 (12:30 -0400)] 
Parse for Postgresql version w/ "beta"

Continuing with the fix that correctly handles Postgresql
version string "10devel" released in 1.1.8, an additional regexp
bump to handle version strings of the form "10beta1".   While
Postgresql now offers better ways to get this information, we
are sticking w/ the regexp at least through 1.1.x for the least
amount of risk to compatibility w/ older or alternate Postgresql
databases.

Change-Id: I12ddb06465f7dcf80563c27632441ef5963f60d4
Fixes: #4005
(cherry picked from commit b6d3f60791834ead92564fc58afebc2c3eb4a2ff)

8 years ago- assert passive_deletes='all' does not affect collection/scalar
Mike Bayer [Tue, 6 Jun 2017 22:53:03 +0000 (18:53 -0400)] 
- assert passive_deletes='all' does not affect collection/scalar
membership removal

in issue #3844 we hypotheized that passive_deletes='all' was broken
because it sets to NULL a foreign key attribute when the child
object is removed or replaced.   However, not doing the NULL
set means that nothing happens at all and the operation silently
fails.

Change-Id: I11834e7e324349e172dc797bac62731008b6b95a
(cherry picked from commit acf64c4178169b765f3f7ae492b1774955cf541f)

8 years agoFix a few doc typos
Lele Gaifax [Mon, 22 May 2017 13:03:06 +0000 (15:03 +0200)] 
Fix a few doc typos

(cherry picked from commit 4779ddd865d693f4c3521fbe200a96b88ed67186)

Change-Id: Ib3caafad523fac408475a2557c30be9ff39b0a65

8 years agoAdd placeholder XML support
Mike Bayer [Fri, 26 May 2017 15:24:25 +0000 (11:24 -0400)] 
Add placeholder XML support

Added a placeholder type :class:`.mssql.XML` to the SQL Server
dialect, so that a reflected table which includes this type can
be re-rendered as a CREATE TABLE.  The type has no special round-trip
behavior nor does it currently support additional qualifying
arguments.

Change-Id: I651fa729bd8e9b31a0b5effe0839aff077d77c46
Fixes: #3973
(cherry picked from commit b1369b47217558779a5b8a17ecd945cedd608dc7)

8 years agoRaise if ForeignKeyConstraint created with different numbers of
Mike Bayer [Thu, 25 May 2017 14:17:11 +0000 (10:17 -0400)] 
Raise if ForeignKeyConstraint created with different numbers of
local and remote columns.

An :class:`.ArgumentError` is now raised if a
:class:`.ForeignKeyConstraint` object is created with a mismatched
number of "local" and "remote" columns, which otherwise causes the
internal state of the constraint to be incorrect.   Note that this
also impacts the condition where a dialect's reflection process
produces a mismatched set of columns for a foreign key constraint.

Downstream DB2 dialect has been reported as potentially causing this
scenario.

Change-Id: Id51c34a6c43749bb582639f9c1dc28723482f0e5
Fixes: #3949
References: #3998
(cherry picked from commit a78718b9340e9840a470300932af178ce57c0f7d)

8 years agoRemove twophase for cx_Oracle 6.x
Mike Bayer [Tue, 23 May 2017 14:17:51 +0000 (10:17 -0400)] 
Remove twophase for cx_Oracle 6.x

Support for two-phase transactions has been removed entirely for
cx_Oracle when version 6.0b1 or later of the DBAPI is in use.  The two-
phase feature historically has never been usable under cx_Oracle 5.x in
any case, and cx_Oracle 6.x has removed the connection-level "twophase"
flag upon which this feature relied.

Change-Id: I2e8161cc2bc12f4845c9224cd483038112fe9734
Fixes: #3997
(cherry picked from commit 1b98ce355a60b7ad9898aeb412c21591bb438231)

8 years ago- add option to disable py.test warnings plugin;
Mike Bayer [Tue, 23 May 2017 16:24:26 +0000 (12:24 -0400)] 
- add option to disable py.test warnings plugin;
lift cap on py.test.
references: https://github.com/pytest-dev/pytest/issues/2430

Change-Id: Ieb8a6258ba1d15efa570d9cda2b51cf021499a23
(cherry picked from commit a987942761542666be89f40a9ac4a35e001b8265)

8 years ago- add session.close() w/ rationale to top-level "using transactions"
Mike Bayer [Tue, 23 May 2017 15:35:12 +0000 (11:35 -0400)] 
- add session.close() w/ rationale to top-level "using transactions"
 section.  References #3974

Change-Id: Idb650cbe9825cfae893ee917132b5b9d693f0c6c
(cherry picked from commit 7fc7492d86f6e5ca105743a184cd07190e9f9b28)

8 years ago- pin py.test at 3.0.7 due to https://github.com/pytest-dev/pytest/issues/2430
Mike Bayer [Tue, 23 May 2017 15:12:22 +0000 (11:12 -0400)] 
- pin py.test at 3.0.7 due to https://github.com/pytest-dev/pytest/issues/2430

Change-Id: I587282da141aa6ea92f944eeb4c9e5782d0b5f29
(cherry picked from commit eed7888f85a4255390e2522dbd428cbfe7a08bab)

8 years ago- remove .gitattributes and merge=union as this isn't really
Mike Bayer [Mon, 22 May 2017 22:43:05 +0000 (18:43 -0400)] 
- remove .gitattributes and merge=union as this isn't really
    working anyway.   need to try something else.

Change-Id: I7a1a298023e151f04502c268734961b86ed2519b

8 years agoRepair formatting throughout documentation
Kataev Denis [Mon, 22 May 2017 21:52:45 +0000 (17:52 -0400)] 
Repair formatting throughout documentation

1. Section decorators to [one style](http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#sections):
without inset at both side and with same length as text.
2. Fix broken [reference](http://docs.sqlalchemy.org/en/latest/core/type_basics.html#generic-types).
3. Convert tabs to space in some small files.
4. Some python code snippets have python+sql syntax hint.

Change-Id: I39a7a41ef0b0591c6bf1e610748e2b5c19fc5379
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/361
(cherry picked from commit 42b6ef8ccd691f6ace30ae16ed70f92e748f763f)

8 years ago- add a note to versioning that version id col cannot be null,
Mike Bayer [Mon, 22 May 2017 18:32:06 +0000 (14:32 -0400)] 
- add a note to versioning that version id col cannot be null,
is not supported.

Change-Id: I3724fea3f2d508210e35827eb1ea17f5e334da19
Fixes: #3673
(cherry picked from commit fcaf17766fdd22e67407e432f7666d63439d7a39)

8 years agoPrevent SQL server isolation level from failing
Mike Bayer [Sun, 21 May 2017 19:28:00 +0000 (15:28 -0400)] 
Prevent SQL server isolation level from failing

Fixed bug where SQL Server transaction isolation must be fetched
from a different view when using Azure data warehouse, the query
is now attempted against both views and then a NotImplemented
is raised unconditionally if failure continues to provide the
best resiliency against future arbitrary API changes in new
SQL Server versions.

Change-Id: I621b5089febe8ace136428fa133fde1a7e21cda4
Fixes: #3994
(cherry picked from commit 2574ca4b215cb06720d3ff4352d87ce87ebdd160)

8 years ago- 1.1.11 version placeholder
Mike Bayer [Sun, 21 May 2017 19:25:09 +0000 (15:25 -0400)] 
- 1.1.11 version placeholder

Change-Id: I3a5850a704a2a4e69a9894544fcc4ffa60b1017f

8 years ago- add 1.1.11 placeholder
Mike Bayer [Sun, 21 May 2017 19:24:49 +0000 (15:24 -0400)] 
- add 1.1.11 placeholder

Change-Id: Ia45668f2882ac0e59ade390262b09cbb62ecac0b
(cherry picked from commit ccbd68bb3ce09a013c998e4dcc26c0df7b03f205)

8 years ago- 1.1.10 rel_1_1_10
Mike Bayer [Fri, 19 May 2017 20:11:30 +0000 (16:11 -0400)] 
- 1.1.10

8 years ago- Document the most transparent way to set JSON.NULL for
Mike Bayer [Thu, 18 May 2017 21:44:10 +0000 (17:44 -0400)] 
- Document the most transparent way to set JSON.NULL for
a column default.

The JSON.NULL value is special in that while it is a Python-side
value, it represents "do this special behavior", and is not at all
like any other Python-side value for which normally, that's exactly
the type of data we want back.   So in this case, encourage the user
to use a SQL expression that is exact, so in the ORM context, you get
back what was actually persisted in the column.  There's some variants
of this such as literal(JSON.NULL, JSON) but text("'null'") is simpler.

Change-Id: I0339fafdc03e4b2f533d53970b2f74c774f2687b
Fixes: #3923
(cherry picked from commit 4d4ea792e7ea7945de9c9b1e005ce09b2feb45b5)

8 years ago- add complete parameter /return value docs to session.begin() /
Mike Bayer [Wed, 17 May 2017 14:46:52 +0000 (10:46 -0400)] 
- add complete parameter /return value docs to session.begin() /
session.begin_nested().  Fixes #3993

Change-Id: If485d77b364c34d94061d2f48efbde3f8a8adec9
(cherry picked from commit 4c6917e1d68a8baab7efe10e9ce5e5c8187f65ca)

8 years ago- move additional sections under with_polymorphic missed
Mike Bayer [Tue, 16 May 2017 15:00:41 +0000 (11:00 -0400)] 
- move additional sections under with_polymorphic missed
in the previous change

Change-Id: I20217d4d4ebfc033229d87e472ad82d32202617a
(cherry picked from commit 75c8b88cddeeadb539fce1c038997d0aebe6f621)

8 years ago- categorize these two with_polymorphic subsections under with_polymorphic
Mike Bayer [Tue, 16 May 2017 14:51:14 +0000 (10:51 -0400)] 
- categorize these two with_polymorphic subsections under with_polymorphic

Change-Id: I8bd49ac241df4b8645c8f78938d6f8122952d75a
(cherry picked from commit 6079158b21da7598ff37115649bbdd955713eb11)

8 years ago- fix broken link
Mike Bayer [Tue, 16 May 2017 13:59:38 +0000 (09:59 -0400)] 
- fix broken link

Change-Id: I2f3b5ae29600696b34a6afdddc2f94920febf31d
(cherry picked from commit 7aa50b9b197d542b63e86f423865f9bbec7af443)

8 years agomodernize and repair inheritance examples
Mike Bayer [Tue, 16 May 2017 13:51:06 +0000 (09:51 -0400)] 
modernize and repair inheritance examples

remarkably, the examples for concrete and single were still
using classical mappings.    Ensure all three examples use
modern declarative patterns, each illustrate the identical set
of query operations.  Use back_populates, flat=True for joins,
etc. ensure flake8 linting, correct links and add a link back
from newly reworked inheritance documentation.

Change-Id: I8465a9badbb0eda804f457ccac599f051ee3c27c
(cherry picked from commit 5329fc481ed1dcea0e922fd63def3094bda12c91)

8 years agoCascade mappers in terms of the instance's mapper
Mike Bayer [Fri, 12 May 2017 14:53:54 +0000 (10:53 -0400)] 
Cascade mappers in terms of the instance's mapper

Fixed a (extremely old) bug in cascade_mappers where the
first cascade we do is against the "self" mapper, and not the
one that actually corresponds to the state given. These are
different in the case where we start with a relationship
to a class, and the instance is of a subclass, which itself
can have relationships that aren't on the base mapper.

A pretty severe bug that somehow has avoided the radar
since the beginning.

Change-Id: I512956b9757b07e06f3ca1ccb507a33fb10bed31
Fixes: #3986
(cherry picked from commit 0f8721fa52e335ab2abeb548c8914b99a8c5e1fd)

8 years agoAdd links to with_only_columns to Select.column, append_column
Mike Bayer [Fri, 12 May 2017 13:23:44 +0000 (09:23 -0400)] 
Add links to with_only_columns to Select.column, append_column

Provide a brief example for these two methods
indicating that typically a table-bound (or other selectable)
column is appended here, then link to with_only_columns
documentation which has in-depth guidelines already including
that one should not append columns from the current select to itself.

Change-Id: I0742405a7f3c41450d337b9c633519d9cc101dfb
Fixes: #3987
(cherry picked from commit 4352e220ac04d09e120c441e79b1ac12c7ca2c45)

8 years agoUpdate inheritance documentation.
Mike Bayer [Mon, 1 May 2017 17:04:32 +0000 (13:04 -0400)] 
Update inheritance documentation.

The inheritance documentation is confused, disorganized, and out
of date.  Reorganize and clarify, in particular in preparation
for new inheritance features.

Change-Id: Ibe6a35b4b0432bad866a6afb0598b2cf1b509f10
(cherry picked from commit 6194483b73c94565aee62c5867a251a1841db5a9)

8 years agoFix docs syntax error
Denis Kataev [Wed, 10 May 2017 12:33:16 +0000 (17:33 +0500)] 
Fix docs syntax error

(cherry picked from commit 3e3554d37ca589218c13f9b2969801dccbbdfa2c)

8 years agoMerge "Use regexp to parse cx_oracle version string" into rel_1_1
mike bayer [Tue, 9 May 2017 19:51:25 +0000 (15:51 -0400)] 
Merge "Use regexp to parse cx_oracle version string" into rel_1_1

8 years agoUse regexp to parse cx_oracle version string
Mike Bayer [Tue, 9 May 2017 16:17:04 +0000 (12:17 -0400)] 
Use regexp to parse cx_oracle version string

Fixed bug in cx_Oracle dialect where version string parsing would
fail for cx_Oracle version 6.0b1 due to the "b" character.  Version
string parsing is now via a regexp rather than a simple split.

Change-Id: I2af7172b0d7184e3ea3bd051e9fa8d6ca2a571cd
Fixes: #3975
(cherry picked from commit 50484eda7787c3e83c9c88c1841fc63b348ca23c)

8 years agoSupport autocommit for GRANT and REVOKE on postgresql
Jacob Hayes [Mon, 8 May 2017 20:26:06 +0000 (16:26 -0400)] 
Support autocommit for GRANT and REVOKE on postgresql

Extends `AUTOCOMMIT_REGEXP` for the postgres dialect to include `GRANT` and `REVOKE`.

Change-Id: Iba15f1ebf5bd7bc0fc1193fdf561417e53bf5d57
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/357
(cherry picked from commit 328248e6e31100aae03f060b83488f3116cd3450)

8 years agoProtect against cls weakref becoming None
Mike Bayer [Mon, 8 May 2017 22:36:57 +0000 (18:36 -0400)] 
Protect against cls weakref becoming None

Protected against testing "None" as a class in the case where
declarative classes are being garbage collected and new
automap prepare() operations are taking place concurrently, very
infrequently hitting a weakref that has not been fully acted upon
after gc.

Change-Id: I32e1dfc5ac46bac4127fe808cfd18368e2fad9dd
(cherry picked from commit 22570c3181ef4e98c548c2f6254a0c7585568f06)

8 years agoBreak the lines to fit pdf and fix another broken syntax
LunarShaddow [Mon, 8 May 2017 04:31:50 +0000 (12:31 +0800)] 
Break the lines to fit pdf and fix another broken syntax

(cherry picked from commit 3d19fb6d53c2aa0fdb7944569fa697c75785634c)

Change-Id: I17334d7673c645505af4eaaf2112544f2fa5e625

8 years ago- add 1.2 forwards-port version
Mike Bayer [Mon, 8 May 2017 21:54:15 +0000 (17:54 -0400)] 
- add 1.2 forwards-port version

Change-Id: I093f3939be8858a2f327c5ee5884b9629b216855

8 years agofixes a typo
Ben Fagin [Mon, 1 May 2017 17:30:11 +0000 (10:30 -0700)] 
fixes a typo
(cherry picked from commit 6224df56a6fa28efda6e6e5007b015ad9d6d7d14)

8 years ago- big rewrite of the Sequence documentation:
Mike Bayer [Fri, 5 May 2017 18:59:39 +0000 (14:59 -0400)] 
- big rewrite of the Sequence documentation:

1. Sequence should be associated with MetaData always,
except in the really weird case someone is sharing a Sequence
among multiple metadatas.  Make this a "best practice", end the
confusion of #3951, #3979

2. "optional" is not a thing people use, trim this way down

3. remove confusing language

Change-Id: Iab5aec319da2582092fe2615ee50430f76441aff

8 years ago- add another note re: 339e2c13b0fc8e95a47d00c0f8fc5afc4b6dff9a
Mike Bayer [Fri, 5 May 2017 14:39:18 +0000 (10:39 -0400)] 
- add another note re: 339e2c13b0fc8e95a47d00c0f8fc5afc4b6dff9a
which clarifies that ForeignKey circumvents this logic as a
"convenience".   issue #3978 is updated to address trying to make
this consistent.

Change-Id: I089acaa89f11b7a6310c2bf32916e26eb62ab9c0
(cherry picked from commit 8f830d78ba1d68ea3e10006e10e65ddb571f45ee)

8 years ago- add a note to MetaData.schema indicating that the Table
Mike Bayer [Fri, 5 May 2017 13:19:18 +0000 (09:19 -0400)] 
- add a note to MetaData.schema indicating that the Table
will be cataloged in the .tables collection with its fully
qualified name.   Fixes #3978

Change-Id: I65fa063918efc22658e93c39a0680cb83553dec8
(cherry picked from commit 339e2c13b0fc8e95a47d00c0f8fc5afc4b6dff9a)

8 years agotest / document postgresql_ops against a labeled expression
Mike Bayer [Mon, 24 Apr 2017 20:19:08 +0000 (16:19 -0400)] 
test / document postgresql_ops against a labeled expression

Since postgresql_ops explicitly states that it expects
string keys, to apply to a function call or expression one
needs to give the SQL expression a label that can be referred
to by name in the dictionary.   test / document this.

Change-Id: I4bc4ade46dac27f9c1b92e7823433292beab97b9
Fixes: #3970
(cherry picked from commit 029d0f75385298f8056c04eba1d2f9563126a8a6)

8 years ago- edits
Mike Bayer [Sat, 22 Apr 2017 20:43:31 +0000 (16:43 -0400)] 
- edits

Change-Id: If2445c4cbcd7eb18e06823e8821940a391890979
(cherry picked from commit 6560bf82f387ca53c79f91f93ae97e6594795da8)

8 years ago- update relationship loader docs, backport from
Mike Bayer [Fri, 21 Apr 2017 21:40:11 +0000 (17:40 -0400)] 
- update relationship loader docs, backport from
1.2 wip

Change-Id: I0a3c4a0166f6feed23a021723233d281fad597ec
(cherry picked from commit e53009e25378990ee48d4c0c6a194d2d8d3ed01e)

8 years agoFix of minor typo in the UnmappedInstanceError message
Jonathan Suever [Thu, 6 Apr 2017 19:52:10 +0000 (15:52 -0400)] 
Fix of minor typo in the UnmappedInstanceError message

(cherry picked from commit 90c72c31a55337bef61cdd0cb75f5d128bcc34f9)

8 years ago- remove errant doctest comment
Mike Bayer [Mon, 17 Apr 2017 19:33:12 +0000 (15:33 -0400)] 
- remove errant doctest comment

Change-Id: Idb8520ff807074ceca36645728a63b79d1cdff6c
(cherry picked from commit c2834f9298ddf14c0177e862b344de9e526cdf35)

8 years agoRemove MySQL UTC_TIMESTAMP rule
Mike Bayer [Thu, 13 Apr 2017 14:11:41 +0000 (10:11 -0400)] 
Remove MySQL UTC_TIMESTAMP rule

Removed an ancient and unnecessary intercept of the UTC_TIMESTAMP
MySQL function, which was getting in the way of using it with a
parameter.

Change-Id: I6e6b52c051418bcb9d31987e78299310810cb78d
Fixes: #3966
(cherry picked from commit c0b85ad6ad1df2497a95c87d837c32d87f17291f)

8 years agoConsider mysql partition options separately from other table options
Mike Bayer [Thu, 6 Apr 2017 00:59:42 +0000 (20:59 -0400)] 
Consider mysql partition options separately from other table options

Move down all the PARTITION, SUBPARTITION options
into a separate segment so that they come out at the
end of CREATE TABLE after the table options.

Change-Id: Iaa1c823848c93680ca22d72bda1b7c49742b9060
Fixes: #3961
(cherry picked from commit 93b11905e599a6d73a85d2085e15385ebf46cdc6)

8 years ago- 1.1.10 prep
Mike Bayer [Thu, 6 Apr 2017 13:54:48 +0000 (09:54 -0400)] 
- 1.1.10 prep

Change-Id: Ieec7379402ce35d3d0c15a5e6b5056e9d83071cf

8 years ago- 1.1.9 rel_1_1_9
Mike Bayer [Tue, 4 Apr 2017 18:03:01 +0000 (14:03 -0400)] 
- 1.1.9

8 years agoAdd much more detail to the "unhashable types" change
Mike Bayer [Tue, 4 Apr 2017 17:09:55 +0000 (13:09 -0400)] 
Add much more detail to the "unhashable types" change

Change-Id: I34cbf54913b81ef2ae8b2e60f03feb78601460e5
Fixes: 3958
8 years agoMerge "Ensure we check that SQL expression has an .info attribute" into rel_1_1
mike bayer [Tue, 4 Apr 2017 14:09:01 +0000 (10:09 -0400)] 
Merge "Ensure we check that SQL expression has an .info attribute" into rel_1_1

8 years agoFix typo.
Bertrand Janin [Tue, 4 Apr 2017 13:11:25 +0000 (09:11 -0400)] 
Fix typo.

(cherry picked from commit 6524838950dca5721a7f7e9db3118d9245c64659)

8 years agoEnsure we check that SQL expression has an .info attribute
Mike Bayer [Tue, 4 Apr 2017 13:06:13 +0000 (09:06 -0400)] 
Ensure we check that SQL expression has an .info attribute

Fixed regression released in 1.1.8 due to :ticket:`3950` where the
deeper search for information about column types in the case of a
"schema type" or a :class:`.TypeDecorator` would produce an attribute
error if the mapping also contained a :obj:`.column_property`.

Change-Id: I38254834d3d79c9b339289a8163eb4789ec4c931
Fixes: #3956
(cherry picked from commit d13734add349ec6763cce8b194806c5afe988000)

8 years agoResultProxy won't autoclose connection until state flag is set
Mike Bayer [Mon, 3 Apr 2017 21:25:26 +0000 (17:25 -0400)] 
ResultProxy won't autoclose connection until state flag is set

Changed the mechanics of :class:`.ResultProxy` to unconditionally
delay the "autoclose" step until the :class:`.Connection` is done
with the object; in the case where Postgresql ON CONFLICT with
RETURNING returns no rows, autoclose was occurring in this previously
non-existent use case, causing the usual autocommit behavior that
occurs unconditionally upon INSERT/UPDATE/DELETE to fail.

Change-Id: I235a25daf4381b31f523331f810ea04450349722
Fixes: #3955
(cherry picked from commit 8ee363e4917b0dcd64a83b6d26e465c9e61e0ea5)

8 years ago- fix version identifier
Mike Bayer [Mon, 3 Apr 2017 21:31:30 +0000 (17:31 -0400)] 
- fix version identifier

Change-Id: If3bad7b79a61be6e421883727a430bdc5d9745db

8 years agoReturn self when Variant.coerce_compared_value would return impl
Mike Bayer [Sat, 1 Apr 2017 15:36:16 +0000 (11:36 -0400)] 
Return self when Variant.coerce_compared_value would return impl

Fixed regression released in 1.1.5 due to :ticket:`3859` where
adjustments to the "right-hand-side" evaluation of an expression
based on :class:`.Variant` to honor the underlying type's
"right-hand-side" rules caused the :class:`.Variant` type
to be inappropriately lost, in those cases when we *do* want the
left-hand side type to be transferred directly to the right hand side
so that bind-level rules can be applied to the expression's argument.

Change-Id: Ia54dbbb19398549d654b74668753c4152599d900
Fixes: #3952
(cherry picked from commit 6d7d48af0dec6325f87ce497f769827107ad5035)

8 years ago- 1.1.9 prep
Mike Bayer [Sat, 1 Apr 2017 15:37:13 +0000 (11:37 -0400)] 
- 1.1.9 prep

Change-Id: I89f403529969f703f3b153fda317f163137686db

8 years ago- 1.1.8 rel_1_1_8
Mike Bayer [Fri, 31 Mar 2017 18:24:06 +0000 (14:24 -0400)] 
- 1.1.8

8 years agoTrack SchemaEventTarget types in as_mutable()
Mike Bayer [Thu, 30 Mar 2017 21:52:10 +0000 (17:52 -0400)] 
Track SchemaEventTarget types in as_mutable()

Fixed bug in :mod:`sqlalchemy.ext.mutable` where the
:meth:`.Mutable.as_mutable` method would not track a type that had
been copied using :meth:`.TypeEngine.copy`.  This became more of
a regression in 1.1 compared to 1.0 because the :class:`.TypeDecorator`
class is now a subclass of :class:`.SchemaEventTarget`, which among
other things indicates to the parent :class:`.Column` that the type
should be copied when the :class:`.Column` is.  These copies are
common when using declarative with mixins or abstract classes.

Change-Id: Ib04df862c58263185dbae686c548fea3e12c46f1
Fixes: #3950
(cherry picked from commit 07b63894cb8ff9529b406f196b5d7cb9af209e9e)

8 years agoAdd bindparams support for baked Result count() method
Malaclypse The Younger [Thu, 30 Mar 2017 14:54:14 +0000 (10:54 -0400)] 
Add bindparams support for baked Result count() method

Added support for bound parameters, e.g. those normally set up
via :meth:`.Query.params`, to the :meth:`.baked.Result.count`
method.  Previously, support for parameters were omitted. Pull request
courtesy Pat Deegan.

Change-Id: I8c33548cf2a483699767e459731694c8cadebff6
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/350
(cherry picked from commit 74f6c21747d07a8cf9902900df9280a84aadc2bb)

8 years agoDocs/faq/performance
Ihor Kalnytskyi [Thu, 30 Mar 2017 14:07:31 +0000 (10:07 -0400)] 
Docs/faq/performance

Some updates for FAQ/Performance documentation page:

* Fix typo in testing script.
* Populate testing script with one more way to achieve higher performance.

See commit messages for details.

Change-Id: Id6fbf328164b14b3b58ca9616b103a35e72f7b8f
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/345
(cherry picked from commit a4c17c1397c68d109bcf0603644f3200ab2e82f5)

8 years agoSupport Postgresql development version numbers
Sean McCully [Wed, 29 Mar 2017 20:14:02 +0000 (16:14 -0400)] 
Support Postgresql development version numbers

Added support for parsing the Postgresql version string for
a development version like "PostgreSQL 10devel".  Pull request
courtesy Sean McCully.

Change-Id: I7bc18bc4d290349c23e9796367b7d694d0873096
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/351
(cherry picked from commit a86764d99b3a440cdc27b437ef2de9d393ca8036)

8 years ago- 1.1.8 prep
Mike Bayer [Wed, 29 Mar 2017 20:15:39 +0000 (16:15 -0400)] 
- 1.1.8 prep

Change-Id: I36f2f2be3ce49931bb9fc304b5abfd67824290cb

8 years ago- 1.1.7 rel_1_1_7
Mike Bayer [Mon, 27 Mar 2017 21:25:25 +0000 (17:25 -0400)] 
- 1.1.7

8 years agoAllow aliased() to be passed to Query.select_entity_from().
Mike Bayer [Mon, 27 Mar 2017 17:48:40 +0000 (13:48 -0400)] 
Allow aliased() to be passed to Query.select_entity_from().

An :func:`.aliased()` construct can now be passed to the
:meth:`.Query.select_entity_from` method.   Entities will be pulled
from the selectable represented by the :func:`.aliased` construct.
This allows special options for :func:`.aliased` such as
:paramref:`.aliased.adapt_on_names` to be used in conjunction with
:meth:`.Query.select_entity_from`.

Additionally rewrote the docstring for :meth:`.Query.select_entity_from`,
including starting with explicit use of :func:`.aliased` as the
usual idiomatic pattern.  An example using text().columns() is added
as well as the use case from :ticket:`3933` using name matching.

Change-Id: If7e182965236993064a2a086e3b6d55a4f097ca8
Fixes: #3933
(cherry picked from commit b5577b6fb3decda0293399a630e6601e86e08726)

8 years agoMerge "Add safe_reraise() + warnings only to Connection._autorollback" into rel_1_1
mike bayer [Mon, 27 Mar 2017 15:34:55 +0000 (11:34 -0400)] 
Merge "Add safe_reraise() + warnings only to Connection._autorollback" into rel_1_1

8 years agoFix a title typo
Bertrand Janin [Sun, 19 Mar 2017 22:05:54 +0000 (18:05 -0400)] 
Fix a title typo

Utilites -> Utilities
(cherry picked from commit 5df05d16708a3efbd731df6767c9763626972c04)

8 years agoAdd safe_reraise() + warnings only to Connection._autorollback
Mike Bayer [Mon, 27 Mar 2017 14:52:58 +0000 (10:52 -0400)] 
Add safe_reraise() + warnings only to Connection._autorollback

Added an exception handler that will warn for the "cause" exception on
Py2K when the "autorollback" feature of :class:`.Connection` itself
raises an exception. In Py3K, the two exceptions are naturally reported
by the interpreter as one occurring during the handling of the other.
This is continuing with the series of changes for rollback failure
handling that were last visited as part of :ticket:`2696` in 1.0.12.

Change-Id: I600ba455a14ebaea27c6189889181f97c632f179
Fixes: #3946
(cherry picked from commit c0a224aba3d4e2a41f92a29f9d18c6cb9d09d61f)

8 years agoPre-load alias.c within JoinedEagerLoader cached AliasedClass
Mike Bayer [Sun, 26 Mar 2017 02:17:17 +0000 (22:17 -0400)] 
Pre-load alias.c within JoinedEagerLoader cached AliasedClass

Fixed a race condition which could occur under threaded environments
as a result of the caching added via :ticket:`3915`.   An internal
collection of ``Column`` objects could be regenerated on an alias
object inappropriately, confusing a joined eager loader when it
attempts to render SQL and collect results and resulting in an
attribute error.   The collection is now generated up front before
the alias object is cached and shared among threads.

Change-Id: I97d5b205992d38af8d2b4307178a15c086ef9993
Fixes: #3947
(cherry picked from commit f214f4d4f46de24008c63f2e034329a64f510833)

8 years agoUse config.db global opts as defaults for all testing_engine()
Mike Bayer [Wed, 22 Mar 2017 14:13:15 +0000 (10:13 -0400)] 
Use config.db global opts as defaults for all testing_engine()

Some options need to be passed to engines in all cases,
such as currently the oracle 12516 workaround.   make sure
calls to testing_engine also set up the dictionary with
defaults even if options is passed.    not clear if this affects
other backends yet.

Change-Id: I5a1f7634e4ce5af6fe55dc21a24db6afacd19bb7
(cherry picked from commit 28edc2604a96d5ecd8318232c95a034433aa07d1)

8 years agoFix typos ('expicit' -> 'explicit')
Jamie Alessio [Wed, 15 Mar 2017 02:02:38 +0000 (19:02 -0700)] 
Fix typos ('expicit' -> 'explicit')

(cherry picked from commit 3771af0af45c2a7ea79a055b953c32f23c53e256)

8 years agofix pep8 errors in association example
Paul Brown [Fri, 17 Mar 2017 05:24:15 +0000 (00:24 -0500)] 
fix pep8 errors in association example

(cherry picked from commit 6aad7fb4217ef294f68f693be5b3137c28184949)