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

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

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

Change-Id: Iabcefa4b66d242acb74a8135c2f5a6a4345441a7

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

8 years agodetect and raise for version_id is NULL
Diana Clarke [Tue, 14 Mar 2017 17:03:11 +0000 (13:03 -0400)] 
detect and raise for version_id is NULL

The versioning feature does not support NULL for the version counter.
An exception is now raised if the version id is programmatic and
was set to NULL for an UPDATE.  Pull request courtesy Diana Clarke.

Fixes: #3673
Change-Id: I8b0da56234a7c7f5e7fde35536e09a6216a5e48a

8 years agoMerge "Detect no params w/ manual version_id counter and set to itself"
mike bayer [Mon, 22 May 2017 20:25:20 +0000 (16:25 -0400)] 
Merge "Detect no params w/ manual version_id counter and set to itself"

8 years agoAllow metadata.reflect() to recover from unreflectable tables
Mike Bayer [Mon, 22 May 2017 18:08:55 +0000 (14:08 -0400)] 
Allow metadata.reflect() to recover from unreflectable tables

Added support for views that are unreflectable due to stale
table definitions, when calling :meth:`.MetaData.reflect`; a warning
is emitted for the table that cannot respond to ``DESCRIBE``
but the operation succeeds.  The MySQL dialect now
raises UnreflectableTableError which is in turn caught by
MetaData.reflect().  Reflecting the view standalone raises
this error directly.

Change-Id: Id8005219d8e073c154cc84a873df911b4a6cf4d6
Fixes: #3871
8 years agoDetect no params w/ manual version_id counter and set to itself
Mike Bayer [Mon, 22 May 2017 18:47:26 +0000 (14:47 -0400)] 
Detect no params w/ manual version_id counter and set to itself

Fixed bug where programmatic version_id counter in conjunction with
joined table inheritance would fail if the version_id counter
were not actually incremented and no other values on the base table
were modified, as the UPDATE would have an empty SET clause.  Since
programmatic version_id where version counter is not incremented
is a documented use case, this specific condition is now detected
and the UPDATE now sets the version_id value to itself, so that
concurrency checks still take place.

Change-Id: I80e385bffeed4851cc20131cbe983c173a46f655
Fixes: #3996
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)
(cherry picked from commit 8cce3beef729e51eaed2d01a6ba0b0677abc7b36)

8 years agoRemove "scope" keyword from scoped_session.__call__()
Mike Bayer [Mon, 22 May 2017 17:00:38 +0000 (13:00 -0400)] 
Remove "scope" keyword from scoped_session.__call__()

Removed a very old keyword argument from :class:`.scoped_session`
called ``scope``.  This keyword was never documented and was an
early attempt at allowing for variable scopes.

Change-Id: I9a26498a1a66d1eafb0723e98b527688a60f9d9b
Fixes: #3796
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
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

8 years ago- 1.1.10 release date
Mike Bayer [Fri, 19 May 2017 20:20:59 +0000 (16:20 -0400)] 
- 1.1.10 release date

Change-Id: I6418052571c86b53f44b1a083fca932a65448d95

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
8 years agoAdd new configuration, inspection for baked queries
Mike Bayer [Wed, 17 May 2017 17:05:04 +0000 (13:05 -0400)] 
Add new configuration, inspection for baked queries

Added new flag :paramref:`.Session.enable_baked_queries` to the
:class:`.Session` to allow baked queries to be disabled
session-wide, reducing memory use.   Also added new :class:`.Bakery`
wrapper so that the bakery returned by :paramref:`.BakedQuery.bakery`
can be inspected.

Change-Id: I5657af7a99d2b24c89d6aee1343f432728e3f807

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

8 years ago- give SelectinLoader its own bakery, dont use mapper
Mike Bayer [Wed, 17 May 2017 02:13:40 +0000 (22:13 -0400)] 
- give SelectinLoader its own bakery, dont use mapper
level cache
- include SelectinLoader itself in the cache key, though
this is currently not critical

Change-Id: I8e4bcd579277fbe53d9c7eca3552a0b8ab9d7a39

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

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

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

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

