Mike Bayer [Fri, 8 Feb 2013 17:42:36 +0000 (12:42 -0500)]
The cx_oracle dialect will no longer run the bind parameter names
through ``encode()``, as this is not valid on Python 3, and prevented
statements from functioning correctly on Python 3. We now
encode only if ``supports_unicode_binds`` is False, which is not
the case for cx_oracle when at least version 5 of cx_oracle is used.
Mike Bayer [Fri, 8 Feb 2013 06:20:41 +0000 (01:20 -0500)]
Fixed bug whereby :meth:`.Query.yield_per` would set the execution
options incorrectly, thereby breaking subsequent usage of the
:meth:`.Query.execution_options` method. Courtesy Ryan Kelly.
[ticket:2661]
Mike Bayer [Wed, 6 Feb 2013 20:49:32 +0000 (15:49 -0500)]
- add an "empty_inserts" requirement target plus a suite test
- add suite tests for basic explicit Sequence support, result-row column access (tests that name_normalize is set correctly among many other things)
Mike Bayer [Sun, 3 Feb 2013 01:06:31 +0000 (20:06 -0500)]
Fixed a bug regarding column annotations which in particular
could impact some usages of the new :func:`.orm.remote` and
:func:`.orm.local` annotation functions, where annotations
could be lost when the column were used in a subsequent
expression.
[ticket:2660]
Mike Bayer [Sat, 2 Feb 2013 23:40:56 +0000 (18:40 -0500)]
Added a conditional import to the ``gaerdbms`` dialect which attempts
to import rdbms_apiproxy vs. rdbms_googleapi to work
on both dev and production platforms. Also now honors the
``instance`` attribute. Courtesy Sean Lynch.
[ticket:2649]
Mike Bayer [Sat, 2 Feb 2013 01:47:02 +0000 (20:47 -0500)]
Added a new argument to :class:`.Enum` and its base
:class:`.SchemaType` ``inherit_schema``. When set to ``True``,
the type will set its ``schema`` attribute of that of the
:class:`.Table` to which it is associated. This also occurs
during a :meth:`.Table.tometadata` operation; the :class:`.SchemaType`
is now copied in all cases when :meth:`.Table.tometadata` happens,
and if ``inherit_schema=True``, the type will take on the new
schema name passed to the method. The ``schema`` is important
when used with the Postgresql backend, as the type results in
a ``CREATE TYPE`` statement. [ticket:2657]
Mike Bayer [Sun, 27 Jan 2013 16:23:59 +0000 (11:23 -0500)]
Fixed bug where :meth:`.Table.tometadata` would fail if a
:class:`.Column` had both a foreign key as well as an
alternate ".key" name for the column. Also in 0.7.10.
[ticket:2643]
Mike Bayer [Fri, 25 Jan 2013 02:31:23 +0000 (21:31 -0500)]
the consideration of a pending object as
an "orphan" has been modified to more closely match the
behavior as that of persistent objects, which is that the object
is expunged from the :class:`.Session` as soon as it is
de-associated from any of its orphan-enabled parents. Previously,
the pending object would be expunged only if de-associated
from all of its orphan-enabled parents. The new flag ``legacy_is_orphan``
is added to :func:`.orm.mapper` which re-establishes the
legacy behavior. [ticket:2655]
Mike Bayer [Mon, 21 Jan 2013 23:17:10 +0000 (18:17 -0500)]
Fixed the (most likely never used) "@collection.link" collection
method, which fires off each time the collection is associated
or de-associated with a mapped object - the decorator
was not tested or functional. The decorator method
is now named :meth:`.collection.linker` though the name "link"
remains for backwards compatibility. Courtesy Luca Wehrstedt.
[ticket:2653]
Mike Bayer [Mon, 21 Jan 2013 22:57:24 +0000 (17:57 -0500)]
- Made some fixes to the system of producing custom instrumented
collections, mainly that the usage of the @collection decorators
will now honor the __mro__ of the given class, applying the
logic of the sub-most classes' version of a particular collection
method. Previously, it wasn't predictable when subclassing
an existing instrumented class such as :class:`.MappedCollection`
whether or not custom methods would resolve correctly.
[ticket:2654]
- The undocumented (and hopefully unused) system of producing
custom collections using an ``__instrumentation__`` datastructure
associated with the collection has been removed, as this was a complex
and untested feature which was also essentially redundant versus the
decorator approach. Other internal simplifcations to the
orm.collections module have been made as well.
Mike Bayer [Thu, 17 Jan 2013 02:04:32 +0000 (21:04 -0500)]
:class:`.Index` now supports arbitrary SQL expressions and/or
functions, in addition to straight columns. Common modifiers
include using ``somecolumn.desc()`` for a descending index and
``func.lower(somecolumn)`` for a case-insensitive index, depending on the
capabilities of the target backend.
[ticket:695]
Mike Bayer [Sat, 12 Jan 2013 22:21:35 +0000 (17:21 -0500)]
- add workaround for sqlite memusage tests, so no longer need to count to 220/skip tests
- Fixed potential memory leak which could occur if an
arbitrary number of :class:`.sessionmaker` objects
were created. The anonymous subclass created by
the sessionmaker, when dereferenced, would not be garbage
collected due to remaining class-level references from the
event package. This issue also applies to any custom system
that made use of ad-hoc subclasses in conjunction with
an event dispatcher. Also in 0.7.10. [ticket:2650]
Mike Bayer [Sat, 12 Jan 2013 17:14:15 +0000 (12:14 -0500)]
- changelog for pullreq 32
- Fixed a regression whereby the "collation" parameter
of the character types CHAR, NCHAR, etc. stopped working,
as "collation" is now supported by the base string types.
The TEXT, NCHAR, CHAR, VARCHAR types within the
MSSQL dialect are now synonyms for the base types.
- move out the type rendering tests into DB-agnostic tests
and remove some of the old "create" statements. tests here
are still very disorganized.
Mike Bayer [Tue, 8 Jan 2013 15:04:55 +0000 (10:04 -0500)]
Tweaked the "REQUIRED" symbol used by the compiler to identify
INSERT/UPDATE bound parameters that need to be passed, so that
it's more easily identifiable when writing custom bind-handling
code. [ticket:2648]
Mike Bayer [Wed, 2 Jan 2013 16:37:20 +0000 (11:37 -0500)]
- remove the test against bindparam('x') for the bind/result SQL expressions
- apply a consistent approach to the "see if method X is implemented" conditionals
Mike Bayer [Wed, 2 Jan 2013 16:26:37 +0000 (11:26 -0500)]
Fixed bug in :func:`.postgresql.array` construct whereby using it
inside of an :func:`.expression.insert` construct would produce an
error regarding a parameter issue in the ``self_group()`` method.
Mike Bayer [Sun, 30 Dec 2012 00:31:28 +0000 (19:31 -0500)]
Extended the :doc:`/core/inspection` system so that all Python descriptors
associated with the ORM or its extensions can be retrieved.
This fulfills the common request of being able to inspect
all :class:`.QueryableAttribute` descriptors in addition to
extension types such as :class:`.hybrid_property` and
:class:`.AssociationProxy`. See :attr:`.Mapper.all_orm_descriptors`.
Mike Bayer [Sat, 22 Dec 2012 23:40:06 +0000 (18:40 -0500)]
- add tests to ensure SELECT of dynamic collection not emitted
on regular append/remove history
- fix the real cause of the original #2637 issue, backrefs call upon
the "pop()" method now which wasn't implemented for Dynamic
Mike Bayer [Sat, 22 Dec 2012 15:36:55 +0000 (10:36 -0500)]
- revert the full iteration of the collection for a passive history event; that's
the wrong behavior, and for the original #2637 issue we will have to fix the
association proxy, which is #2642
Mike Bayer [Fri, 21 Dec 2012 22:53:57 +0000 (17:53 -0500)]
- significantly rework the approach to collection events and history within DynamicAttributeImpl
- Fixes to the "dynamic" loader on :func:`.relationship`, includes
that backrefs will work properly even when autoflush is disabled,
history events are more accurate in scenarios where multiple add/remove
of the same object occurs, as can often be the case in conjunction
with the association proxy. [ticket:2637]
Mike Bayer [Fri, 14 Dec 2012 15:29:46 +0000 (10:29 -0500)]
More adjustment to this SQLite related issue which was released in
0.7.9, to intercept legacy SQLite quoting characters when reflecting
foreign keys. In addition to intercepting double quotes, other
quoting characters such as brackets, backticks, and single quotes
are now also intercepted. [ticket:2568]
Mike Bayer [Thu, 13 Dec 2012 23:45:15 +0000 (18:45 -0500)]
The :meth:`.Query.select_from` method can now be used with a
:func:`.aliased` construct without it interfering with the entities
being selected. [ticket:2635]
Mike Bayer [Tue, 11 Dec 2012 21:31:41 +0000 (16:31 -0500)]
Fixed a regression caused by :ticket:`2410` whereby a
:class:`.CheckConstraint` would apply itself back to the
original table during a :meth:`.Table.tometadata` operation, as
it would parse the SQL expression for a parent table. The
operation now copies the given expression to correspond to the
new table.
[ticket:2633]
Mike Bayer [Sun, 9 Dec 2012 23:28:08 +0000 (18:28 -0500)]
Fixed table reflection for Oracle when accessing a synonym that refers
to a DBLINK remote database; while the syntax has been present in the
Oracle dialect for some time, up until now it has never been tested.
The syntax has been tested against a sample database linking to itself,
however there's still some uncertainty as to what should be used for the
"owner" when querying the remote database for table information.
Currently, the value of "username" from user_db_links is used to
match the "owner". [ticket:2619]
Mike Bayer [Sun, 9 Dec 2012 01:28:43 +0000 (20:28 -0500)]
Fixed bug where using server_onupdate=<FetchedValue|DefaultClause>
without passing the "for_update=True" flag would apply the default
object to the server_default, blowing away whatever was there.
The explicit for_update=True argument shouldn't be needed with this usage
(especially since the documentation shows an example without it being
used) so it is now arranged internally using a copy of the given default
object, if the flag isn't set to what corresponds to that argument.
Also in 0.7.10. [ticket:2631]
Mike Bayer [Sun, 9 Dec 2012 00:25:04 +0000 (19:25 -0500)]
Fixed bug whereby using a label_length on dialect that was smaller
than the size of actual column identifiers would fail to render
the columns correctly in a SELECT statement.
[ticket:2610]