Mike Bayer [Wed, 28 Aug 2013 21:25:44 +0000 (17:25 -0400)]
Fixed bug where using the ``column_reflect`` event to change the ``.key``
of the incoming :class:`.Column` would prevent primary key constraints,
indexes, and foreign key constraints from being correctly reflected.
Also in 0.8.3. [ticket:2811]
Mike Bayer [Sat, 24 Aug 2013 17:55:14 +0000 (13:55 -0400)]
- The :class:`.CreateColumn` construct can be appled to a custom
compilation rule which allows skipping of columns, by producing
a rule that returns ``None``. Also in 0.8.3.
Mike Bayer [Sat, 24 Aug 2013 15:30:57 +0000 (11:30 -0400)]
- this comment is wrong, the method here returns all mapper entities
- use a simple isinstance() check instead of looking for presence of
"primary_entity" flag, that's a little unclear
Mike Bayer [Sun, 18 Aug 2013 22:01:27 +0000 (18:01 -0400)]
- reorganize docs so expression, schema are broken out into subfiles, they're too big
- fix the targeting of module names moved around by using custom handlers for "Bases", etc.
Mike Bayer [Tue, 20 Aug 2013 17:27:27 +0000 (13:27 -0400)]
Fixed bug where list instrumentation would fail to represent a
setslice of ``[0:0]`` correctly, which in particular could occur
when using ``insert(0, item)`` with the association proxy. Due
to some quirk in Python collections, the issue was much more likely
with Python 3 rather than 2. Also in 0.8.3, 0.7.11.
[ticket:2807]
Mike Bayer [Sun, 18 Aug 2013 19:57:06 +0000 (15:57 -0400)]
Backported a change from 0.9 whereby the iteration of a hierarchy
of mappers used in polymorphic inheritance loads is sorted on class name,
which allows the SELECT statements generated for polymorphic queries
to have deterministic rendering, which in turn helps with caching
schemes that cache on the SQL string itself.
[ticket:2779]
Mike Bayer [Sun, 18 Aug 2013 19:34:23 +0000 (15:34 -0400)]
Fixed a potential issue in an ordered sequence implementation used
by the ORM to iterate mapper hierarchies; under the Jython interpreter
this implementation wasn't ordered, even though cPython and Pypy
maintained ordering. Also in 0.8.3.
[ticket:2794]
Mike Bayer [Sun, 18 Aug 2013 18:46:04 +0000 (14:46 -0400)]
Fixed regression dating back to 0.7.9 whereby the name of a CTE might
not be properly quoted if it was referred to in multiple FROM clauses.
Also in 0.8.3, 0.7.11. [ticket:2801]
Mike Bayer [Wed, 7 Aug 2013 18:28:45 +0000 (13:28 -0500)]
- The :meth:`.Operators.notin_` operator added in 0.8 now properly
produces the negation of the expression "IN" returns
when used against an empty collection. Also in 0.8.3.
Mike Bayer [Wed, 31 Jul 2013 22:42:58 +0000 (18:42 -0400)]
- Fixed bug in common table expression system where if the CTE were
used only as an ``alias()`` construct, it would not render using the
WITH keyword. Also in 0.7.11.
[ticket:2783]
Mike Bayer [Sat, 20 Jul 2013 02:56:34 +0000 (22:56 -0400)]
- Improved the examples in ``examples/generic_associations``, including
that ``discriminator_on_association.py`` makes use of single table
inheritance do the work with the "discriminator". Also
added a true "generic foreign key" example, which works similarly
to other popular frameworks in that it uses an open-ended integer
to point to any other table, foregoing traditional referential
integrity. While we don't recommend this pattern, information wants
to be free. Also in 0.8.3.
- Added a convenience class decorator :func:`.as_declarative`, is
a wrapper for :func:`.declarative_base` which allows an existing base
class to be applied using a nifty class-decorated approach. Also
in 0.8.3.
Mike Bayer [Fri, 19 Jul 2013 03:17:33 +0000 (23:17 -0400)]
Fixed bug in ORM-level event registration where the "raw" or
"propagate" flags could potentially be mis-configured in some
"unmapped base class" configurations. Also in 0.8.3.
[ticket:2786]
Mike Bayer [Wed, 17 Jul 2013 15:18:59 +0000 (11:18 -0400)]
Fixed bug in :class:`.CheckConstraint` DDL where the "quote" flag from a
:class:`.Column` object would not be propagated. Also in 0.8.3, 0.7.11.
[ticket:2784]
Mike Bayer [Sat, 13 Jul 2013 20:28:42 +0000 (16:28 -0400)]
A performance fix related to the usage of the :func:`.defer` option
when loading mapped entities. The function overhead of applying
a per-object deferred callable to an instance at load time was
significantly higher than that of just loading the data from the row
(note that ``defer()`` is meant to reduce DB/network overhead, not
necessarily function call count); the function call overhead is now
less than that of loading data from the column in all cases. There
is also a reduction in the number of "lazy callable" objects created
per load from N (total deferred values in the result) to 1 (total
number of deferred cols).
[ticket:2778]
Mike Bayer [Sat, 13 Jul 2013 01:52:54 +0000 (21:52 -0400)]
The newly added SQLite DATETIME arguments storage_format and
regexp apparently were not fully implemented correctly; while the
arguments were accepted, in practice they would have no effect;
this has been fixed.
[ticket:2781]
Mike Bayer [Fri, 12 Jul 2013 15:32:34 +0000 (11:32 -0400)]
Fixed bug where the expression system relied upon the ``str()``
form of a some expressions when referring to the ``.c`` collection
on a ``select()`` construct, but the ``str()`` form isn't available
since the element relies on dialect-specific compilation constructs,
notably the ``__getitem__()`` operator as used with a Postgresql
``ARRAY`` element. The fix also adds a new exception class
:class:`.UnsupportedCompilationError` which is raised in those cases
where a compiler is asked to compile something it doesn't know
how to.
[ticket:2780]
Mike Bayer [Thu, 11 Jul 2013 19:15:09 +0000 (15:15 -0400)]
Dialect.initialize() is not called a second time if an :class:`.Engine`
is recreated, due to a disconnect error. This fixes a particular
issue in the Oracle 8 dialect, but in general the dialect.initialize()
phase should only be once per dialect. [ticket:2776]
Mike Bayer [Fri, 5 Jul 2013 19:51:24 +0000 (15:51 -0400)]
- Added new method to the :func:`.insert` construct
:meth:`.Insert.from_select`. Given a list of columns and
a selectable, renders ``INSERT INTO (table) (columns) SELECT ..``.
While this feature is highlighted as part of 0.9 it is also
backported to 0.8.3. [ticket:722]
- The :func:`.update`, :func:`.insert`, and :func:`.delete` constructs
will now interpret ORM entities as FROM clauses to be operated upon,
in the same way that select() already does.
Mike Bayer [Fri, 5 Jul 2013 00:01:55 +0000 (20:01 -0400)]
Fixed bug whereby attribute history functions would fail
when an object we moved from "persistent" to "pending"
using the :func:`.make_transient` function, for operations
involving collection-based backrefs.
[ticket:2773]
Mike Bayer [Thu, 4 Jul 2013 17:25:40 +0000 (13:25 -0400)]
- take advantage of 0.9's pool redesign a bit, adding
_ConnectionRecord.checkin() so that this functionality is
encapsulated; is now called from two different locations
for [ticket:2772].
- Fixed bug where :class:`.QueuePool` would lose the correct
checked out count if an existing pooled connection failed to reconnect
after an invalidate or recycle event. [ticket:2772]
Mike Bayer [Wed, 3 Jul 2013 00:35:01 +0000 (20:35 -0400)]
for this test, apparently we don't handle sets as unordered since neither does
MySQL. for some reason set ordering was constant when testing mysqldb, but not
so with oursql.
Mike Bayer [Tue, 2 Jul 2013 22:24:58 +0000 (18:24 -0400)]
Fixed bug when using multi-table UPDATE where a supplemental
table is a SELECT with its own bound parameters, where the positioning
of the bound parameters would be reversed versus the statement
itself when using MySQL's special syntax.
[ticket:2768]
Mike Bayer [Tue, 2 Jul 2013 22:02:20 +0000 (18:02 -0400)]
ORM descriptors such as hybrid properties can now be referenced
by name in a string argument used with ``order_by``,
``primaryjoin``, or similar in :func:`.relationship`,
in addition to column-bound attributes. [ticket:2761]
Mike Bayer [Sun, 30 Jun 2013 23:54:59 +0000 (19:54 -0400)]
Added new flag ``retaining=False`` to the kinterbasdb and fdb dialects.
This controls the value of the ``retaining`` flag sent to the
``commit()`` and ``rollback()`` methods of the DBAPI connection.
Defaults to False. Also in 0.8.2, where it defaults to True.
[ticket:2763]
Mike Bayer [Sun, 30 Jun 2013 22:35:12 +0000 (18:35 -0400)]
- replace most explicitly-named test objects called "Mock..." with
actual mock objects from the mock library. I'd like to use mock
for new tests so we might as well use it in obvious places.
- use unittest.mock in py3.3
- changelog
- add a note to README.unittests
- add tests_require in setup.py
- have tests import from sqlalchemy.testing.mock
- apply usage of mock to one of the event tests. we can be using
this approach all over the place.
Mike Bayer [Sun, 30 Jun 2013 15:09:37 +0000 (11:09 -0400)]
A warning is emitted when trying to flush an object of an inherited
mapped class where the polymorphic discriminator has been assigned
to a value that is invalid for the class. [ticket:2750]