8 years agoMerge "Demote innerjoin to outerjoin coming from with_polymorphic"
mike bayer [Fri, 12 May 2017 22:07:49 +0000 (18:07 -0400)] 
Merge "Demote innerjoin to outerjoin coming from with_polymorphic"

8 years agoDemote innerjoin to outerjoin coming from with_polymorphic
Mike Bayer [Fri, 12 May 2017 16:01:53 +0000 (12:01 -0400)] 
Demote innerjoin to outerjoin coming from with_polymorphic

a with_polymorphic, regardless of inheritance type, represents
multiple classes.  A subclass that wants to joinedload with innerjoin=True
needs to be demoted to an outerjoin because the parent entity rows
might not be of that type.   Looks more intuitive with a joined
inheritance load, but applies just as well to single or concrete.

Change-Id: I4d3d76106ae20032269f8848aad70a8e2f9422f9
Fixes: #3988
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
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
8 years agoMerge "Update inheritance documentation."
mike bayer [Thu, 11 May 2017 00:26:30 +0000 (20:26 -0400)] 
Merge "Update inheritance documentation."

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

8 years agoMerge "Add conditionals specific to deferred for expire ro properties"
mike bayer [Wed, 10 May 2017 18:21:33 +0000 (14:21 -0400)] 
Merge "Add conditionals specific to deferred for expire ro properties"

8 years agoAdd conditionals specific to deferred for expire ro properties
Mike Bayer [Wed, 10 May 2017 18:03:28 +0000 (14:03 -0400)] 
Add conditionals specific to deferred for expire ro properties

Fixed bug where a :func:`.column_property` that is also marked as
"deferred" would be marked as "expired" during a flush, causing it
to be loaded along with the unexpiry of regular attributes even
though this attribute was never accessed.

Change-Id: Iaa9e17b66ece30a8e729e4af746b31ff99b1ec9a
Fixes: #3984
8 years agoFix docs syntax error
Denis Kataev [Wed, 10 May 2017 12:33:16 +0000 (17:33 +0500)] 
Fix docs syntax error

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

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
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

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

8 years agoMerge branch 'master' of https://github.com/aflyhorse/sqlalchemy
Mike Bayer [Mon, 8 May 2017 21:55:28 +0000 (17:55 -0400)] 
Merge branch 'master' of https://github.com/aflyhorse/sqlalchemy

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 agoMerge branch 'patch-1' of https://github.com/UnquietCode/sqlalchemy
Mike Bayer [Mon, 8 May 2017 20:21:20 +0000 (16:21 -0400)] 
Merge branch 'patch-1' of https://github.com/UnquietCode/sqlalchemy

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

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
(cherry picked from commit a1dcf23e371695d8d3be2e1d7875fad10f16a656)

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

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

8 years agoremove ambiguous line breakers to help sphinx identify code block
LunarShaddow [Fri, 5 May 2017 06:38:41 +0000 (14:38 +0800)] 
remove ambiguous line breakers to help sphinx identify code block

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

8 years ago- typo
Mike Bayer [Fri, 28 Apr 2017 14:36:15 +0000 (10:36 -0400)] 
- typo

Change-Id: Iab741ce3739ed4172196f99c519c9333637383fd

8 years agoCall proxied collection before invoking creator in associationlist.append()
Mike Bayer [Thu, 27 Apr 2017 15:24:41 +0000 (11:24 -0400)] 
Call proxied collection before invoking creator in associationlist.append()

Improved the association proxy list collection so that premature
autoflush against a newly created association object can be prevented
in the case where ``list.append()`` is being used, and a lazy load
would be invoked when the association proxy accesses the endpoint
collection.  The endpoint collection is now accessed first before
the creator is invoked to produce the association object.

Change-Id: I008a6dbdfe5b1c0dfd02189c3d954d83a65f3fc5
Fixes: #3941
8 years ago- keep trying to identify the race here. can reproduce locally
Mike Bayer [Thu, 27 Apr 2017 21:44:29 +0000 (17:44 -0400)] 
- keep trying to identify the race here.  can reproduce locally
now and it seems like mock might not be doing the right thing.

Change-Id: I5c108d82631c9217da54a8ace68d7728c3e204d8

