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

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

(cherry picked from commit ff230f1862892eb2b479ed85e6858a82159b435f)

8 years ago- re-set no ad-hoc-engines for oracle, previously low-connections
Mike Bayer [Mon, 13 Mar 2017 22:08:43 +0000 (18:08 -0400)] 
- re-set no ad-hoc-engines for oracle, previously low-connections
disabled this

Change-Id: I3ceceaea7a3969248121ff4dc97c11296831fc99
(cherry picked from commit 4a886e519ff227039a9d603aa4727c6f828f93ff)

8 years agoRepair _execute_scalar for WITH_UNICODE mode
Mike Bayer [Mon, 13 Mar 2017 16:27:51 +0000 (12:27 -0400)] 
Repair _execute_scalar for WITH_UNICODE mode

cx_Oracle 5.3 seems to code this flag ON now, so
remove the warning and ensure WITH_UNICODE handling works.

Additionally, the XE setup on jenkins is having more
problems here, in particular low-connections mode is
causing cx_Oracle to fail more frequently now.  Turning
off low-connections fixes those but then we get the
TNS errors, so adding an emergency "retry" flag that
is not yet a feature available to users.  Real world
applications are not dropping/creating thousands of
tables the way our test suite is.

Change-Id: Ie95b0e697276c404d3264c2e624e870463d966d6
Fixes: #3937
8 years ago- set correct gitreview branch
Mike Bayer [Mon, 13 Mar 2017 16:31:44 +0000 (12:31 -0400)] 
- set correct gitreview branch

Change-Id: I5e158062946fdc96340d27078a2866d99208f5a0

8 years ago- add a note as to why we have this very complicated Annotated
Mike Bayer [Thu, 9 Mar 2017 22:38:21 +0000 (17:38 -0500)] 
- add a note as to why we have this very complicated Annotated
system

Change-Id: I7d4048b92fcd3a7c7630c43aa9390d983f447c0a

8 years agoAllow SchemaType and Variant to work together
Mike Bayer [Tue, 7 Mar 2017 17:53:00 +0000 (12:53 -0500)] 
Allow SchemaType and Variant to work together

Added support for the :class:`.Variant` and the :class:`.SchemaType`
objects to be compatible with each other.  That is, a variant
can be created against a type like :class:`.Enum`, and the instructions
to create constraints and/or database-specific type objects will
propagate correctly as per the variant's dialect mapping.

Also added testing for some potential double-event scenarios
on TypeDecorator but it seems usually this doesn't occur.

Change-Id: I4a7e7c26b4133cd14e870f5bc34a1b2f0f19a14a
Fixes: #2892
8 years agoRepair missing "checkfirst" for test suite
Mike Bayer [Tue, 7 Mar 2017 20:00:18 +0000 (15:00 -0500)] 
Repair missing "checkfirst" for test suite

the test_metadata tests trigger the before_create dispatch without
the checkfirst flag.  Postgresql backend should be able to
tolerate this.

Change-Id: Ife497cc3a4eb2812462116f94aad732864225f3f

8 years ago- document ForeignKeyConstraint columns / elements, fixes #2904
Mike Bayer [Tue, 7 Mar 2017 19:54:53 +0000 (14:54 -0500)] 
- document ForeignKeyConstraint columns / elements, fixes #2904

Change-Id: Ia50a3100d1bd88020c30224932b16aeadd7f4c75

8 years agoMerge "Don't cache savepoint identifiers"
mike bayer [Tue, 7 Mar 2017 00:12:40 +0000 (19:12 -0500)] 
Merge "Don't cache savepoint identifiers"

8 years agoDon't cache savepoint identifiers
Mike Bayer [Mon, 6 Mar 2017 17:26:01 +0000 (12:26 -0500)] 
Don't cache savepoint identifiers

Fixed bug in compiler where the string identifier of a savepoint would
be cached in the identifier quoting dictionary; as these identifiers
are arbitrary, a small memory leak could occur if a single
:class:`.Connection` had an unbounded number of savepoints used,
as well as if the savepoint clause constructs were used directly
with an unbounded umber of savepoint names.   The memory leak does
**not** impact the vast majority of cases as normally the
:class:`.Connection`, which renders savepoint names with a simple
counter starting at "1", is used on a per-transaction or
per-fixed-number-of-transactions basis before being discarded.

The savepoint name in virtually all cases does not require quoting
at all, however to support potential third party use cases
the "check for quotes needed" logic is retained, at a small
performance cost.   Uncondtionally quoting the name is another
option, but this would turn the name into a case sensitive name
which runs the risk of poor interactions with existing deployments
that may be looking at these names in other contexts.

