]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
7 years agoMerge "add nullsfirst() / nullslast() to top-level imports"
mike bayer [Fri, 17 Nov 2017 15:32:29 +0000 (10:32 -0500)] 
Merge "add nullsfirst() / nullslast() to top-level imports"

7 years agoMerge "Add postgresql.MONEY"
mike bayer [Thu, 16 Nov 2017 15:27:59 +0000 (10:27 -0500)] 
Merge "Add postgresql.MONEY"

7 years agoadd nullsfirst() / nullslast() to top-level imports
Lele Gaifax [Wed, 15 Nov 2017 23:11:05 +0000 (18:11 -0500)] 
add nullsfirst() / nullslast() to top-level imports

Change-Id: Ieefcc4c30c1c17f43f2908d961e00815bae862bb
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/378

7 years agoAdd postgresql.MONEY
Cleber J Santos [Wed, 15 Nov 2017 23:09:23 +0000 (18:09 -0500)] 
Add postgresql.MONEY

Change-Id: I2b40faf583a84bc5b416e1ad3aa812896ea67a8c
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/395

7 years agoAdd license to Wheel metadata
Jeff Widman [Wed, 15 Nov 2017 23:10:25 +0000 (18:10 -0500)] 
Add license to Wheel metadata

https://wheel.readthedocs.io/en/stable/index.html#including-the-license-in-the-generated-wheel-file

Change-Id: Icf91b96ba534c8f835ad287e7840ac2a9d2ac502
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/397

7 years agoMerge "Add baked.Result.with_post_criteria method"
mike bayer [Mon, 13 Nov 2017 19:46:43 +0000 (14:46 -0500)] 
Merge "Add baked.Result.with_post_criteria method"

7 years agoPropagate kwargs for mysql concat, match
Mike Bayer [Mon, 13 Nov 2017 14:21:48 +0000 (09:21 -0500)] 
Propagate kwargs for mysql concat, match

Fixed bug where the MySQL "concat" and "match" operators failed to
propagate kwargs to the left and right expressions, causing compiler
options such as "literal_binds" to fail.

Also adds non-interpreted **kw for visit_create_index, visit_typeclause

Change-Id: Iaf54ac18949cc6a54f50678125f010b4f12c5673
Fixes: #4136
7 years agoAdd baked.Result.with_post_criteria method
Mike Bayer [Sun, 12 Nov 2017 23:44:41 +0000 (18:44 -0500)] 
Add baked.Result.with_post_criteria method

Added new method :meth:`.baked.Result.with_post_criteria` to baked
query system, allowing non-SQL-modifying transformations to take place
after the query has been pulled from the cache.  Among other things,
this method can be used with :class:`.horizontal_shard.ShardedQuery`
to set the shard identifier.   :class:`.horizontal_shard.ShardedQuery`
has also been modified such that its :meth:`.ShardedQuery.get` method
interacts correctly with that of :class:`.baked.Result`.

Change-Id: I04630c683240abbb4b99f0510a1a3dcb564815b4
Fixes: #4135
7 years ago- fix loop logic that was leaving out 10K items from
Mike Bayer [Thu, 9 Nov 2017 16:38:22 +0000 (11:38 -0500)] 
- fix loop logic that was leaving out 10K items from
example suites, fixes #4132

Change-Id: Icf07f33fc99a880d6165d300579ef5d2c366f6f5

7 years ago- add new FAQ section re: MySQL failure modes
Mike Bayer [Fri, 3 Nov 2017 21:50:54 +0000 (17:50 -0400)] 
- add new FAQ section re: MySQL failure modes

Change-Id: I458dcf6290464c8bf140a376e9a8d2ee10937c08

7 years agoVersion 1.1.16 placeholder
Mike Bayer [Fri, 3 Nov 2017 21:07:06 +0000 (17:07 -0400)] 
Version 1.1.16 placeholder

Change-Id: Ia563c801f5f467084c49fc367f31b2385e0777bb
(cherry picked from commit 0274d80f8378b1bfb0c0857fec35fff380be53f9)

7 years ago- 1.1.15
Mike Bayer [Fri, 3 Nov 2017 21:06:59 +0000 (17:06 -0400)] 
- 1.1.15

(cherry picked from commit 0b33a8c48f184b6b530cfc4ee9af743c761845b2)

Change-Id: I1093dbb02844f6bea50639c0dd60d71de5c2d86f

7 years agoFix as many RST parse warnings as possible.
Mike Bayer [Fri, 3 Nov 2017 18:45:18 +0000 (14:45 -0400)] 
Fix as many RST parse warnings as possible.

Still a few I can't get.   Also 0.9 is EOL so hide the
unreleased notes.

Change-Id: If0e44d4a0b3e78e211f32d5c33b51b1a007c9c69

7 years agoAdd doc note for contains_eager() w/ subclasses.
Mike Bayer [Thu, 2 Nov 2017 17:53:34 +0000 (13:53 -0400)] 
Add doc note for contains_eager() w/ subclasses.