8 years agoEnforce boolean result type for all eq_, is_, isnot, comparison
Mike Bayer [Thu, 27 Apr 2017 14:26:10 +0000 (10:26 -0400)] 
Enforce boolean result type for all eq_, is_, isnot, comparison

Repaired issue where the type of an expression that used
:meth:`.ColumnOperators.is_` or similar would not be a "boolean" type,
instead the type would be "nulltype", as well as when using custom
comparison operators against an untyped expression.   This typing can
impact how the expression behaves in larger contexts as well as
in result-row-handling.

Change-Id: Ib810ff686de500d8db26ae35a51005fab29603b6
Fixes: #3873
8 years ago- try to work around a race that can occur in STP when
Mike Bayer [Thu, 27 Apr 2017 19:26:35 +0000 (15:26 -0400)] 
- try to work around a race that can occur in STP when
used in this intentionally broken scenario

Change-Id: I88ea6fa710da2189e6d47e2d12f5f0fd6f6bb7d4

8 years ago- ensure that sqlalchemy.ext is set up for importlater
Mike Bayer [Thu, 27 Apr 2017 18:33:54 +0000 (14:33 -0400)] 
- ensure that sqlalchemy.ext is set up for importlater

otherwise, it fails if you import from ext before orm:

    from sqlalchemy import *
    from sqlalchemy.ext.declarative import declarative_base
    from sqlalchemy.orm import *

and then do a lazyload, as the ext.baked importlater is not
initialized.

Change-Id: I24dcbfc9ca9022316da28507772562833e45dd95

8 years agoAdd selectin loading
Mike Bayer [Thu, 23 Mar 2017 21:55:43 +0000 (17:55 -0400)] 
Add selectin loading

Adding a new kind of relationship loader that is
a cross between the "immediateload" and the "subquery"
eager loader, using an IN criteria to load related items
in bulk immediately after the lead query result is loaded.

Change-Id: If13713fba9b465865aef8fd50b5b6b977fe3ef7d
Fixes: #3944
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
8 years ago- edits
Mike Bayer [Sat, 22 Apr 2017 20:43:31 +0000 (16:43 -0400)] 
- edits

Change-Id: If2445c4cbcd7eb18e06823e8821940a391890979

8 years agoMerge branch 'master' of ssh://gerrit.sqlalchemy.org:29418/zzzeek/sqlalchemy
Mike Bayer [Fri, 21 Apr 2017 22:24:10 +0000 (18:24 -0400)] 
Merge branch 'master' of ssh://gerrit.sqlalchemy.org:29418/zzzeek/sqlalchemy

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

8 years agoAdd _negate() to Label to negate inner element
Mike Bayer [Fri, 21 Apr 2017 17:35:38 +0000 (13:35 -0400)] 
Add _negate() to Label to negate inner element

Fixed the negation of a :class:`.Label` construct so that the
inner element is negated correctly, when the :func:`.not_` modifier
is applied to the labeled expression.

Change-Id: Ia99917b2959bdfbff28689c962b4203911c57b85
Fixes: #3969
8 years agoMerge branch 'UnmappedInstanceError_typo_fix' of https://github.com/suever/sqlalchemy
Mike Bayer [Mon, 17 Apr 2017 19:34:46 +0000 (15:34 -0400)] 
Merge branch 'UnmappedInstanceError_typo_fix' of https://github.com/suever/sqlalchemy

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

8 years agoAccommodate for query._current_path in subq eager load join_depth
Mike Bayer [Mon, 17 Apr 2017 16:02:18 +0000 (12:02 -0400)] 
Accommodate for query._current_path in subq eager load join_depth

Fixed bug in subquery eager loading where the "join_depth" parameter
for self-referential relationships would not be correctly honored,
loading all available levels deep rather than correctly counting
the specified number of levels for eager loading.

Change-Id: Ifa54085cbab3b41c2196f3ee519f485c63e4cb8d
Fixes: #3967
8 years agoMerge "Use baked lazyloading by default"
mike bayer [Fri, 14 Apr 2017 14:18:10 +0000 (10:18 -0400)] 
Merge "Use baked lazyloading by default"

8 years agoUse baked lazyloading by default
Mike Bayer [Fri, 7 Apr 2017 18:18:22 +0000 (14:18 -0400)] 
Use baked lazyloading by default