Change-Id: I6b53c96abf7fdf1840592bbca5da81347911844c
Fixes: #3931
8 years ago- update asktom link, fixes #3925
Mike Bayer [Mon, 6 Mar 2017 21:50:13 +0000 (16:50 -0500)] 
- update asktom link, fixes #3925

Change-Id: Ibd63311dfccebbdf67e8ad7dc56ad311bf573895

8 years agoUpdate profiles for psycopg2 2.7
Mike Bayer [Mon, 6 Mar 2017 21:09:32 +0000 (16:09 -0500)] 
Update profiles for psycopg2 2.7

psycopg2 has updated their unicode / string handling, greatly
reducing callcounts on Python 2.x.

Change-Id: Idffd242b303ffea9c7733068a4be290da4dbe679

8 years agoOnly use schema_translate_map on SchemaItem subclasses
Mike Bayer [Tue, 28 Feb 2017 19:03:47 +0000 (14:03 -0500)] 
Only use schema_translate_map on SchemaItem subclasses

Fixed bug in new "schema translate" feature where the translated schema
name would be invoked in terms of an alias name when rendered along
with a column expression; occurred only when the source translate
name was "None".   The "schema translate" feature now only takes
effect for :class:`.SchemaItem` and :class:`.SchemaType` subclasses,
that is, objects that correspond to a DDL-creatable structure in
a database.

Change-Id: Ie8cb35aeaba2c67efec8c8c57c219e4dd346e44a
Fixes: #3924
8 years ago- 1.1.7 prep
Mike Bayer [Tue, 28 Feb 2017 19:49:04 +0000 (14:49 -0500)] 
- 1.1.7 prep

Change-Id: I7d738e194339ffd6edf3ff6a078808fc5251fe50

8 years ago- 1.1.6 rel_1_1_6
Mike Bayer [Tue, 28 Feb 2017 16:41:24 +0000 (11:41 -0500)] 
- 1.1.6

8 years agoAdd new reserved words for MySQL 8.0 (beta).
Hanno Schlichting [Tue, 28 Feb 2017 16:10:57 +0000 (11:10 -0500)] 
Add new reserved words for MySQL 8.0 (beta).

Based on https://dev.mysql.com/doc/refman/8.0/en/keywords.html#table-keywords-new-8.0

Change-Id: I128c93520e57331e0ec4d40b0c0e752bf9b982d9
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/346

8 years agoPerformance within instances()
Mike Bayer [Thu, 23 Feb 2017 19:40:00 +0000 (14:40 -0500)] 
Performance within instances()

Continuing from Ie43beecf37945b2bb7fff0aaa597a597293daa18,
also observed is the overhead of PathRegsitry memoized token
functions, as these paths are not cached in the case of
long joinedloader chains.  The memoizations here were made
with short paths in mind, and have been replaced with
an inlined straight create of these paths up front, producing
callcounts very similar to 0.8. Combined with the previous
optimizations, 1.1 now runs the "joined eager load of one row"
worst case test in about 40% fewer calls than 0.8 and 60%
fewer than 1.1.5.

Change-Id: Ib5e1c1345a1dd8edfbdb3fed06eb717d4e164d31
Fixes: #3915
8 years agoMerge "Memoize AliasedClass, ClauseAdapter objects in joined eager load"
mike bayer [Wed, 22 Feb 2017 22:16:28 +0000 (17:16 -0500)] 
Merge "Memoize AliasedClass, ClauseAdapter objects in joined eager load"

8 years ago- add test for inserting PG array w/ NULL, references #3916
Mike Bayer [Thu, 16 Feb 2017 18:00:28 +0000 (13:00 -0500)] 
- add test for inserting PG array w/ NULL, references #3916

Change-Id: I87be274c1ba019b41744a5a76c1b5e9334564ec8

8 years agoMemoize AliasedClass, ClauseAdapter objects in joined eager load
Mike Bayer [Thu, 16 Feb 2017 16:31:26 +0000 (11:31 -0500)] 
Memoize AliasedClass, ClauseAdapter objects in joined eager load

Addressed some long unattended performance concerns within the
joined eager loader query construction system.  The use of ad-hoc
:class:`.AliasedClass` objects per query, which produces lots of column
lookup overhead each time, has been replaced with a cached approach
that makes use of a small pool of :class:`.AliasedClass` objects
that are reused between invocations of joined eager loading.
Callcount reduction of SQL query generation for worst-case joined
loader scenarios (lots of joins, lots of columns) is reduced by
approximately 270%.

