Mike Bayer [Mon, 13 Aug 2012 15:00:58 +0000 (11:00 -0400)]
- [feature] Adding/removing None from a mapped collection
now generates attribute events. Previously, a None
append would be ignored in some cases. Related
to [ticket:2229].
- [feature] The presence of None in a mapped collection
now raises an error during flush. Previously,
None values in collections would be silently ignored.
[ticket:2229]
Mike Bayer [Mon, 13 Aug 2012 01:07:24 +0000 (21:07 -0400)]
- [bug] Fixed compiler bug whereby a given
select() would be modified if it had an "offset"
attribute, causing the construct to not compile
correctly a second time. [ticket:2545]
Mike Bayer [Mon, 13 Aug 2012 00:37:40 +0000 (20:37 -0400)]
- [bug] Fixed bug whereby user error in related-object
assignment could cause recursion overflow if the
assignment triggered a backref of the same name
as a bi-directional attribute on the incorrect
class to the same target. An informative
error is raised now.
Mike Bayer [Sat, 11 Aug 2012 19:51:08 +0000 (15:51 -0400)]
OK! let's turn this around completely. Forget making a single count across
all platforms. let's instead store callcounts for *all* observed platforms in a datafile.
Will try to get enough platforms in the file for jenkins to have meaningful results.
for platforms not in the file, it's just skiptest.
Mike Bayer [Thu, 9 Aug 2012 20:08:48 +0000 (16:08 -0400)]
- a new approach to profiling where we attempt to strip out
parts of the pstats that are idiosyncratic to different platforms.
the goal is no per-version assertions on tests, version differences
in theory would go into the list of profiling exceptions.
Mike Bayer [Tue, 7 Aug 2012 20:51:14 +0000 (16:51 -0400)]
- [feature] SQL Server dialect can be given
database-qualified schema names,
i.e. "schema='mydatabase.dbo'"; reflection
operations will detect this, split the schema
among the "." to get the owner separately,
and emit a "USE mydatabase" statement before
reflecting targets within the "dbo" owner;
the existing database returned from
DB_NAME() is then restored.
Mike Bayer [Tue, 7 Aug 2012 19:23:11 +0000 (15:23 -0400)]
- add new C extension "utils", so far includes distill_params
- repair test_processors which wasn't hitting the python functions
- add another suite to test_processors that does distill_params
Mike Bayer [Mon, 6 Aug 2012 15:36:57 +0000 (11:36 -0400)]
- [bug] Improvements to joined/subquery eager
loading dealing with chains of subclass entities
sharing a common base, with no specific "join depth"
provided. Will chain out to
each subclass mapper individually before detecting
a "cycle", rather than considering the base class
to be the source of the "cycle". [ticket:2481]
Mike Bayer [Sun, 5 Aug 2012 19:14:51 +0000 (15:14 -0400)]
- reorganization of declarative such that file sizes are managable again.
the vast majority of file lines are spent on documentation, which moves
into package __init__. The core declarative idea lives in base and
is back down to its originally low size of under 500 lines. The various
helpers and such move into api.py, and the full span of string lookup
moves into a new module clsregistry. the rest of declarative only
refers to two functions in clsregistry in three places inside of base.
- [feature] Declarative now maintains a registry
of classes by string name as well as by full
module-qualified name. Multiple classes with the
same name can now be looked up based on a module-qualified
string within relationship(). Simple class name
lookups where more than one class shares the same
name now raises an informative error message.
[ticket:2338]
- lots of tests to ensure the new weak referencing memory management
is maintained by the new class registry system. this ticket was
served very well by waiting to do #2526 first, else this would
have needed to be rewritten anyway.
Mike Bayer [Sat, 4 Aug 2012 22:32:38 +0000 (18:32 -0400)]
- [feature] A warning is emitted when a reference
to an instrumented collection is no longer
associated with the parent class due to
expiration/attribute refresh/collection
replacement, but an append
or remove operation is received on the
now-detached collection. [ticket:2476]
Mike Bayer [Wed, 1 Aug 2012 04:08:55 +0000 (00:08 -0400)]
- [bug] with_polymorphic() produces JOINs
in the correct order and with correct inheriting
tables in the case of sending multi-level
subclasses in an arbitrary order or with
intermediary classes missing. [ticket:1900]
Mike Bayer [Sat, 28 Jul 2012 21:12:09 +0000 (17:12 -0400)]
- [feature] Added reduce_columns() method
to select() construct, replaces columns inline
using the util.reduce_columns utility function
to remove equivalent columns. reduce_columns()
also adds "with_only_synonyms" to limit the
reduction just to those columns which have the same
name. The deprecated fold_equivalents() feature is
removed [ticket:1729].
- [feature] Added with_labels and
reduce_columns keyword arguments to
Query.subquery(), to provide two alternate
strategies for producing queries with uniquely-
named columns. [ticket:1729].
Mike Bayer [Tue, 24 Jul 2012 16:43:43 +0000 (12:43 -0400)]
- we probably need to keep the __clause_element__() logic in, else we have
a serious callcount problem. keeping the inspect() usage for those
cases where we want to interpret ORM-level FROM objects only.
Mike Bayer [Mon, 23 Jul 2012 22:22:06 +0000 (18:22 -0400)]
- [feature] ORM entities can be passed
to select() as well as the select_from(),
correlate(), and correlate_except()
methods, where they will be unwrapped
into selectables. [ticket:2245]
Mike Bayer [Mon, 23 Jul 2012 14:28:52 +0000 (10:28 -0400)]
add context to column_property docs illustrating the use of correlate_except()
to keep the non-correlated table from being correlated. part of
[ticket:2530] but also mentioned in [ticket:2245] for some reason.
Mike Bayer [Sun, 22 Jul 2012 20:36:29 +0000 (16:36 -0400)]
- [feature] Revised the rules used to determine
the operator precedence for the user-defined
operator, i.e. that granted using the ``op()``
method. Previously, the smallest precedence
was applied in all cases, now the default
precedence is zero, lower than all operators
except "comma" (such as, used in the argument
list of a ``func`` call) and "AS", and is
also customizable via the "precedence" argument
on the ``op()`` method. [ticket:2537]
Mike Bayer [Wed, 18 Jul 2012 00:04:22 +0000 (20:04 -0400)]
- a big renaming of all the _Underscore classes to have
plain names. The old names are still defined for
backwards compatibility.
- _BindParamClause renamed to BindParameter
Mike Bayer [Mon, 16 Jul 2012 21:29:02 +0000 (17:29 -0400)]
- express most of the orm.util functions in terms of the inspection system
- modify inspection system:
1. raise a new exception for any case where the inspection
context can't be returned. this supersedes the "not mapped"
errors.
2. don't configure mappers on a mapper inspection. this allows
the inspectors to be used during mapper config time. instead,
the mapper configures on "with_polymorphic_selectable" now,
which is needed for all queries
- add a bunch of new "is_XYZ" attributes to inspectors
- finish making the name change of "compile" -> "configure", for some reason
this was only done partially
Mike Bayer [Sun, 15 Jul 2012 00:33:16 +0000 (20:33 -0400)]
- [bug] Fixed bug mostly local to new
AbstractConcreteBase helper where the "type"
attribute from the superclass would not
be overridden on the subclass to produce the
"reserved for base" error message, instead placing
a do-nothing attribute there. This was inconsistent
vs. using ConcreteBase as well as all the behavior
of classical concrete mappings, where the "type"
column from the polymorphic base would be explicitly
disabled on subclasses, unless overridden
explicitly.
Mike Bayer [Sat, 14 Jul 2012 19:41:31 +0000 (15:41 -0400)]
- [feature] *Very limited* support for
inheriting mappers to be GC'ed when the
class itself is deferenced. The mapper
must not have its own table (i.e.
single table inh only) without polymorphic
attributes in place.
This allows for the use case of
creating a temporary subclass of a declarative
mapped class, with no table or mapping
directives of its own, to be garbage collected
when dereferenced by a unit test.
[ticket:2526]
Mike Bayer [Sat, 14 Jul 2012 18:24:51 +0000 (14:24 -0400)]
- [feature] The registry of classes
in declarative_base() is now a
WeakValueDictionary. So subclasses of
"Base" that are dereferenced will be
garbage collected, *if they are not
referred to by any other mappers/superclass
mappers*. [ticket:2526]
Mike Bayer [Sat, 14 Jul 2012 16:52:21 +0000 (12:52 -0400)]
move mapper-level UOW functionality straight into unitofwork also. there's
no need for this to be per-mapper. can't move dependency init
off of property though as this init needs to happen up front, added a test
to prove it.
Mike Bayer [Tue, 10 Jul 2012 15:00:49 +0000 (11:00 -0400)]
- [bug] Fixed more un-intuitivenesses in CTEs
which prevented referring to a CTE in a union
of itself without it being aliased.
CTEs now render uniquely
on name, rendering the outermost CTE of a given
name only - all other references are rendered
just as the name. This even includes other
CTE/SELECTs that refer to different versions
of the same CTE object, such as a SELECT
or a UNION ALL of that SELECT. We are
somewhat loosening the usual link between object
identity and lexical identity in this case.
A true name conflict between two unrelated
CTEs now raises an error.
Mike Bayer [Thu, 5 Jul 2012 14:19:59 +0000 (10:19 -0400)]
- [bug] ORM will perform extra effort to determine
that an FK dependency between two tables is
not significant during flush if the tables
are related via joined inheritance and the FK
dependency is not part of the inherit_condition,
saves the user a use_alter directive.
[ticket:2527]
Mike Bayer [Mon, 25 Jun 2012 16:42:47 +0000 (12:42 -0400)]
- move cte tests into their own test/sql/test_cte.py
- rework bindtemplate system of "numbered" params by applying
the numbers last, as we now need to generate these out of order
in some cases
- add positional assertion to assert_compile
- add new cte_positional collection to track bindparams generated
within cte visits; splice this onto the beginning of self.positiontup
at cte render time, [ticket:2521]