Change-Id: I9634136e1855a081c25b04bb6ae8248f0f94be1c
Fixes: #4130
7 years ago- cross-link of_type() correctly
Mike Bayer [Thu, 2 Nov 2017 17:40:43 +0000 (13:40 -0400)] 
- cross-link of_type() correctly

Change-Id: Iaacab5d2fe45b0b87fea922ec914e258dba9e30d

7 years agoAccommodate tuples for ColumnDefault.__repr__
Nicolas CANIART [Tue, 31 Oct 2017 15:34:10 +0000 (11:34 -0400)] 
Accommodate tuples for ColumnDefault.__repr__

Fixed bug where ``__repr__`` of :class:`.ColumnDefault` would fail
if the argument were a tuple.  Pull request courtesy Nicolas Caniart.

Change-Id: I08aa2448ef91054c43d6068ac54cedbdf7a83d64
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/1
Fixes: #4126
7 years ago- add notes that @comparator and @expression don't go together.
Mike Bayer [Tue, 31 Oct 2017 00:02:21 +0000 (20:02 -0400)] 
- add notes that @comparator and @expression don't go together.

Change-Id: I3fb366f8b49454453e4b6dada565c24c5ccb975e

7 years agoFilter attributes we don't map during a load_scalar_attributes
Mike Bayer [Sat, 28 Oct 2017 17:28:58 +0000 (13:28 -0400)] 
Filter attributes we don't map during a load_scalar_attributes

Fixed bug where a descriptor that is elsewhere a mapped column
or relationship within a hierarchy based on :class:`.AbstractConcreteBase`
would be referred towards during a refresh operation, causing an error
as the attribute is not mapped as a mapper property.
A similar issue can arise for other attributes like the "type" column
added by :class:`.AbstractConcreteBase` if the class fails to include
"concrete=True" in its mapper, however the check here should also
prevent that scenario from causing a problem.

Change-Id: I407b07a3a3e2c374da19fc86ed44b987d595dcfa
Fixes: #4124
7 years agoMerge "Rework autoescape to be a simple boolean; escape the escape character"
mike bayer [Thu, 26 Oct 2017 20:25:25 +0000 (16:25 -0400)] 
Merge "Rework autoescape to be a simple boolean; escape the escape character"

7 years ago- fix formatting
Mike Bayer [Thu, 26 Oct 2017 20:24:57 +0000 (16:24 -0400)] 
- fix formatting

Change-Id: I4085424656d8e7078dc46378129de6506c4141b2

7 years agoMerge "Test for EXCLUDE constraint duplicated index"
mike bayer [Thu, 26 Oct 2017 00:05:34 +0000 (20:05 -0400)] 
Merge "Test for EXCLUDE constraint duplicated index"

7 years agoTest for EXCLUDE constraint duplicated index
Mike Bayer [Wed, 25 Oct 2017 19:01:55 +0000 (15:01 -0400)] 
Test for EXCLUDE constraint duplicated index

An EXCLUDE constraint makes an index just like a UNIQUE does;
get_indexes() will receive this.  Test that this works out the
same way as it does for a UNIQUE.

Change-Id: I02ac7cbbb1ca0d1fcdcdbe9a8b8bd1ffee3e496c
Fixes: #4122
7 years agoFix / consolidate for SQL Server BINARY, VARBINARY
Ben Shen [Fri, 20 Oct 2017 15:31:59 +0000 (11:31 -0400)] 
Fix / consolidate for SQL Server BINARY, VARBINARY

Fixed bug where sqltypes.BINARY and sqltypes.VARBINARY datatypes
would not include correct bound-value handlers for pyodbc,
which allows the pyodbc.NullParam value to be passed that
helps with FreeTDS.

Co-authored by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I6e3c16a69465b4fbc7b17a1927fb5e66acee93cb
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/386
Fixes: #4121
7 years agoRework autoescape to be a simple boolean; escape the escape character
Mike Bayer [Tue, 24 Oct 2017 22:08:05 +0000 (18:08 -0400)] 
Rework autoescape to be a simple boolean; escape the escape character

Reworked the new "autoescape" feature introduced in
:ref:`change_2694` in 1.2.0b2 to be fully automatic; the escape
character now defaults to a forwards slash ``"/"`` and
is applied to percent, underscore, as well as the escape
character itself, for fully automatic escaping.  The
character can also be changed using the "escape" parameter.

Change-Id: I74894a2576983c0f6eb89480c9e5727f49fa9c25
Fixes: #2694
7 years agoModernize SQL server binary tests
Mike Bayer [Tue, 24 Oct 2017 16:40:25 +0000 (12:40 -0400)] 
Modernize SQL server binary tests

In preparation for I6e3c16a69465b4fbc7b17a1927fb5e66acee93cb
let's first use simplified binary test fixtures.