Change-Id: Ie43beecf37945b2bb7fff0aaa597a597293daa18
Fixes: #3915
8 years agoAdd new DDL autocommit expressions for Postgresql
Mike Bayer [Mon, 13 Feb 2017 19:20:38 +0000 (14:20 -0500)] 
Add new DDL autocommit expressions for Postgresql

Added regular expressions for the "IMPORT FOREIGN SCHEMA",
"REFRESH MATERIALIZED VIEW" Postgresql statements so that they
autocommit when invoked via a connection or engine without
an explicit transaction.  Pull requests courtesy Frazer McLean
and PaweÅ‚ Stiasny.

Fixes: #3840
Co-authored-by: Frazer McLean
Co-authored-by: Paweł Stiasny
Change-Id: I92b2b61683d29d57fa23a66a3559120cb1241c2f
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/323

8 years ago- limit to MySQL dialect
Mike Bayer [Mon, 13 Feb 2017 19:40:55 +0000 (14:40 -0500)] 
- limit to MySQL dialect

Change-Id: I2781e1e2221d89c75dd65ff49490d9c409967930

8 years ago- pull autocommit suite into the mysql suite as well
Mike Bayer [Mon, 13 Feb 2017 19:33:21 +0000 (14:33 -0500)] 
- pull autocommit suite into the mysql suite as well

Change-Id: If1106f7f125739e69ad2482f65b8f37672a76c9e

8 years ago- add a test suite that ensures textual autocommit works
Mike Bayer [Mon, 13 Feb 2017 19:17:11 +0000 (14:17 -0500)] 
- add a test suite that ensures textual autocommit works
for correct expressions

Change-Id: I17d35169be914924828487abba05658dff380f2a

8 years agopytds based connector for MS-SQL
Grzegorz Makarewicz [Sun, 12 Feb 2017 19:10:43 +0000 (20:10 +0100)] 
pytds based connector for MS-SQL

8 years agoCheck for columns not part of mapping, correct mapping for eager_defaults
Mike Bayer [Thu, 9 Feb 2017 02:05:16 +0000 (21:05 -0500)] 
Check for columns not part of mapping, correct mapping for eager_defaults

Fixed two closely related bugs involving the mapper eager_defaults
flag in conjunction with single-table inheritance; one where the
eager defaults logic would inadvertently try to access a column
that's part of the mapper's "exclude_properties" list (used by
Declarative with single table inheritance) during the eager defaults
fetch, and the other where the full load of the row in order to
fetch the defaults would fail to use the correct inheriting mapper.

Fixes: #3908
Change-Id: Ie745174c917d512e2c46d9e3cc14512cde53cc9a

8 years agoDon't post-SELECT columns w/o a server default/onupdate for eager_defaults
Mike Bayer [Thu, 9 Feb 2017 02:42:34 +0000 (21:42 -0500)] 
Don't post-SELECT columns w/o a server default/onupdate for eager_defaults

Fixed a major inefficiency in the "eager_defaults" feature whereby
an unnecessary SELECT would be emitted for column values where the
ORM had explicitly inserted NULL, corresponding to attributes that
were unset on the object but did not have any server default
specified, as well as expired attributes on update that nevertheless
had no server onupdate set up.   As these columns are not part of the
RETURNING that eager_defaults tries to use, they should not be
post-SELECTed either.

Change-Id: I0d4f1e9d3d9717d68dcc0592f69456a1f1c36df8
Fixes: #3909
8 years ago- document Query.with_session(), direct constructor usage
Mike Bayer [Wed, 8 Feb 2017 22:47:29 +0000 (17:47 -0500)] 
- document Query.with_session(), direct constructor usage

Change-Id: I47499d040623202dd9b3be0ea65f2d9ad03c11a4

8 years agoMake all tests to be PEP8 compliant
Khairi Hafsham [Thu, 2 Feb 2017 18:02:21 +0000 (13:02 -0500)] 
Make all tests to be PEP8 compliant

tested using pycodestyle version 2.2.0

Fixes: #3885
Change-Id: I5df43adc3aefe318f9eeab72a078247a548ec566
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/343

8 years agoMerge "Accept FetchedValue, text() for column "default" value"
mike bayer [Wed, 1 Feb 2017 23:13:06 +0000 (18:13 -0500)] 
Merge "Accept FetchedValue, text() for column "default" value"

8 years ago- add a note referring to the enum value as not currently persisted,
Mike Bayer [Wed, 1 Feb 2017 23:09:45 +0000 (18:09 -0500)] 
- add a note referring to the enum value as not currently persisted,
reference #3906

Change-Id: I2274c356cc88cd011c5a34a69e75a2548a93e87a

8 years agoAccept FetchedValue, text() for column "default" value
Mike Bayer [Wed, 1 Feb 2017 21:25:31 +0000 (16:25 -0500)] 
Accept FetchedValue, text() for column "default" value