The ``lazy="select"`` loader strategy now makes used of the
:class:`.BakedQuery` query caching system in all cases.  This
removes most overhead of generating a :class:`.Query` object and
running it into a :func:`.select` and then string SQL statement from
the process of lazy-loading related collections and objects.  The
"baked" lazy loader has also been improved such that it can now
cache in most cases where query load options are used.

Change-Id: Ic96792fffaa045ae9aa0a4657d6d29235d3efb85
Fixes: #3954
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
8 years ago- typos and formatting
Mike Bayer [Wed, 12 Apr 2017 20:28:55 +0000 (16:28 -0400)] 
- typos and formatting

Change-Id: I88a304e315b68eded31e91da04265da583bc417b

8 years ago- OK, take oracle out of memory-intensive, if it doesn't leak memory
Mike Bayer [Wed, 12 Apr 2017 20:18:11 +0000 (16:18 -0400)] 
- OK, take oracle out of memory-intensive, if it doesn't leak memory
then we get the TNS error from too many connections

Change-Id: Ie685173cd1490d99c5f37a1045e1312c4d9125ea

8 years ago- try one more test, then we're likely going to give up on cx_Oracle
Mike Bayer [Wed, 12 Apr 2017 19:28:05 +0000 (15:28 -0400)] 
- try one more test, then we're likely going to give up on cx_Oracle

Change-Id: I7f9a1265664b0368ee7a771d01c7ca1612156d1f

8 years ago- move a few memusage tests out of "backend". something is up w/ cx_Oracle
Mike Bayer [Wed, 12 Apr 2017 19:15:16 +0000 (15:15 -0400)] 
- move a few memusage tests out of "backend".  something is up w/ cx_Oracle
when the suite runs, such as a background thread or something like that,
which is affecting these tests a bit.

Change-Id: I52d50a44778ec1eecb8e335ae59b1a4773e80a79

8 years agoWarn on _compiled_cache growth
Mike Bayer [Wed, 12 Apr 2017 15:37:19 +0000 (11:37 -0400)] 
Warn on _compiled_cache growth

Added warnings to the LRU "compiled cache" used by the :class:`.Mapper`
(and ultimately will be for other ORM-based LRU caches) such that
when the cache starts hitting its size limits, the application will
emit a warning that this is a performance-degrading situation that
may require attention.   The LRU caches can reach their size limits
primarily if an application is making use of an unbounded number
of :class:`.Engine` objects, which is an antipattern.  Otherwise,
this may suggest an issue that should be brought to the SQLAlchemy
developer's attention.

Additionally, adjusted the test_memusage algorithm again as the
previous one could still allow a growing memory size to be missed.

Change-Id: I020d1ceafb7a08f6addfa990a1e7acd09f933240

8 years agoSet up base ARRAY to be compatible with postgresql.ARRAY.
Mike Bayer [Tue, 11 Apr 2017 14:26:38 +0000 (10:26 -0400)] 
Set up base ARRAY to be compatible with postgresql.ARRAY.

For some reason, when ARRAY was added to the base it was never linked
to postgresql.ARRAY.   Link the two types and also make base
ARRAY the schema event target so that it supports the same
features as postgresql.ARRAY.

Change-Id: I82fa6c9d2b8c5028dba3a009715f7bc296b2bc0b
Fixes: #3964
8 years agoMerge "Compare entities also on chop_path"
mike bayer [Mon, 10 Apr 2017 18:59:14 +0000 (14:59 -0400)] 
Merge "Compare entities also on chop_path"

8 years agoCompare entities also on chop_path
Mike Bayer [Mon, 10 Apr 2017 17:25:50 +0000 (13:25 -0400)] 
Compare entities also on chop_path

When comparing query._current_path to options, the path chop
was not taking into account that the query or the options are
against aliased classes that don't match the mapper.

The issue does not seem to take place for the Load() version
of _chop_path.

Fixed bug to improve upon the specificity of loader options that
take effect subsequent to the lazy load of a related entity, so
that the loader options will match to an aliased or non-aliased
entity more specifically if those options include entity information.

Fixes: #3963
Change-Id: Ifdff37d579042fcc62bdeabce9e2413e9a03fbba