Change-Id: Ie0ac3ad194a64019bfcea0e5001cc8bdcf8a05e5

7 years agoMerge remote-tracking branch 'origin/pr/396'
Mike Bayer [Tue, 24 Oct 2017 14:40:05 +0000 (10:40 -0400)] 
Merge remote-tracking branch 'origin/pr/396'

7 years agoMerge remote-tracking branch 'origin/pr/394'
Mike Bayer [Tue, 24 Oct 2017 14:39:54 +0000 (10:39 -0400)] 
Merge remote-tracking branch 'origin/pr/394'

7 years agoMerge remote-tracking branch 'origin/pr/359'
Mike Bayer [Tue, 24 Oct 2017 14:39:43 +0000 (10:39 -0400)] 
Merge remote-tracking branch 'origin/pr/359'

7 years agoMerge remote-tracking branch 'origin/pr/393'
Mike Bayer [Tue, 24 Oct 2017 14:39:35 +0000 (10:39 -0400)] 
Merge remote-tracking branch 'origin/pr/393'

7 years agoRemove extra backslash
Yoichi NAKAYAMA [Tue, 24 Oct 2017 07:09:45 +0000 (16:09 +0900)] 
Remove extra backslash

7 years agoFix typo in "on duplicate key update" example
Yoichi NAKAYAMA [Tue, 24 Oct 2017 07:00:21 +0000 (16:00 +0900)] 
Fix typo in "on duplicate key update" example

7 years agoMerge "Resolve AliasedClass when determining owning class of association proxy"
mike bayer [Tue, 24 Oct 2017 00:56:06 +0000 (20:56 -0400)] 
Merge "Resolve AliasedClass when determining owning class of association proxy"

7 years agoMerge "Remove deprecation warnings mysql5 7 20"
mike bayer [Tue, 24 Oct 2017 00:35:35 +0000 (20:35 -0400)] 
Merge "Remove deprecation warnings mysql5 7 20"

7 years agoAdd changelog for ticket #4097
Mike Bayer [Mon, 23 Oct 2017 22:58:37 +0000 (18:58 -0400)] 
Add changelog for ticket #4097

A changelog was not added for #4097 even though this issue
was ticketed and backported to 1.1.

Change-Id: I1aeb5cb344c95ad86daa166e68eca7073eca0b87
Fixes: #4097
7 years agoRevert 860640fb8dfbaae6e3e38f81ea9efb40ecb3c3a7
Mike Bayer [Mon, 23 Oct 2017 22:48:00 +0000 (18:48 -0400)] 
Revert 860640fb8dfbaae6e3e38f81ea9efb40ecb3c3a7

Revert 860640fb8dfbaae6e3e38f81ea9efb40ecb3c3a7 as this breaking change
was not actually released under 1.1

Change-Id: Ia1bfbebc5c34cd003de8657fedfccb6a41fc53fe

7 years agoIssue #4115 will be backported to 1.1, move changelog file
Mike Bayer [Mon, 23 Oct 2017 22:39:47 +0000 (18:39 -0400)] 
Issue #4115 will be backported to 1.1, move changelog file

Change-Id: Ib5039ad9cbdf036ab78b74266847fd67cdcfbfc3

7 years agoRemove deprecation warnings mysql5 7 20
Daniel Thorell [Fri, 20 Oct 2017 16:59:55 +0000 (12:59 -0400)] 
Remove deprecation warnings mysql5 7 20

MySQL 5.7.20 now warns for use of the @tx_isolation variable; a version
check is now performed and uses @transaction_isolation instead
to prevent this warning.

Co-authored by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #4120
Change-Id: I4d2e04df760c5351a71dde8b32145cdc69fa6115
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/391

7 years agoFix typo: srtategies --> strategies
Jeff Widman [Fri, 20 Oct 2017 22:33:36 +0000 (15:33 -0700)] 
Fix typo: srtategies --> strategies

7 years agoFix typo: multidimentional --> multidimensional
Jeff Widman [Fri, 20 Oct 2017 22:24:15 +0000 (15:24 -0700)] 
Fix typo: multidimentional --> multidimensional

7 years agoGet MariaDB normalized version relative to "MariaDB" token
Mike Bayer [Fri, 20 Oct 2017 20:07:49 +0000 (16:07 -0400)] 
Get MariaDB normalized version relative to "MariaDB" token

Fixed regression from 1.2.0b3 where "MariaDB" version comparison can
fail for some particular MariaDB version strings under Python 3.

Change-Id: Iedf49f40c1614ccedf63e0fa26719dd704da104d
Fixes: #4115
7 years agoResolve AliasedClass when determining owning class of association proxy
Mike Bayer [Fri, 20 Oct 2017 18:34:16 +0000 (14:34 -0400)] 
Resolve AliasedClass when determining owning class of association proxy

Fixed bug where the association proxy would inadvertently link itself
to an :class:`.AliasedClass` object if it were called first with
the :class:`.AliasedClass` as a parent, causing errors upon subsequent
usage.

