Commit Graph

11266 Commits

Author SHA1 Message Date
Lele Gaifax d507ea00a9 add nullsfirst() / nullslast() to top-level imports
Change-Id: Ieefcc4c30c1c17f43f2908d961e00815bae862bb
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/378
2017-11-16 09:33:00 -05:00
mike bayer 63ea6ef4fb Merge "Add baked.Result.with_post_criteria method" 2017-11-13 14:46:43 -05:00
Mike Bayer 4f054550b7 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
2017-11-13 09:23:14 -05:00
Mike Bayer 3937fc7dfc 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
2017-11-12 18:44:41 -05:00
Mike Bayer 6448903b52 - fix loop logic that was leaving out 10K items from
example suites, fixes #4132

Change-Id: Icf07f33fc99a880d6165d300579ef5d2c366f6f5
2017-11-09 11:38:22 -05:00
Mike Bayer 3c75a46be4 - add new FAQ section re: MySQL failure modes
Change-Id: I458dcf6290464c8bf140a376e9a8d2ee10937c08
2017-11-03 17:50:54 -04:00
Mike Bayer ca7d3b5a5b Version 1.1.16 placeholder
Change-Id: Ia563c801f5f467084c49fc367f31b2385e0777bb
(cherry picked from commit 0274d80f83)
2017-11-03 17:07:06 -04:00
Mike Bayer 4959f5da49 - 1.1.15
(cherry picked from commit 0b33a8c48f)

Change-Id: I1093dbb02844f6bea50639c0dd60d71de5c2d86f
2017-11-03 17:06:59 -04:00
Mike Bayer 75bdcd096f 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
2017-11-03 14:45:18 -04:00
Mike Bayer 152522b3f2 Add doc note for contains_eager() w/ subclasses.
Change-Id: I9634136e1855a081c25b04bb6ae8248f0f94be1c
Fixes: #4130
2017-11-02 13:53:34 -04:00
Mike Bayer 5d1a718214 - cross-link of_type() correctly
Change-Id: Iaacab5d2fe45b0b87fea922ec914e258dba9e30d
2017-11-02 13:40:43 -04:00
Nicolas CANIART 5acc9b149a 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
2017-10-31 11:38:07 -04:00
Mike Bayer 8965f30215 - add notes that @comparator and @expression don't go together.
Change-Id: I3fb366f8b49454453e4b6dada565c24c5ccb975e
2017-10-30 20:02:21 -04:00
Mike Bayer fd4289c582 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
2017-10-28 13:29:48 -04:00
mike bayer f7b957b589 Merge "Rework autoescape to be a simple boolean; escape the escape character" 2017-10-26 16:25:25 -04:00
Mike Bayer bda06f76c0 - fix formatting
Change-Id: I4085424656d8e7078dc46378129de6506c4141b2
2017-10-26 16:24:57 -04:00
mike bayer 139f31dc17 Merge "Test for EXCLUDE constraint duplicated index" 2017-10-25 20:05:34 -04:00
Mike Bayer 8d318dee6c 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
2017-10-25 15:02:46 -04:00
Ben Shen cd3db26cc9 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
2017-10-25 10:50:54 -04:00
Mike Bayer 654ca5463d 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
2017-10-24 23:11:13 -04:00
Mike Bayer f34b180ca9 Modernize SQL server binary tests
In preparation for I6e3c16a69465b4fbc7b17a1927fb5e66acee93cb
let's first use simplified binary test fixtures.

