]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
7 years agoRemove stale ON UPDATE/ON DELETE comment.
Andrew Gaul [Wed, 20 Jun 2018 00:29:34 +0000 (17:29 -0700)] 
Remove stale ON UPDATE/ON DELETE comment.

SQLite supports both of these features.

7 years agoMerge "Support foreign key option reflection for Oracle"
mike bayer [Tue, 6 Feb 2018 20:53:59 +0000 (15:53 -0500)] 
Merge "Support foreign key option reflection for Oracle"

7 years agoMerge "fix handling of native enum aliases in sqlalchemy enum columns"
mike bayer [Tue, 6 Feb 2018 20:51:03 +0000 (15:51 -0500)] 
Merge "fix handling of native enum aliases in sqlalchemy enum columns"

7 years agoSupport foreign key option reflection for Oracle
Miroslav Shubernetskiy [Mon, 5 Feb 2018 14:07:30 +0000 (09:07 -0500)] 
Support foreign key option reflection for Oracle

The ON DELETE options for foreign keys are now part of
Oracle reflection.  Oracle does not support ON UPDATE
cascades.  Pull request courtesy Miroslav Shubernetskiy.

Change-Id: I135cd6cd3436354a86b2c1e1437c3785c38eed26
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/418

7 years agofix handling of native enum aliases in sqlalchemy enum columns
Daniel Knell [Mon, 5 Feb 2018 14:25:47 +0000 (09:25 -0500)] 
fix handling of native enum aliases in sqlalchemy enum columns

Fixed bug where the :class:`.Enum` type wouldn't handle
enum "aliases" correctly, when more than one key refers to the
same value.  Pull request courtesy Daniel Knell.

Fixes: #4180
Change-Id: Ia716c00ca6c67aeab56965f0fdd575ecb7c71416
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/420

7 years agoConvert dialect modules to relative imports and test
Mike Bayer [Mon, 5 Feb 2018 14:03:08 +0000 (09:03 -0500)] 
Convert dialect modules to relative imports and test

For some reason the dialects were not consistently
converted to relative imports.  Also added a test to
ensure that __all__ is functioning within each dialect.

Change-Id: I8450ed724473be7e17678e9aba7ba0f661fdf134

7 years ago- ensure it's clear that all DDLEvents can be associated
Mike Bayer [Fri, 2 Feb 2018 20:46:30 +0000 (15:46 -0500)] 
- ensure it's clear that all DDLEvents can be associated
using propagate=True, which is consulted within the scope
of Table.tometadata().  Fixes: #4179

Change-Id: I0cb0d8f6a894bb645cfc94b3d9083339039c9193

7 years agoLook for __sa_reconstructor__ on original_init
Mike Bayer [Fri, 2 Feb 2018 14:36:25 +0000 (09:36 -0500)] 
Look for __sa_reconstructor__ on original_init

Fixed bug where the :func:`.orm.reconstructor` event
helper would not be recognized if it were applied to the
``__init__()`` method of the mapped class.

It's not clear when this bug appeared, but was likely
during a refactoring of instrumentation mechanics somewhere
between 0.8 and 1.0.

Change-Id: Iaeb3baffef9e1b40a336d44294e68479f5d65fd3
Fixes: #4178
7 years ago- don't scare off developers with the word "advanced" here
Mike Bayer [Wed, 31 Jan 2018 14:27:03 +0000 (09:27 -0500)] 
- don't scare off developers with the word "advanced" here

Change-Id: I72a0295634e228bacf6c92088e650183f91e4585

7 years agoMerge "Disable set eq test for python < 2.7.8"
mike bayer [Tue, 30 Jan 2018 22:29:55 +0000 (17:29 -0500)] 
Merge "Disable set eq test for python < 2.7.8"

7 years agoDisable set eq test for python < 2.7.8
Mike Bayer [Tue, 30 Jan 2018 20:51:30 +0000 (15:51 -0500)] 
Disable set eq test for python < 2.7.8

A test added in 1.2 thought to confirm a Python 2.7 behavior turns out to
be confirming the behavior only as of Python 2.7.8. Python bug #8743 still
impacts set comparison in Python 2.7.7 and earlier, so the test in question
involving AssociationSet no longer runs for these older Python 2.7
versions.

Change-Id: I4e5ab650fdcbfd215535c58438878e98ef924a9b
Fixes: #3265
7 years agoEnsure _BundleEntity provides .mapper
Mike Bayer [Mon, 29 Jan 2018 23:07:19 +0000 (18:07 -0500)] 
Ensure _BundleEntity provides .mapper