Change-Id: I9161bab67766bb75d73ca54d712ad1cad6de40dc
Fixes: #4116
7 years agoMerge branch 'patch-1' of https://github.com/pletnes/sqlalchemy
Mike Bayer [Fri, 20 Oct 2017 16:04:55 +0000 (12:04 -0400)] 
Merge branch 'patch-1' of https://github.com/pletnes/sqlalchemy

7 years agoMerge "Don't commit failed transaction"
mike bayer [Fri, 20 Oct 2017 15:40:18 +0000 (11:40 -0400)] 
Merge "Don't commit failed transaction"

7 years agoDon't commit failed transaction
Mike Bayer [Thu, 19 Oct 2017 01:17:00 +0000 (21:17 -0400)] 
Don't commit failed transaction

The test here commits even though integrityerror
was raised due to the fixture.  Postgresql seems to allow
this even though it's usually strict about this.  remove
the requirement that a database needs to be able to
commit after an integrity error was raised.

Change-Id: I437faadb04ff7a9c3f624c68646b4f4f504b504a

7 years agoadd order_by clause to make tests stable
Jan [Wed, 18 Oct 2017 01:23:19 +0000 (21:23 -0400)] 
add order_by clause to make tests stable

I observed test runs that failed on 'test_bound_in_scalar' due to arbitrary ordering of the result set. The assertion not only tests for the elements to be present, but also for the correct ordering. Hence, the proposal to add an order_by clause to the select statements.

Change-Id: If1fbb864761e77dfd2a42ef857801c8aaf893bee
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/389

7 years agoAdd missing space in repr of the sessionmaker class
Paul Anton Letnes [Mon, 16 Oct 2017 10:32:38 +0000 (12:32 +0200)] 
Add missing space in repr of the sessionmaker class

The missing space was driving me nuts.

7 years agoVersion 1.2.0b4 placeholder
Mike Bayer [Fri, 13 Oct 2017 17:58:46 +0000 (13:58 -0400)] 
Version 1.2.0b4 placeholder

Change-Id: I6f0a29360d70851398532e957722ae2a76b76f38

7 years ago- 1.2.0b3
Mike Bayer [Fri, 13 Oct 2017 17:16:59 +0000 (13:16 -0400)] 
- 1.2.0b3

7 years agoMerge "Disallow all ambiguous boolean values for Boolean"
mike bayer [Thu, 12 Oct 2017 18:41:37 +0000 (14:41 -0400)] 
Merge "Disallow all ambiguous boolean values for Boolean"

7 years agoDisallow all ambiguous boolean values for Boolean
Mike Bayer [Wed, 11 Oct 2017 21:56:14 +0000 (17:56 -0400)] 
Disallow all ambiguous boolean values for Boolean

In release 1.1, the :class:`.Boolean` type was broken in that
boolean coercion via ``bool()`` would occur for backends that did not
feature "native boolean", but would not occur for native boolean backends,
meaning the string ``"0"`` now behaved inconsistently. After a poll, a
consensus was reached that non-boolean values should be raising an error,
especially in the ambiguous case of string ``"0"``; so the :class:`.Boolean`
datatype will now raise ``ValueError`` if an incoming value is not
within the range ``None, True, False, 1, 0``.

Change-Id: If70c4f79c266f0dd1a0306c0ffe7acb9c66c4cc3
Fixes: #4102
7 years ago- make a note in 1.1 migration notes for ref #4102
Mike Bayer [Thu, 12 Oct 2017 15:15:11 +0000 (11:15 -0400)] 
- make a note in 1.1 migration notes for ref #4102

Change-Id: If9edba3af476bc4303246e55d0ecb53009084342

7 years ago- psycopg2's batch mode isn't the multiple values thing,
Mike Bayer [Wed, 11 Oct 2017 14:27:17 +0000 (10:27 -0400)] 
- psycopg2's batch mode isn't the multiple values thing,
it's just batching of statements

Change-Id: Ibb2e154d50ff3d9649822c9e4717ca5a3fd49430

7 years agoAdd fast execution helper support.
Mike Bayer [Tue, 10 Oct 2017 17:33:59 +0000 (13:33 -0400)] 
Add fast execution helper support.

Added a new flag ``use_batch_mode`` to the psycopg2 dialect.  This flag
enables the use of psycopg2's ``psycopg2.extras.execute_batch``
extension when the :class:`.Engine` calls upon ``cursor.executemany()``.
This extension provides a critical performance increase by over an order of magnitude
when running INSERT statements in batch.  The flag is False by default
as it is considered to be experimental for now.

Change-Id: Ib88d28bc792958d47109f644ff1d08c897db4ff7
Fixes: #4109
7 years ago - add a note how to generate pg10 IDENTITY for now
Mike Bayer [Mon, 9 Oct 2017 15:12:34 +0000 (11:12 -0400)] 
 - add a note how to generate pg10 IDENTITY for now