8 years agoAdd new "expanding" feature to bindparam()
Mike Bayer [Mon, 3 Apr 2017 18:34:58 +0000 (14:34 -0400)] 
Add new "expanding" feature to bindparam()

Added a new kind of :func:`.bindparam` called "expanding".  This is
for use in ``IN`` expressions where the list of elements is rendered
into individual bound parameters at statement execution time, rather
than at statement compilation time.  This allows both a single bound
parameter name to be linked to an IN expression of multiple elements,
as well as allows query caching to be used with IN expressions.  The
new feature allows the related features of "select in" loading and
"polymorphic in" loading to make use of the baked query extension
to reduce call overhead.   This feature should be considered to be
**experimental** for 1.2.

Fixes: #3953
Change-Id: Ie708414a3ab9c0af29998a2c7f239ff7633b1f6e

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

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
8 years ago- add placeholder for 1.1.10
Mike Bayer [Thu, 6 Apr 2017 13:55:04 +0000 (09:55 -0400)] 
- add placeholder for 1.1.10

Change-Id: I068dd3b47dec200740db617891a64798db8f1734

8 years agoSupport Postgresql INTERVAL fields spec/reflection
Mike Bayer [Wed, 5 Apr 2017 16:55:39 +0000 (12:55 -0400)] 
Support Postgresql INTERVAL fields spec/reflection

Added support for all possible "fields" identifiers when reflecting the
Postgresql ``INTERVAL`` datatype, e.g. "YEAR", "MONTH", "DAY TO
MINUTE", etc..   In addition, the :class:`.postgresql.INTERVAL`
datatype itself now includes a new parameter
:paramref:`.postgresql.INTERVAL.fields` where these qualifiers can be
specified; the qualifier is also reflected back into the resulting
datatype upon reflection / inspection.

Change-Id: I33816e68c533b023e0632db6f4e73fefd2de4721
Fixes: #3959
8 years agoMerge "Double percent signs based on paramstyle, not dialect"
mike bayer [Wed, 5 Apr 2017 17:06:00 +0000 (13:06 -0400)] 
Merge "Double percent signs based on paramstyle, not dialect"

8 years agoDouble percent signs based on paramstyle, not dialect
Mike Bayer [Mon, 4 Jul 2016 19:54:29 +0000 (15:54 -0400)] 
Double percent signs based on paramstyle, not dialect

This patch moves the "doubling" of percent signs into
the base compiler and makes it completely a product
of whether or not the paramstyle is format/pyformat or
not.   Without this paramstyle, percent signs
are not doubled across text(), literal_column(), and
column().

Change-Id: Ie2f278ab1dbb94b5078f85c0096d74dbfa049197
Fixes: #3740
8 years agoMerge "Recognize brackets, quoted_name in SQL Server schema"
mike bayer [Tue, 4 Apr 2017 18:28:39 +0000 (14:28 -0400)] 
Merge "Recognize brackets, quoted_name in SQL Server schema"

8 years ago- 1.1.9 release date
Mike Bayer [Tue, 4 Apr 2017 18:11:05 +0000 (14:11 -0400)] 
- 1.1.9 release date

Change-Id: I8d1d55bde6424e4013c5b16bb27d6fc15fa225c2

8 years agoRecognize brackets, quoted_name in SQL Server schema
Mike Bayer [Mon, 3 Apr 2017 19:05:27 +0000 (15:05 -0400)] 
Recognize brackets, quoted_name in SQL Server schema

The SQL Server dialect now allows for a database and/or owner name
with a dot inside of it, using brackets explicitly in the string around
the owner and optionally the database name as well.  In addition,
sending the :class:`.quoted_name` construct for the schema name will
not split on the dot and will deliver the full string as the "owner".
:class:`.quoted_name` is also now available from the ``sqlalchemy.sql``
import space.

Change-Id: I77491d63ce47638bd23787d903ccde2f35a9d43d
Fixes: #2626
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
(cherry picked from commit 10a3004f2ca29921c844f58689a5f02ed5f10e03)

8 years agoMerge "Apply SQL compilation to sqltext for column-level CHECK constraint"
mike bayer [Tue, 4 Apr 2017 14:22:32 +0000 (10:22 -0400)] 
Merge "Apply SQL compilation to sqltext for column-level CHECK constraint"