Change-Id: Ie0ac3ad194a64019bfcea0e5001cc8bdcf8a05e5
2017-10-24 12:40:25 -04:00
Mike Bayer 73f2527486 Merge remote-tracking branch 'origin/pr/396' 2017-10-24 10:40:05 -04:00
Mike Bayer 9e5395c3da Merge remote-tracking branch 'origin/pr/394' 2017-10-24 10:39:54 -04:00
Mike Bayer 0236ab5694 Merge remote-tracking branch 'origin/pr/359' 2017-10-24 10:39:43 -04:00
Mike Bayer 9018be2dfd Merge remote-tracking branch 'origin/pr/393' 2017-10-24 10:39:35 -04:00
Yoichi NAKAYAMA 2f46856f95 Remove extra backslash 2017-10-24 16:09:45 +09:00
Yoichi NAKAYAMA 521951b55d Fix typo in "on duplicate key update" example 2017-10-24 16:00:21 +09:00
mike bayer da4b0a41e1 Merge "Resolve AliasedClass when determining owning class of association proxy" 2017-10-23 20:56:06 -04:00
mike bayer 7482ba0b3c Merge "Remove deprecation warnings mysql5 7 20" 2017-10-23 20:35:35 -04:00
Mike Bayer 1c025e9795 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
2017-10-23 18:58:37 -04:00
Mike Bayer 9a3b86908a Revert 860640fb8d
Revert 860640fb8d as this breaking change
was not actually released under 1.1

Change-Id: Ia1bfbebc5c34cd003de8657fedfccb6a41fc53fe
2017-10-23 18:48:00 -04:00
Mike Bayer 860640fb8d Issue #4115 will be backported to 1.1, move changelog file
Change-Id: Ib5039ad9cbdf036ab78b74266847fd67cdcfbfc3
2017-10-23 18:39:47 -04:00
Daniel Thorell 41cfe44b5e 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
2017-10-23 18:29:23 -04:00
Jeff Widman 16c237d3d1 Fix typo: srtategies --> strategies 2017-10-20 15:33:36 -07:00
Jeff Widman 975081a3a8 Fix typo: multidimentional --> multidimensional 2017-10-20 15:24:15 -07:00
Mike Bayer 57f7788ec2 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
2017-10-20 16:08:47 -04:00
Mike Bayer f14a58dea4 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
2017-10-20 14:35:09 -04:00
Mike Bayer 55b511c396 Merge branch 'patch-1' of https://github.com/pletnes/sqlalchemy 2017-10-20 12:04:55 -04:00
mike bayer 62b3e73b25 Merge "Don't commit failed transaction" 2017-10-20 11:40:18 -04:00
Mike Bayer 1210f49bb5 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
2017-10-18 21:17:00 -04:00
Jan 1de1623590 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
2017-10-17 21:23:19 -04:00
Paul Anton Letnes b343dc5611 Add missing space in repr of the sessionmaker class
The missing space was driving me nuts.
2017-10-16 12:32:38 +02:00
Mike Bayer 1fbed902ed Version 1.2.0b4 placeholder
Change-Id: I6f0a29360d70851398532e957722ae2a76b76f38
2017-10-13 13:58:46 -04:00
Mike Bayer 9cf6ac32d6 - 1.2.0b3 2017-10-13 13:16:59 -04:00
mike bayer 2942ecb230 Merge "Disallow all ambiguous boolean values for Boolean" 2017-10-12 14:41:37 -04:00
Mike Bayer c63658973c 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
2017-10-12 13:39:06 -04:00
Mike Bayer 9ffee8c94a - make a note in 1.1 migration notes for ref #4102
Change-Id: If9edba3af476bc4303246e55d0ecb53009084342
2017-10-12 11:15:11 -04:00
Mike Bayer 3306d4d34d - psycopg2's batch mode isn't the multiple values thing,
it's just batching of statements

Change-Id: Ibb2e154d50ff3d9649822c9e4717ca5a3fd49430
2017-10-11 10:28:37 -04:00
Mike Bayer 4fbeec9d61 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
2017-10-10 13:43:35 -04:00
Mike Bayer 2b2cdee799 - add a note how to generate pg10 IDENTITY for now
Change-Id: I22dbf6ba322904a80c6df46f6a31daa2fcc1f946
2017-10-09 11:12:34 -04:00