Change-Id: I22dbf6ba322904a80c6df46f6a31daa2fcc1f946

7 years agoMerge "Don't include SelectBase when searching for surface column elements"
mike bayer [Mon, 9 Oct 2017 01:43:09 +0000 (21:43 -0400)] 
Merge "Don't include SelectBase when searching for surface column elements"

7 years agoFix array_agg to accommodate ARRAY arguments
Mike Bayer [Fri, 6 Oct 2017 15:14:29 +0000 (11:14 -0400)] 
Fix array_agg to accommodate ARRAY arguments

Fixed bug in :func:`.array_agg` function where passing an argument
that is already of type :class:`.ARRAY`, such as a Postgresql
:obj:`.postgresql.array` construct, would produce a ``ValueError``, due
to the function attempting to nest the arrays.

Change-Id: Ibe5f6275d90e4868e6ef8a733de05acd44c05d78
Fixes: #4107
7 years agoDon't include SelectBase when searching for surface column elements
Mike Bayer [Thu, 5 Oct 2017 15:25:10 +0000 (11:25 -0400)] 
Don't include SelectBase when searching for surface column elements

Fixed bug where correlated select used against single-table inheritance
entity would fail to render correctly in the outer query, due to adjustment
for single inheritance discriminator criteria inappropriately re-applying
the criteria to the outer query.

Change-Id: I38df21f1392af1843e10119682fa0635d346e2a8
Fixes: #4103
7 years agoMerge "Add SQL Server TIMESTAMP / ROWVERSION datatypes"
mike bayer [Wed, 4 Oct 2017 14:12:39 +0000 (10:12 -0400)] 
Merge "Add SQL Server TIMESTAMP / ROWVERSION datatypes"

7 years agoAdd SQL Server TIMESTAMP / ROWVERSION datatypes
Mike Bayer [Mon, 2 Oct 2017 19:52:46 +0000 (15:52 -0400)] 
Add SQL Server TIMESTAMP / ROWVERSION datatypes

SQL Server has an entirely different use for the TIMESTAMP
datatype that is unrelated to the SQL standard's version of this
type.   It is a read-only type that returns an incrementing
binary value.  The ROWVERSION name will supersede the TIMESTAMP
name.  Implement datatype objects for both, separate from the
base DateTime/TIMESTAMP class hierarchy, and also implement
an optional integer coercion feature.

Change-Id: Ie2bd43b7aac57760b8ec6ff6e26460e2086a95eb
Fixes: #4086
7 years agoMerge "Improve check for overlapping FK targets on sibling classes"
mike bayer [Wed, 4 Oct 2017 13:21:36 +0000 (09:21 -0400)] 
Merge "Improve check for overlapping FK targets on sibling classes"

7 years agoImprove check for overlapping FK targets on sibling classes
Mike Bayer [Tue, 3 Oct 2017 00:50:56 +0000 (20:50 -0400)] 
Improve check for overlapping FK targets on sibling classes

Fixed bug where ORM relationship would warn against conflicting sync
targets (e.g. two relationships would both write to the same column) for
sibling classes in an inheritance hierarchy, where the two relationships
would never actually conflict during writes.

Change-Id: I9367a7978cadc59066e89fc4917d7eb6c78dedee
Fixes: #4078
7 years agoPG dialect test fixes
Mike Bayer [Mon, 2 Oct 2017 20:50:09 +0000 (16:50 -0400)] 
PG dialect test fixes

Make sure we clear the plugin registry before testing
that the "postgres" name raises.   Also move non-backend
tests out of MiscTest into a new suite.

Change-Id: Icd1bb4745aa07f52d585fcf959f76fcd8bdc7f24

7 years agoMerge "Support pg10"
mike bayer [Mon, 2 Oct 2017 18:30:21 +0000 (14:30 -0400)] 
Merge "Support pg10"

7 years agoSupport pg10
Mike Bayer [Mon, 2 Oct 2017 15:50:05 +0000 (11:50 -0400)] 
Support pg10

One test appears to use some awkward calling style
with the current_date function that isn't working in pg10
anymore, this looks like an extremely
old test that can be removed

Change-Id: I5f8aee0f5ed423461be5a9060c812eb0acdc7df5

7 years agouse fails_if for check_constraint_reflection
Mike Bayer [Fri, 29 Sep 2017 17:22:07 +0000 (13:22 -0400)] 
use fails_if for check_constraint_reflection

Change-Id: Id66c563027561a4b3baf853093b0b408d032c173

7 years agoSupport mariadb 10.2
Mike Bayer [Sat, 19 Aug 2017 22:39:08 +0000 (18:39 -0400)] 
Support mariadb 10.2

Fixed issue where CURRENT_TIMESTAMP would not reflect correctly
in the MariaDB 10.2 series due to a syntax change, where the function
is now represented as ``current_timestamp()``.

