Mike Bayer [Fri, 17 Aug 2012 22:35:25 +0000 (18:35 -0400)]
- [feature] To complement [ticket:2547], types
can now provide "bind expressions" and
"column expressions" which allow compile-time
injection of SQL expressions into statements
on a per-column or per-bind level. This is
to suit the use case of a type which needs
to augment bind- and result- behavior at the
SQL level, as opposed to in the Python level.
Allows for schemes like transparent encryption/
decryption, usage of Postgis functions, etc.
[ticket:1534]
- update postgis example fully.
- still need to repair the result map propagation
here to be transparent for cases like "labeled column".
Mike Bayer [Fri, 17 Aug 2012 02:20:53 +0000 (22:20 -0400)]
- modernize most of the postgis example. would like to do [ticket:1534] also.
- we don't have coverage for type-wide instrumentation events, the listener was broke.
could break again too.
Mike Bayer [Thu, 16 Aug 2012 20:11:42 +0000 (16:11 -0400)]
_adapt_expression() moves fully to _DefaultColumnComparator which resumes
its original role as stateful, forms the basis of TypeEngine.Comparator. lots
of code goes back mostly as it was just with cleaner typing behavior, such
as simple flow in _binary_operate now.
Mike Bayer [Thu, 16 Aug 2012 18:07:33 +0000 (14:07 -0400)]
-we move all the invocation of "_adapt_expression" into TypeEngine.Comparator. at this point
the split of operator stuff is getting awkward and we might want to move _DefaultComparator.
Mike Bayer [Thu, 16 Aug 2012 17:25:46 +0000 (13:25 -0400)]
- we're going to attempt to get the type/operator system to eat its own dogfood and
use the type-based comparator in all cases. will attempt to remove the _adapt_expression()
method entirely as this represents an incomplete and redundant system (though it might
be a lot faster)
Mike Bayer [Wed, 15 Aug 2012 22:42:59 +0000 (18:42 -0400)]
- [bug] Declarative can now propagate a column
declared on a single-table inheritance subclass
up to the parent class' table, when the parent
class is itself mapped to a join() or select()
statement, directly or via joined inheritane,
and not just a Table. [ticket:2549]
Mike Bayer [Tue, 14 Aug 2012 21:24:57 +0000 (17:24 -0400)]
- update all the visit_mod() functions with new naming scheme
- visit_mods all seemed to not propagate **kw down to process().
this is [ticket:2548] which may be backported to 0.7 pending
a test case to illustrate wrong behavior.
Mike Bayer [Tue, 14 Aug 2012 17:55:54 +0000 (13:55 -0400)]
- for the moment, the default comparisons don't need the ColumnOperator interface.
Still a little concerned about the "self.expr" vs. "expr passed in" thing.
Mike Bayer [Tue, 14 Aug 2012 17:47:58 +0000 (13:47 -0400)]
- fix concat() operator, tests
- [feature] Custom unary operators can now be
used by combining operators.custom_op() with
UnaryExpression().
- clean up the operator dispatch system and make it more consistent.
This does change the compiler contract for custom ops.
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]