8 years agoMerge "Ensure we check that SQL expression has an .info attribute"
mike bayer [Tue, 4 Apr 2017 14:08:49 +0000 (10:08 -0400)] 
Merge "Ensure we check that SQL expression has an .info attribute"

8 years agoApply SQL compilation to sqltext for column-level CHECK constraint
Mike Bayer [Tue, 4 Apr 2017 14:02:39 +0000 (10:02 -0400)] 
Apply SQL compilation to sqltext for column-level CHECK constraint

Fixed bug where a column-level :class:`.CheckConstraint` would fail
to compile the SQL expression using the underlying dialect compiler
as well as apply proper flags to generate literal values as
inline, in the case that the sqltext is a Core expression and
not just a plain string.   This was long-ago fixed for table-level
check constraints in 0.9 as part of :ticket:`2742`, which more commonly
feature Core SQL expressions as opposed to plain string expressions.

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

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
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)
(cherry picked from commit f52fb5282a046d26b6ee2778e03b995eb117c2ee)

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

Change-Id: I63abfb167f54ea2ea2f8bf4ba22ab38b60c5d59c

8 years agoMerge "Use consistent method signature for Alias.self_group()"
mike bayer [Mon, 3 Apr 2017 16:37:35 +0000 (12:37 -0400)] 
Merge "Use consistent method signature for Alias.self_group()"

8 years agoUse consistent method signature for Alias.self_group()
Mike Bayer [Thu, 16 Mar 2017 21:28:41 +0000 (17:28 -0400)] 
Use consistent method signature for Alias.self_group()

Fixed bug where the use of an :class:`.Alias` object in a column
context would raise an argument error when it tried to group itself
into a parenthesized expression.   Using :class:`.Alias` in this way
is not yet a fully supported API, however it applies to some end-user
recipes and may have a more prominent role in support of some
future Postgresql features.

Change-Id: I81717e30416e0350f08d1e022c3d84656e0a9735
Fixes: #3939
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
8 years ago- 1.1.9 placeholder
Mike Bayer [Sat, 1 Apr 2017 15:36:52 +0000 (11:36 -0400)] 
- 1.1.9 placeholder

Change-Id: Ic7897b5e05d7a20b280d4412d3bdf2ebc85905d4

8 years ago- 1.1.8 release date
Mike Bayer [Fri, 31 Mar 2017 18:31:13 +0000 (14:31 -0400)] 
- 1.1.8 release date

Change-Id: I6243e620e55ad862e8494d64cc754badce25097d

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
8 years agoApply type processing to untyped preexec default clause
Mike Bayer [Mon, 27 Feb 2017 21:43:59 +0000 (16:43 -0500)] 
Apply type processing to untyped preexec default clause

Fixed bug where a SQL-oriented Python-side column default could fail to
be executed properly upon INSERT in the "pre-execute" codepath, if the
SQL itself were an untyped expression, such as plain text.  The "pre-
execute" codepath is fairly uncommon however can apply to non-integer
primary key columns with SQL defaults when RETURNING is not used.

Tests exist here to ensure typing is applied to
a typed expression for default, but in the case of
an untyped SQL value, we know the type from the column,
so apply this.

Change-Id: I5d8b391611c137b9f700115a50a2bf5b30abfe94
Fixes: #3923
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

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

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

8 years ago- start changelog for 1.1.8
Mike Bayer [Wed, 29 Mar 2017 20:15:53 +0000 (16:15 -0400)] 
- start changelog for 1.1.8

Change-Id: I6c23f43ca76aeca469980fc8be228af20c2c700d

8 years ago- reorg migration notes a bit
Mike Bayer [Tue, 28 Mar 2017 13:26:56 +0000 (09:26 -0400)] 
- reorg migration notes a bit

Change-Id: Id2a727a2a13eb84ad104ab049ae37b9e708af6b5

8 years ago- update release date for 1.1.7
Mike Bayer [Mon, 27 Mar 2017 21:34:15 +0000 (17:34 -0400)] 
- update release date for 1.1.7

Change-Id: I6ce86e2e0c54135194c60d99b433b2f38c467dbd