Fixes: #4096
MariaDB 10.2 now supports CHECK constraints (warning: use version 10.2.9
or greater due to upstream issues noted in :ticket:`4097`).  Reflection
now takes these CHECK constraints into account when they are present in
the ``SHOW CREATE TABLE`` output.

Fixes: #4098
Change-Id: I8666d61814e8145ca12cbecad94019b44af868e3

7 years agoTake schema name into account when querying sqlite_master
Mike Bayer [Thu, 28 Sep 2017 20:47:28 +0000 (16:47 -0400)] 
Take schema name into account when querying sqlite_master

Fixed bug where SQLite CHECK constraint reflection would fail
if the referenced table were in a remote schema, e.g. on SQLite a
remote database referred to by ATTACH.

Also add suite support for general CHECK constraint reflection.

Change-Id: I073a72cb47dc4f8c5683000d708768523759332f
Fixes: #4099
7 years agoRemove unused .cascading from unit test for __table_cls__ feature
Mike Bayer [Thu, 28 Sep 2017 17:05:56 +0000 (13:05 -0400)] 
Remove unused .cascading from unit test for __table_cls__ feature

Two independent gerrits for 04bbad660bcbb7b920f3e75110a7b1187d9ddc38
and ec1700ba29f7f15859ee6576855a4d6675265640 produce a failure
when merged due to new warning.
will merge into rel_1_1 as well for completeness even though
warning is not there.

Change-Id: I1bd494d205107d8b2a30d475a22c61a59b70985b

7 years agoWarn for mariadb 10.2 < 9
Mike Bayer [Thu, 28 Sep 2017 16:31:54 +0000 (12:31 -0400)] 
Warn for mariadb 10.2 < 9

There's a few CHECK constraint issues we managed
to get resolved as of MariaDB 10.2.8 then 10.2.9.   They
are pretty severe so warn users for these particular mariadb
versions.

Change-Id: Ie0899f94fda25960975ebee72f3044370f43eb7c
Fixes: #4097
7 years agoMerge "Add full list of pyodbc error codes for MSSQL"
mike bayer [Thu, 28 Sep 2017 16:07:19 +0000 (12:07 -0400)] 
Merge "Add full list of pyodbc error codes for MSSQL"

7 years ago- add more dragons to session.begin() / autocommit docs
Mike Bayer [Thu, 28 Sep 2017 15:43:48 +0000 (11:43 -0400)] 
- add more dragons to session.begin() / autocommit docs

Change-Id: I9e326f353d396321565dfbf53b7a30f18d8c86e9

7 years ago- tweak the handle_error docs a bit
Mike Bayer [Thu, 28 Sep 2017 13:59:16 +0000 (09:59 -0400)] 
- tweak the handle_error docs a bit

Change-Id: Iebe5b13b3a568f3aa0f3ab02a55e2a9cbb4545c7

7 years agoAdd full list of pyodbc error codes for MSSQL
Mike Bayer [Thu, 28 Sep 2017 13:39:54 +0000 (09:39 -0400)] 
Add full list of pyodbc error codes for MSSQL

Moved the SQL server error codes out of connnectors/pyodbc.py
and into mssql/pyodbc.py.  Added complete list
of odbc-related disconnect codes.

Change-Id: Icd84a920dbfa1f188847f859654ff6f7a48170f1
Fixes: #4095
7 years agoMerge "Support method form of any_(), all_()"
mike bayer [Wed, 27 Sep 2017 22:10:04 +0000 (18:10 -0400)] 
Merge "Support method form of any_(), all_()"

7 years agoSupport method form of any_(), all_()
Mike Bayer [Wed, 27 Sep 2017 14:14:57 +0000 (10:14 -0400)] 
Support method form of any_(), all_()

Fixed bug where the recently added :meth:`.ColumnOperators.any_`
and :meth:`.ColumnOperators.all_` methods didn't work when called
as methods, as opposed to using the standalone functions
:func:`~.expression.any_` and :func:`~.expression.all_`.  Also
added documentation examples for these relatively unintuitive
SQL operators.

Change-Id: I3e56b463e9fd146a077b9970624f50cba27f9811
Fixes: #4093
7 years agoMerge "Accomodate for multidimensional array in rewriting for COLLATE"
mike bayer [Wed, 27 Sep 2017 19:47:47 +0000 (15:47 -0400)] 
Merge "Accomodate for multidimensional array in rewriting for COLLATE"

7 years agoMerge "Don't expire "deferred" attributes in make_transient_to_detached"
mike bayer [Wed, 27 Sep 2017 19:47:10 +0000 (15:47 -0400)] 
Merge "Don't expire "deferred" attributes in make_transient_to_detached"

7 years agoMerge "Document and test __table_cls__"
mike bayer [Wed, 27 Sep 2017 19:38:29 +0000 (15:38 -0400)] 
Merge "Document and test __table_cls__"