Fixed bug where the :class:`.Bundle` object did not
correctly report upon the primary :class:`.Mapper` object
represened by the bundle, if any.   An immediate
side effect of this issue was that the new selectinload
loader strategy wouldn't work with the horizontal sharding
extension.

Change-Id: I54a626100b2f4da497597e8944fa8dd853de47a3
Fixes: #4175
7 years agoRaise the sqlite3 import error, not the pysqlite2 one
robin [Sat, 27 Jan 2018 18:02:30 +0000 (13:02 -0500)] 
Raise the sqlite3 import error, not the pysqlite2 one

Fixed the import error raised when a platform
has neither pysqlite2 nor sqlite3 installed, such
that the sqlite3-related import error is raised,
not the pysqlite2 one which is not the actual
failure mode.  Pull request courtesy Robin.

Origin version only print `No module named pysqlite2` even
it's actually the import error of line 337: `from
sqlite3 import dbapi2 as sqlite` which point user
to the wrong debug direction.

It should raise `e.message` as `No module named _sqlite3`.

Change-Id: Idc39cd0d226957fd670859df23a2386dea6eb3cc
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/417

7 years agoAdd a new FAQ section explaining how to ensure parenthesis
Mike Bayer [Thu, 25 Jan 2018 21:11:29 +0000 (16:11 -0500)] 
Add a new FAQ section explaining how to ensure parenthesis
with op().

Not sure if this can be further improved at some point, such
as if a BinaryExpression automatically applied self_group()
when op() is called, however for the moment op() behaves consistently
as with all other operators without any ad-hoc effects.

Change-Id: Ia7f1ab43990450bd96757848b77a35e8fedeab63
References: #4174

7 years agoFurther refine map_column verbiage
Mike Bayer [Thu, 25 Jan 2018 14:17:41 +0000 (09:17 -0500)] 
Further refine map_column verbiage

The verbiage here continues to be misleading as it implies that
a MapperProperty already exists for the Column when this is not
the case.

Change-Id: Iaa6990dc9693d47d50b15c4815c3c7f6f34d8577

7 years agoVersion 1.2.3 placeholder
Mike Bayer [Thu, 25 Jan 2018 02:30:47 +0000 (21:30 -0500)] 
Version 1.2.3 placeholder

Change-Id: Ic957e27114d3c22b7413255c188cea0b2ebc35a6

7 years ago- 1.2.2 rel_1_2_2
Mike Bayer [Thu, 25 Jan 2018 02:24:36 +0000 (21:24 -0500)] 
- 1.2.2

7 years agoEnsure backrefs accommodate for op_bulk_replace
Mike Bayer [Wed, 24 Jan 2018 16:09:47 +0000 (11:09 -0500)] 
Ensure backrefs accommodate for op_bulk_replace

Fixed 1.2 regression regarding new bulk_replace event
where a backref would fail to remove an object from the
previous owner when a bulk-assignment assigned the
object to a new owner.

As this revisits the Event tokens associated with
AttributeImpl objects, remove the verbosity of the
"inline lazy init" pattern; the Event token is a simple
slotted object and should have minimal memory overhead.

Change-Id: Id188b4026fc2f3500186548008f4db8cdf7afecc
Fixes: #4171
7 years agoMerge "Adjust tests for pyodbc 4.0.22"
mike bayer [Wed, 24 Jan 2018 23:57:12 +0000 (18:57 -0500)] 
Merge "Adjust tests for pyodbc 4.0.22"

7 years agoAdjust tests for pyodbc 4.0.22
Mike Bayer [Wed, 24 Jan 2018 22:27:10 +0000 (17:27 -0500)] 
Adjust tests for pyodbc 4.0.22

pyodbc 4.0.22 is no longer allowing a datetime to be truncated
into a date, and additionally is asserting that numeric truncation
is not occurring; previously, it looks like we could send a
decimal of -1E-25 through the driver but we were only getting
back -1E-20, the test failed to check this.  Not clear if the
larger precision worked fully at some point, but in any case,
it doesn't work now so just remove those values from the test.

Change-Id: I66c7863b1708eb72f48173083b4ef78c93893b52

7 years agoRework synonym, synonym_for documentation
Mike Bayer [Wed, 24 Jan 2018 23:03:04 +0000 (18:03 -0500)] 
Rework synonym, synonym_for documentation

The map_column example was incorrect, and overall the purpose
of this parameter as well as that of synonym_for was not explained;
examples added along with more encouragement to use hybrids.

Change-Id: I20bd286f541f798daa81fa598c0f31db1f5aa6ed

7 years agoMerge "Add a few more MySQL 8.0 reserved words"
mike bayer [Fri, 19 Jan 2018 17:05:44 +0000 (12:05 -0500)] 
Merge "Add a few more MySQL 8.0 reserved words"

7 years agoAdd a few more MySQL 8.0 reserved words
Riccardo Magliocchetti [Wed, 17 Jan 2018 22:30:36 +0000 (17:30 -0500)] 
Add a few more MySQL 8.0 reserved words

Reference: https://dev.mysql.com/doc/refman/8.0/en/keywords.html

Change-Id: I3f2f1827b659559cbee0f2b8aa3573ddfd551289
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/414

7 years agoMerge "Normalize check constraints even more radically"
mike bayer [Wed, 17 Jan 2018 23:09:00 +0000 (18:09 -0500)] 
Merge "Normalize check constraints even more radically"

7 years agoNormalize check constraints even more radically
Florian Apolloner [Wed, 17 Jan 2018 21:38:50 +0000 (16:38 -0500)] 
Normalize check constraints even more radically

This is the only way I could get this test pass on informix, basically I strip every whitespace.
The sql text as recorded in informix is:
```
((a > 1 ) AND (a < 5 ) )
((a = 1 ) OR ((a > 2 ) AND (a <5 ) ) )
```
Yes, this is absolutely bonkers, but that is what I get :(

Change-Id: I936e860f2b75b521e5560c05c452dbe72f0d3812
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/413

7 years agoMerge "Use NCHAR + setinputsizes() for all NVARCHAR2"
mike bayer [Wed, 17 Jan 2018 21:36:36 +0000 (16:36 -0500)] 
Merge "Use NCHAR + setinputsizes() for all NVARCHAR2"

7 years agoUse NCHAR + setinputsizes() for all NVARCHAR2
Mike Bayer [Tue, 16 Jan 2018 17:41:29 +0000 (12:41 -0500)] 
Use NCHAR + setinputsizes() for all NVARCHAR2

The cx_Oracle dialect now calls setinputsizes() with cx_Oracle.NCHAR
unconditionally when the NVARCHAR2 datatype, in SQLAlchemy corresponding
to sqltypes.Unicode(), is in use.  Per cx_Oracle's author this allows
the correct conversions to occur within the Oracle client regardless
of the setting for NLS_NCHAR_CHARACTERSET.

Change-Id: I3989b7aaf2178c263015a7433939196b76baf1e4
Fixes: #4163
7 years agoAdd 10054 to ODBC / SQL Server disconnect codes
Mike Bayer [Tue, 16 Jan 2018 18:02:17 +0000 (13:02 -0500)] 
Add 10054 to ODBC / SQL Server disconnect codes

Change-Id: I6e2518232608f47515b96984b4b7a41b8385975a
Fixes: #4164
7 years agoVersion 1.2.2 placeholder
Mike Bayer [Mon, 15 Jan 2018 14:50:19 +0000 (09:50 -0500)] 
Version 1.2.2 placeholder

Change-Id: I216bad829f83062988b0a624ae4bef6716979ef3

7 years ago- 1.2.1 rel_1_2_1
Mike Bayer [Mon, 15 Jan 2018 14:24:24 +0000 (09:24 -0500)] 
- 1.2.1

7 years ago- add missing 2018 update to conf.py
Mike Bayer [Mon, 15 Jan 2018 14:20:52 +0000 (09:20 -0500)] 
- add missing 2018 update to conf.py

Change-Id: Ie2d4ff9486375867ed6958b82cd2595bae43746d

7 years agoMerge "Make column-level collation quoting dialect-specific"
mike bayer [Fri, 12 Jan 2018 20:50:28 +0000 (15:50 -0500)] 
Merge "Make column-level collation quoting dialect-specific"

7 years agohappy new year
Mike Bayer [Fri, 12 Jan 2018 19:23:53 +0000 (14:23 -0500)] 
happy new year

Change-Id: I3ef36bfd0cb0ba62b3123c8cf92370a43156cf8f

7 years agoMerge "Limit select in loading for correct types"
mike bayer [Fri, 12 Jan 2018 18:47:35 +0000 (13:47 -0500)] 
Merge "Limit select in loading for correct types"

7 years agoMerge "Turn on testing for JSON under Mariadb 10.2.7 and greater"
mike bayer [Fri, 12 Jan 2018 18:45:20 +0000 (13:45 -0500)] 
Merge "Turn on testing for JSON under Mariadb 10.2.7 and greater"

7 years agoMerge "`ValuesBase.values` inconsistency fix"
mike bayer [Fri, 12 Jan 2018 18:43:46 +0000 (13:43 -0500)] 
Merge "`ValuesBase.values` inconsistency fix"

7 years agoMake column-level collation quoting dialect-specific
Mike Bayer [Wed, 10 Jan 2018 03:17:59 +0000 (22:17 -0500)] 
Make column-level collation quoting dialect-specific

Fixed regression in 1.2 where newly repaired quoting
of collation names in :ticket:`3785` breaks SQL Server,
which explicitly does not understand a quoted collation
name.   Whether or not mixed-case collation names are
quoted or not is now deferred down to a dialect-level
decision so that each dialect can prepare these identifiers
directly.

Change-Id: Iaf0a8123d9bf4711219e320896bb28c5d2649304
Fixes: #4154
7 years agoMerge "Set up of_type variable for legacy loader option deserialize"
mike bayer [Fri, 12 Jan 2018 18:00:49 +0000 (13:00 -0500)] 
Merge "Set up of_type variable for legacy loader option deserialize"

7 years agoLimit select in loading for correct types
Mike Bayer [Wed, 10 Jan 2018 04:03:40 +0000 (23:03 -0500)] 
Limit select in loading for correct types

Fixed bug in new "selectin" relationship loader where the loader could try
to load a non-existent relationship when loading a collection of
polymorphic objects, where only some of the mappers include that
relationship, typically when :meth:`.PropComparator.of_type` is being used.

This generalizes the mapper limiting that was present
in _load_subclass_via_in() to be part of the PostLoad object
itself, and is used by both polymorphic selectin loading and
relationship selectin loading.

Change-Id: I31416550e27bc8374b673860f57d9dcf96abe87d
Fixes: #4156
7 years agoMerge "Re-enable setinputsizes for Oracle TIMESTAMP"
mike bayer [Fri, 12 Jan 2018 16:31:02 +0000 (11:31 -0500)] 
Merge "Re-enable setinputsizes for Oracle TIMESTAMP"

7 years ago`ValuesBase.values` inconsistency fix
Aubrey Stark-Toller [Fri, 5 Jan 2018 20:06:23 +0000 (15:06 -0500)] 
`ValuesBase.values` inconsistency fix

Fixed bug in :meth:`.Insert.values` where using the "multi-values"
format in combination with :class:`.Column` objects as keys rather
than strings would fail.   Pull request courtesy Aubrey Stark-Toller.

Change-Id: I9d3b40b5950df8f5bfdc8b1d22f9c3afb277f17f
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/412
Fixes: #4162
7 years agoTurn on testing for JSON under Mariadb 10.2.7 and greater
Mike Bayer [Fri, 5 Jan 2018 20:42:34 +0000 (15:42 -0500)] 
Turn on testing for JSON under Mariadb 10.2.7 and greater

MariaDB adds a JSON alias for the LONGTEXT datatype and
all the same json functions work against it in any case.
What doesn't work is reflection, since it's just an alias,
and also the CAST we were using in one of our tests doesn't seem
to work for JSON which is probably also because it's not
a real datatype.

Change-Id: I44e5503db29ca2f04de8e521527978f34675a5e0

7 years agoSet up of_type variable for legacy loader option deserialize
Mike Bayer [Wed, 10 Jan 2018 20:27:33 +0000 (15:27 -0500)] 
Set up of_type variable for legacy loader option deserialize

Fixed regression where pickle format of a Load / _UnboundLoad object (e.g.
loader options) changed and ``__setstate__()`` was raising an
UnboundLocalError for an object received from the legacy format, even
though an attempt was made to do so.  tests are now added to ensure this
works.

Change-Id: Idccf643e010776817dd32512facdefa263188814
Fixes: #4159
7 years agoDisable the singletonthreadpool test cleanup no gc
Mike Bayer [Wed, 10 Jan 2018 04:35:23 +0000 (23:35 -0500)] 
Disable the singletonthreadpool test cleanup no gc

This test often fails on CI under load and reveals a small
race condition within SingleonThreadPool's "cleanup" system.
As this pool's "cleanup" system is pretty much never used in
any case since this pool is no longer used for SQLite file
databases, this race should have little impact, especially
since the occasional non-closed connection will get closed
out when it's GC'ed in any case.

Change-Id: I68aefc0f9bbfc708c95af0497844e65366fc8429

7 years agoRe-enable setinputsizes for Oracle TIMESTAMP
Mike Bayer [Mon, 8 Jan 2018 21:05:23 +0000 (16:05 -0500)] 
Re-enable setinputsizes for Oracle TIMESTAMP

Fixed regression where the removal of most setinputsizes
rules from cx_Oracle dialect impacted the TIMESTAMP
datatype's ability to retrieve fractional seconds.

Fixes: #4157
Change-Id: Ic53109fd199aea8b9c4da14355e125849b8b198f

7 years agoturn off pytest's latest plugin we didn't ask for, logging
Mike Bayer [Fri, 5 Jan 2018 20:31:10 +0000 (15:31 -0500)] 
turn off pytest's latest plugin we didn't ask for, logging

Change-Id: I24d57894c519366febbce268b04474182dfbb0a1

7 years agoDon't try to iterate chopped path if it's None
Mike Bayer [Thu, 4 Jan 2018 21:58:55 +0000 (16:58 -0500)] 
Don't try to iterate chopped path if it's None

Fixed regression caused by new lazyload caching scheme in :ticket:`3954`
where a query that makes use of loader options with of_type would cause
lazy loads of unrelated paths to fail with a TypeError.

Change-Id: I705ea0ac012bcc3856ca04109454952cb07a2a8b
Fixes: #4153
7 years agoMerge "Check for object was expunged before restoring after pk switch + rollback"
mike bayer [Thu, 4 Jan 2018 21:31:10 +0000 (16:31 -0500)] 
Merge "Check for object was expunged before restoring after pk switch + rollback"

7 years agoMerge "Add rule to prevent "GROUP BY <expr>" in tests"
mike bayer [Thu, 4 Jan 2018 21:29:52 +0000 (16:29 -0500)] 
Merge "Add rule to prevent "GROUP BY <expr>" in tests"

7 years agoMerge "Remove cx_oracle test rule from requirements"
mike bayer [Thu, 4 Jan 2018 21:29:27 +0000 (16:29 -0500)] 
Merge "Remove cx_oracle test rule from requirements"

7 years agoCheck for object was expunged before restoring after pk switch + rollback
Mike Bayer [Thu, 4 Jan 2018 19:09:32 +0000 (14:09 -0500)] 
Check for object was expunged before restoring after pk switch + rollback

Fixed bug where an object that is expunged during a rollback of
a nested or subtransaction which also had its primary key mutated
would not be correctly removed from the session, causing subsequent
issues in using the session.

Change-Id: I57e2888902015d67ee11857e44382818f1d2f8bc
Fixes: #4151
7 years agoAdd rule to prevent "GROUP BY <expr>" in tests
Mike Bayer [Thu, 4 Jan 2018 15:44:53 +0000 (10:44 -0500)] 
Add rule to prevent "GROUP BY <expr>" in tests

Added a new exclusion rule group_by_complex_expression
which disables tests that use "GROUP BY <expr>", which seems
to be not viable for at least two third party dialects.

Change-Id: I47284513382ae93f5a3d12c734b3a44643147c99

7 years agoRemove cx_oracle test rule from requirements
Mike Bayer [Thu, 4 Jan 2018 15:40:36 +0000 (10:40 -0500)] 
Remove cx_oracle test rule from requirements

Removed an oracle-specific requirements rule from the public
test suite that was interfering with third party dialect
suites.

Change-Id: Iebae510edcb8ef908dcd9be9222888e12caed97d

7 years agoMerge "added missing , (comma) in dialects/oracle/__init__"
mike bayer [Wed, 3 Jan 2018 15:41:02 +0000 (10:41 -0500)] 
Merge "added missing , (comma) in dialects/oracle/__init__"

7 years agoCheck for the endmost target when chaining contains()
Mike Bayer [Tue, 2 Jan 2018 22:56:45 +0000 (17:56 -0500)] 
Check for the endmost target when chaining contains()

Fixed regression in association proxy due to :ticket:`3769`
(allow for chained any() / has()) where contains() against
an association proxy chained in the form
(o2m relationship, associationproxy(m2o relationship, m2o relationship))
would raise an error regarding the re-application of contains()
on the final link of the chain.

Change-Id: Iea51ce84c2c5a332416fff10b1ba0e676cf0bad7
Fixes: #4150
7 years agoadded missing , (comma) in dialects/oracle/__init__
Miroslav Shubernetskiy [Tue, 2 Jan 2018 21:34:09 +0000 (16:34 -0500)] 
added missing , (comma) in dialects/oracle/__init__

Fixed regression in Oracle imports where a missing comma caused
an undefined symbol to be present.  Pull request courtesy
Miroslav Shubernetskiy.

Change-Id: I91e79c810522dedd4f2a4f3bc60d484bc06f24c2
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/411

7 years ago- Add notfound page
Mike Bayer [Fri, 29 Dec 2017 17:06:50 +0000 (12:06 -0500)] 
- Add notfound page

Change-Id: Ie62014ff70c2a517e11ac76f8022f87f706020df

7 years agoVersion 1.2.1 placeholder
Mike Bayer [Wed, 27 Dec 2017 20:10:45 +0000 (15:10 -0500)] 
Version 1.2.1 placeholder

Change-Id: I86523071ec947e368464411de3666cffb11fab6b

7 years ago- 1.2.0 rel_1_2_0
Mike Bayer [Wed, 27 Dec 2017 16:13:24 +0000 (11:13 -0500)] 
- 1.2.0

7 years agoMerge "Implement an error lookup"
mike bayer [Wed, 27 Dec 2017 16:12:41 +0000 (11:12 -0500)] 
Merge "Implement an error lookup"

7 years agoImplement an error lookup
Mike Bayer [Fri, 8 Dec 2017 23:08:40 +0000 (18:08 -0500)] 
Implement an error lookup

Add codes to commonly raised error messages and classes
that link back to fixed documentation sections
giving background on these messages.

Change-Id: I78d0660add7026bb662e20305a59283b20616954

7 years ago- call this 1.2.0
Mike Bayer [Tue, 26 Dec 2017 19:18:27 +0000 (14:18 -0500)] 
- call this 1.2.0

Change-Id: If8d60e5d44f387eba97fd9bb1dfa85947ce7f42f

7 years ago- move this migration note to the correct section
Mike Bayer [Tue, 26 Dec 2017 18:27:39 +0000 (13:27 -0500)] 
- move this migration note to the correct section

Change-Id: I321a29b4a7705221e905b2e5ca88bae8d04b7e99

7 years ago- formatting fix
Mike Bayer [Tue, 26 Dec 2017 18:23:04 +0000 (13:23 -0500)] 
- formatting fix

Change-Id: Ie03b9649c7fc1a41bd3072da2506917a1297702a

7 years agoMerge "Add an identity_token to the identity key"
mike bayer [Tue, 26 Dec 2017 18:04:52 +0000 (13:04 -0500)] 
Merge "Add an identity_token to the identity key"

7 years ago- put error messages into the TOC so they get a sidebar
Mike Bayer [Tue, 26 Dec 2017 17:32:30 +0000 (12:32 -0500)] 
- put error messages into the TOC so they get a sidebar
toc entry

Change-Id: I5cd98e0bf396afd10a431af8a16a7c654f7a5ca7

7 years agoAdd new errors section
Mike Bayer [Fri, 22 Dec 2017 17:35:30 +0000 (12:35 -0500)] 
Add new errors section

Adding this to master so that it can be published, in
advance of the exception-level site integration feature.

Change-Id: Ia2a61df8e5198b81ef8f5fbac91143767b70c26b

7 years agoAdd an identity_token to the identity key
Mike Bayer [Thu, 14 Dec 2017 15:20:50 +0000 (10:20 -0500)] 
Add an identity_token to the identity key

For the purposes of assisting with sharded setups, add a new
member to the identity key that can be customized.  this allows
sharding across databases where the primary key space is shared.

Change-Id: Iae3909f5d4c501b62c10d0371fbceb01abda51db
Fixes: #4137
7 years agoMerge "Add TRUNCATE to postgres autocommit regexp"
mike bayer [Mon, 18 Dec 2017 17:57:18 +0000 (12:57 -0500)] 
Merge "Add TRUNCATE to postgres autocommit regexp"

7 years agoAdd TRUNCATE to postgres autocommit regexp
Jacob Hayes [Fri, 15 Dec 2017 14:56:59 +0000 (09:56 -0500)] 
Add TRUNCATE to postgres autocommit regexp

Extends AUTOCOMMIT_REGEXP for the postgres dialect to include `TRUNCATE`.

Change-Id: I315e03674b89bb89aae669b8655481e4d890491e
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/407

7 years agoOpen up all cx_Oracle numeric tests, finish infinity support
Mike Bayer [Fri, 15 Dec 2017 15:56:18 +0000 (10:56 -0500)] 
Open up all cx_Oracle numeric tests, finish infinity support

Added some additional rules to fully handle ``Decimal('Infinity')``,
``Decimal('-Infinity')`` values with cx_Oracle numerics when using
``asdecimal=True``.

Allow remaining cx_Oracle numeric tests that were waiting
for the refactor to be finished and forgot to get enabled.

Change-Id: I1e2365176e34559c0230c84f800a7cfe0a034ed5
Fixes: #4064
7 years agoMerge remote-tracking branch 'origin/pr/403'
Mike Bayer [Fri, 15 Dec 2017 14:52:23 +0000 (09:52 -0500)] 
Merge remote-tracking branch 'origin/pr/403'

7 years agoMerge remote-tracking branch 'origin/pr/399'
Mike Bayer [Fri, 15 Dec 2017 14:49:43 +0000 (09:49 -0500)] 
Merge remote-tracking branch 'origin/pr/399'

7 years agoFully copy index expressions
Mike Bayer [Thu, 14 Dec 2017 18:58:58 +0000 (13:58 -0500)] 
Fully copy index expressions

Fixed bug where the :meth:`.Table.tometadata` method would not properly
accommodate :class:`.Index` objects that didn't consist of simple
column expressions, such as indexes against a :func:`.text` construct,
indexes that used SQL expressions or :attr:`.func`, etc.   The routine
now copies expressions fully to a new :class:`.Index` object while
substituting all table-bound :class:`.Column` objects for those
of the target table.

Also refined the means by which tometadata() checks if an Index
or UniqueConstraint is generated by a column-level flag, by propagating
an attribute "_column_flag=True" to such indexes/constraints.

Change-Id: I7ef1b8ea42f9933357ae35f241a5ba9838bac35b
Fixes: #4147
7 years agoMerge "Change visit name for ColumnElement"
mike bayer [Thu, 7 Dec 2017 15:21:37 +0000 (10:21 -0500)] 
Merge "Change visit name for ColumnElement"

7 years agoMerge "Disable eager loads for exists()"
mike bayer [Thu, 7 Dec 2017 15:21:00 +0000 (10:21 -0500)] 
Merge "Disable eager loads for exists()"

7 years agoDisable eager loads for exists()
Mike Bayer [Wed, 6 Dec 2017 21:22:31 +0000 (16:22 -0500)] 
Disable eager loads for exists()

The :meth:`.Query.exists` method will now disable eager loaders for when
the query is rendered.  Previously, joined-eager load joins would be rendered
unnecessarily as well as subquery eager load queries would be needlessly
generated.   The new behavior matches that of the :meth:`.Query.subquery`
method.

Fixes: #4032
Change-Id: Iacafc76aa9ae0b71928037fa9637e85ad434ee3a

7 years agoChange visit name for ColumnElement
Mike Bayer [Wed, 6 Dec 2017 19:12:42 +0000 (14:12 -0500)] 
Change visit name for ColumnElement

No SQLA built-in subclasses ColumnElement without specifying
an alternate visit_name, and user defined ColumnElement
subclasses should avoid being treated like ColumnClause,
e.g. where a Table is present.

Fixes: #4142
Change-Id: I15ed09ba8bdebae4cb0c7e5e5df3f59351477577

7 years agoMerge "Allow delete where clause to refer multiple tables."
mike bayer [Wed, 6 Dec 2017 06:01:07 +0000 (01:01 -0500)] 
Merge "Allow delete where clause to refer multiple tables."

7 years agoMerge "Propagate attachment events for ARRAY"
mike bayer [Tue, 5 Dec 2017 19:50:17 +0000 (14:50 -0500)] 
Merge "Propagate attachment events for ARRAY"

7 years agoAllow delete where clause to refer multiple tables.
inytar [Mon, 30 Oct 2017 16:01:49 +0000 (12:01 -0400)] 
Allow delete where clause to refer multiple tables.

Implemented "DELETE..FROM" syntax for Postgresql, MySQL, MS SQL Server
(as well as within the unsupported Sybase dialect) in a manner similar
to how "UPDATE..FROM" works.  A DELETE statement that refers to more than
one table will switch into "multi-table" mode and render the appropriate
"USING" or multi-table "FROM" clause as understood by the database.
Pull request courtesy Pieter Mulder.

For SQL syntaxes see:

Postgresql: https://www.postgresql.org/docs/current/static/sql-delete.html
MySQL: https://dev.mysql.com/doc/refman/5.7/en/delete.html#multiple-table_syntax
MSSQL: https://docs.microsoft.com/en-us/sql/t-sql/statements/delete-transact-sql
Sybase: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00801.1510/html/iqrefso/X315721.htm

Co-authored by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I6dfd57b49e44a095d076dc493cd2360bb5d920d3
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/392
Fixes: #959
7 years agoAdd missing changelog note for #4109
Mike Bayer [Mon, 4 Dec 2017 22:51:21 +0000 (17:51 -0500)] 
Add missing changelog note for #4109

No changelog note was written at all for #4109 despite
this feature being released as of 1.2.0b3 (based on merge
date of 10/10/2017 and 1.2.0b3 release date of 10/13/2017

Change-Id: Ic4bcdaad9450cb86ba0e7cd6a18dee48c21ab592
Fixes: #4109
7 years agoMerge "Intercept contains_eager() with of_type, set aliased / polymorphic"
mike bayer [Mon, 4 Dec 2017 22:37:51 +0000 (17:37 -0500)] 
Merge "Intercept contains_eager() with of_type, set aliased / polymorphic"

7 years agoIntercept contains_eager() with of_type, set aliased / polymorphic
Mike Bayer [Fri, 3 Nov 2017 15:11:48 +0000 (11:11 -0400)] 
Intercept contains_eager() with of_type, set aliased / polymorphic

Fixed bug in :func:`.contains_eager` query option where making use of a
path that used :meth:`.PropComparator.of_type` to refer to a subclass
across more than one level of joins would also require that the "alias"
argument were provided with the same subtype in order to avoid adding
unwanted FROM clauses to the query; additionally,  using
:func:`.contains_eager` across subclasses that use :func:`.aliased` objects
of subclasses as the :meth:`.PropComparator.of_type` argument will also
render correctly.

Change-Id: Ie1c10924faa45251aab1a076a3ba7ef9fb1bdeee
Fixes: #4130
7 years agoPropagate attachment events for ARRAY
Mike Bayer [Mon, 4 Dec 2017 21:40:20 +0000 (16:40 -0500)] 
Propagate attachment events for ARRAY

Fixed regression in :class:`.ARRAY` datatype caused by
:ticket:`3964`, which is essentially the same
issue as that of :ticket:`3832`, where column attachment events
for :class:`.ARRAY` would not be invoked.   This breaks the use case
of using declarative mixins that declare a :class:`.Column` which
makes use of :meth:`.MutableList.as_mutable`.

Change-Id: If8c57615860883837f6cf72661e46180a77778c1
Fixes: #4141
7 years agoAllow url.password to be an object
Mike Bayer [Mon, 4 Dec 2017 16:56:14 +0000 (11:56 -0500)] 
Allow url.password to be an object

The "password" attribute of the :class:`.url.URL` object can now be
any user-defined or user-subclassed string object that responds to the
Python ``str()`` builtin.   The object passed will be maintained as the
datamember :attr:`.url.URL.password_original` and will be consulted
when the :attr:`.url.URL.password` attribute is read to produce the
string value.

Change-Id: I91d101c3b10e135ae7e4de60a5104b51776db84f
Fixes: #4089
7 years agoFix regexp for expanding IN
Mike Bayer [Fri, 1 Dec 2017 18:22:23 +0000 (13:22 -0500)] 
Fix regexp for expanding IN

Fixed bug in new "expanding bind parameter" feature whereby if multiple
params were used in one statement, the regular expression would not
match the parameter name correctly.

Change-Id: Ifaf7d627aac4ead2a13c8dddccb5c515253d88e6
Fixes: #4140
7 years agoMerge remote-tracking branch 'origin/pr/401'
Mike Bayer [Fri, 1 Dec 2017 17:51:26 +0000 (12:51 -0500)] 
Merge remote-tracking branch 'origin/pr/401'

7 years agoAllow for the database to produce a UUID instance
Martijn Pieters [Wed, 22 Nov 2017 10:05:44 +0000 (10:05 +0000)] 
Allow for the database to produce a UUID instance

Some database adapters (specifically, pg8000) already produce a uuid.UUID()
instance for UUID columns. Account for this.

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 agoFix a typo in basic_relationships.rst.
Randy Barlow [Wed, 15 Nov 2017 17:53:12 +0000 (12:53 -0500)] 
Fix a typo in basic_relationships.rst.

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
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 agoFix import in Inspector.reflecttable doc
Jacob Hayes [Thu, 9 Nov 2017 04:14:37 +0000 (22:14 -0600)] 
Fix import in Inspector.reflecttable doc