Fixed bug whereby the :meth:`.DDLEvents.column_reflect` event would not
allow a non-textual expression to be passed as the value of the
"default" for the new column, such as a :class:`.FetchedValue`
object to indicate a generic triggered default or a
:func:`.sql.expression.text` construct.  Clarified the documentation
in this regard as well.

Fixes: #3905
Change-Id: I829796c3e9f87f375149bebee7eef133a6876d4d

8 years ago- clarify Enum validation rules, fixes #3904
Mike Bayer [Wed, 1 Feb 2017 21:39:48 +0000 (16:39 -0500)] 
- clarify Enum validation rules, fixes #3904

Change-Id: I221f161ae77ee1b9487329330bc520ab65e97611

8 years agoUnion the exclude_properties of the inheriting mapper in declarative
Mike Bayer [Thu, 26 Jan 2017 21:11:49 +0000 (16:11 -0500)] 
Union the exclude_properties of the inheriting mapper in declarative

Fixed bug where the "automatic exclude" feature of declarative that
ensures a column local to a single table inheritance subclass does
not appear as an attribute on other derivations of the base would
not take effect for multiple levels of subclassing from the base.

Change-Id: Ibf67b631b4870dd1bd159f7d6085549d299fffe0
Fixes: #3895
8 years agoMerge "Add count(), scalar() to baked query"
mike bayer [Mon, 30 Jan 2017 22:27:21 +0000 (17:27 -0500)] 
Merge "Add count(), scalar() to baked query"

8 years agoAdd count(), scalar() to baked query
Mike Bayer [Wed, 25 Jan 2017 18:30:47 +0000 (13:30 -0500)] 
Add count(), scalar() to baked query

Change-Id: I8af0d7b41ae2df384ce5d0ef274732352d81f376
Fixes: #3897
8 years agoFix nested index_property setter when there is no container value
Jeong YunWon [Fri, 27 Jan 2017 14:29:59 +0000 (23:29 +0900)] 
Fix nested index_property setter when there is no container value

Fixed bug in new :mod:`sqlalchemy.ext.indexable` extension
where setting of a property that itself refers to another property
would fail.

Fixes: #3901
Change-Id: I203a66117e2399afee11a34f43f0e93adfc6d571

8 years agoCopy whereclause / using in ExcludeConstraint
Mike Bayer [Mon, 30 Jan 2017 17:10:16 +0000 (12:10 -0500)] 
Copy whereclause / using in ExcludeConstraint

Fixed bug in Postgresql :class:`.ExcludeConstraint` where the
"whereclause" and "using" parameters would not be copied during an
operation like :meth:`.Table.tometadata`.

Change-Id: I2f704981d4d4862f9c82a50272006fab8becebb6
Fixes: #3900
8 years ago- add missing param tag
Mike Bayer [Sat, 28 Jan 2017 14:53:10 +0000 (09:53 -0500)] 
- add missing param tag

Change-Id: Ic2cc0bdafbf3f1bc2993a9ad3475530eed91d0f1

8 years ago- cte() has moved to HasCTE(), since SelectBase is referred to
Mike Bayer [Sat, 28 Jan 2017 14:43:40 +0000 (09:43 -0500)] 
- cte() has moved to HasCTE(), since SelectBase is referred to
a lot just add inherited members so links to things like SelectBase.cte
continue to function

Change-Id: Ib57948d576d2063e10b0f528a5deaf07ea262322

8 years ago- remove misleading comment, ref #3902
Mike Bayer [Fri, 27 Jan 2017 17:08:57 +0000 (12:08 -0500)] 
- remove misleading comment, ref #3902

Change-Id: I481628146ff31bc9ea2f8a3687f375832b17e501

8 years agoDon't check isolation level prior to SQL Server 2005
Mike Bayer [Thu, 26 Jan 2017 21:54:02 +0000 (16:54 -0500)] 
Don't check isolation level prior to SQL Server 2005

Added a version check to the "get_isolation_level" feature, which is
invoked upon first connect, so that it skips for SQL Server version
2000, as the necessary system view is not available prior to SQL Server
2005.

Change-Id: If4f860513f0aae6625803f449714aedfc5075f57
Fixes: #3898
8 years ago- document that "column" and "where" are arbitrary SQL expressions
Mike Bayer [Thu, 26 Jan 2017 21:01:20 +0000 (16:01 -0500)] 
- document that "column" and "where" are arbitrary SQL expressions
for ExcludeConstraint, if string is used then quoting must
be applied manually.  fixes #3899

Change-Id: I5885c90179e4056b84fc4776464bba7c8c70a80a