7 years agoMerge "Warnings for @declared_attr.cascading"
mike bayer [Wed, 27 Sep 2017 19:37:18 +0000 (15:37 -0400)] 
Merge "Warnings for @declared_attr.cascading"

7 years agoAccomodate for multidimensional array in rewriting for COLLATE
Mike Bayer [Wed, 27 Sep 2017 13:48:17 +0000 (09:48 -0400)] 
Accomodate for multidimensional array in rewriting for COLLATE

Made further fixes to the :class:`.ARRAY` class in conjunction with
COLLATE, as the fix made in :ticket:`4006` failed to accommodate
for a multidimentional array.

Change-Id: If3e438f8ce94ebae2196671c88a4914f3b743e60
Fixes: #4006
7 years agobump 4088 to test ticket autoclose origin
Mike Bayer [Tue, 26 Sep 2017 22:47:20 +0000 (18:47 -0400)] 
bump 4088 to test ticket autoclose

Issue resolved in 35a1f5481a28837490037a6bd99d63590f748933

Change-Id: Ie1acae3d14467916b479192aebb5860ab31992f1
Fixes: #4088
7 years agoDon't expire "deferred" attributes in make_transient_to_detached
Mike Bayer [Tue, 26 Sep 2017 19:33:04 +0000 (15:33 -0400)] 
Don't expire "deferred" attributes in make_transient_to_detached

Fixed issue where the :func:`.make_transient_to_detached` function
would expire all attributes on the target object, including "deferred"
attributes, which has the effect of the attribute being undeferred
for the next refesh, causing an unexpected load of the attribute.

Change-Id: I82a385e3033e3f3c31569b1e908efb5f258d0f27
Fixes: #4084
7 years agoMerge branch 'patch-1' of https://github.com/irushchyshyn/sqlalchemy
Mike Bayer [Tue, 26 Sep 2017 15:49:31 +0000 (11:49 -0400)] 
Merge branch 'patch-1' of https://github.com/irushchyshyn/sqlalchemy

7 years agoMerge "Make a common approach for "emulated" types"
mike bayer [Tue, 26 Sep 2017 15:43:25 +0000 (11:43 -0400)] 
Merge "Make a common approach for "emulated" types"

7 years agoDocument and test __table_cls__
Mike Bayer [Tue, 26 Sep 2017 00:00:20 +0000 (20:00 -0400)] 
Document and test __table_cls__

A use case has been identified for __table_cls__, which was
added in 1.0 just for the purpose of test fixtures.   Add this to
public API and ensure the target use case (conditional table generation)
stays supported.

Change-Id: I87be5bcb72205cab89871fa586663bf147450995
Fixes: #4082
7 years agoWarnings for @declared_attr.cascading
Mike Bayer [Tue, 26 Sep 2017 15:03:07 +0000 (11:03 -0400)] 
Warnings for @declared_attr.cascading

A warning is emitted if a subclass attempts to override an attribute
that was declared on a superclass using ``@declared_attr.cascading``
that the overridden attribute will be ignored. This use
case cannot be fully supported down to further subclasses without more
complex development efforts, so for consistency the "cascading" is
honored all the way down regardless of overriding attributes.

A warning is emitted if the ``@declared_attr.cascading`` attribute is
used with a special declarative name such as ``__tablename__``, as this
has no effect.

Ensure that documenation refers to the current inconsistency that
__tablename__ can be overridden by subclasses however
@declared_attr.cascading cannot.

Fixes: #4091
Fixes: #4092
Change-Id: I3aecdb2f99d408e404a1223f5ad86ae3c7fdf036

7 years agoFix noseplugin to accept `zeroarg_callback` for `--dbs` option
Iryna Shcherbina [Tue, 26 Sep 2017 06:32:12 +0000 (08:32 +0200)] 
Fix noseplugin to accept `zeroarg_callback` for `--dbs` option

./sqla_nose.py --dbs  works fine with zero arguments, so `zeroarg_callback` should be treated as `callback`.

7 years agoMerge "Add table / column comments into tometadata()"
mike bayer [Mon, 25 Sep 2017 23:32:11 +0000 (19:32 -0400)] 
Merge "Add table / column comments into tometadata()"

7 years agoMake a common approach for "emulated" types
Mike Bayer [Sat, 23 Sep 2017 16:19:56 +0000 (12:19 -0400)] 
Make a common approach for "emulated" types

Internal refinements to the :class:`.Enum`, :class:`.Interval`, and
:class:`.Boolean` types, which now extend a common mixin
:class:`.Emulated` that indicates a type that provides Python-side
emulation of a DB native type, switching out to the DB native type when a
supporting backend is in use.   The Postgresql :class:`.INTERVAL` type
when used directly will now include the correct type coercion rules for
SQL expressions that also take effect for :class:`.sqltypes.Interval`
(such as adding a date to an interval yields a datetime).

Change-Id: Ifb9f9d7cbd9f5990dcb2abb583193e9e92b789ad
Fixes: #4088
7 years agoMerge branch 'kishkin/fixed-a-typo-in-before_execute-doc-event-1503409727849' of...
Mike Bayer [Mon, 25 Sep 2017 21:24:57 +0000 (17:24 -0400)] 
Merge branch 'kishkin/fixed-a-typo-in-before_execute-doc-event-1503409727849' of https://bitbucket.org/kishkin/sqlalchemy

7 years agoAdd table / column comments into tometadata()
Mike Bayer [Sat, 23 Sep 2017 16:08:40 +0000 (12:08 -0400)] 
Add table / column comments into tometadata()

Fixed bug in new SQL comments feature where table and column comment
would not be copied when using :meth:`.Table.tometadata`.

Change-Id: Ib3112e5e02930245daacb36c8ed38c01fa3e7dbd
Fixes: #4087
7 years agoMerge "Add __next__(), next() to ResultProxy"
mike bayer [Mon, 18 Sep 2017 13:49:50 +0000 (09:49 -0400)] 
Merge "Add __next__(), next() to ResultProxy"

7 years agoAdd multivalued insert context for defaults
Mike Bayer [Wed, 13 Sep 2017 15:39:47 +0000 (11:39 -0400)] 
Add multivalued insert context for defaults

Added a new method :class:`.DefaultExecutionContext.current_parameters`
which is used within a function-based default value generator in
order to retrieve the current parameters being passed to the statement.
The new function differs from the ``.current_parameters`` attribute in
that it also provides for optional grouping of parameters that
correspond to a multi-valued "insert" construct.  Previously it was not
possible to identify the subset of parameters that were relevant to
the function call.

Change-Id: I6894c7b4a2bce3e83c3ade8af0e5b2f8df37b785
Fixes: #4075
7 years agoAdd __next__(), next() to ResultProxy
Mike Bayer [Fri, 15 Sep 2017 15:14:36 +0000 (11:14 -0400)] 
Add __next__(), next() to ResultProxy

Added ``__next__()`` and ``next()`` methods to :class:`.ResultProxy`,
so that the ``next()`` builtin function works on the object directly.
:class:`.ResultProxy` has long had an ``__iter__()`` method which already
allows it to respond to the ``iter()`` builtin.   The implementation
for ``__iter__()`` is unchanged, as performance testing has indicated
that iteration using a ``__next__()`` method with ``StopIteration``
is about 20% slower in both Python 2.7 and 3.6.

Change-Id: I70569a4c48ad85a3c21a7ad422f270a559926cfb
Fixes: #4077
7 years agoMerge "Implement placeholders for CUBE, ROLLUP, GROUPING SETS"
mike bayer [Thu, 14 Sep 2017 19:40:22 +0000 (15:40 -0400)] 
Merge "Implement placeholders for CUBE, ROLLUP, GROUPING SETS"

7 years agoMerge "Ensure (+) is rendered for all right-hand members"
mike bayer [Wed, 13 Sep 2017 19:50:42 +0000 (15:50 -0400)] 
Merge "Ensure (+) is rendered for all right-hand members"

7 years agoImplement placeholders for CUBE, ROLLUP, GROUPING SETS
Spitcyn [Tue, 12 Sep 2017 14:21:57 +0000 (10:21 -0400)] 
Implement placeholders for CUBE, ROLLUP, GROUPING SETS

Fixes: #3429
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I870ee7dc801d553c5309c291402ec468b671e9a9
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/383

7 years agoEnsure (+) is rendered for all right-hand members
Mike Bayer [Wed, 13 Sep 2017 18:53:29 +0000 (14:53 -0400)] 
Ensure (+) is rendered for all right-hand members

Fixed bug where Oracle 8 "non ansi" join mode would not add the
``(+)`` operator to expressions that used an operator other than the
``=`` operator.  The ``(+)`` needs to be on all columns that are part
of the right-hand side.

Change-Id: I952e2369f11b78f5b918456ae3a5b0768d9761ec
Fixes: #4076
7 years agouse the stack to get the insert statement in on conflict
Mike Bayer [Tue, 12 Sep 2017 16:57:40 +0000 (12:57 -0400)] 
use the stack to get the insert statement in on conflict

Fixed bug in Postgresql :meth:`.postgresql.dml.Insert.on_conflict_do_update`
which would prevent the insert statement from being used as a CTE,
e.g. via :meth:`.Insert.cte`, within another statement.

Change-Id: Ie20972a05e194290bc9d92819750845872949ecc
Fixes: #4074
7 years agoRefactor for cx_Oracle version 6
Mike Bayer [Fri, 1 Sep 2017 04:11:10 +0000 (00:11 -0400)] 
Refactor for cx_Oracle version 6

Drops support for cx_Oracle prior to version 5.x, reworks
numeric and binary support.

Fixes: #4064
Change-Id: Ib9ae9aba430c15cd2a6eeb4e5e3fd8e97b5fe480