Mike Bayer [Fri, 24 Aug 2012 22:48:42 +0000 (18:48 -0400)]
- [feature] Added support for .info dictionary argument to
column_property(), relationship(), composite().
All MapperProperty classes have an auto-creating .info
dict available overall.
Mike Bayer [Thu, 23 Aug 2012 19:40:09 +0000 (15:40 -0400)]
- [feature] The before_cursor_execute event
fires off for so-called "_cursor_execute"
events, which are usually special-case
executions of primary-key bound sequences
and default-generation SQL
phrases that invoke separately when RETURNING
is not used with INSERT. [ticket:2459]
Mike Bayer [Wed, 22 Aug 2012 22:55:59 +0000 (18:55 -0400)]
- [bug] Fixed bug whereby usage of a UNION
or similar inside of an embedded subquery
would interfere with result-column targeting,
in the case that a result-column had the same
ultimate name as a name inside the embedded
UNION. [ticket:2552]
Mike Bayer [Wed, 22 Aug 2012 22:41:46 +0000 (18:41 -0400)]
- [bug] Fixed cextension bug whereby the
"ambiguous column error" would fail to
function properly if the given index were
a Column object and not a string.
Note there are still some column-targeting
issues here which are fixed in 0.8.
[ticket:2553]
- find more cases where column targeting is being inaccurate, add
more information to result_map to better differentiate "ambiguous"
results from "present" or "not present". In particular, result_map
is sensitive to dupes, even though no error is raised; the conflicting
columns are added to the "obj" member of the tuple so that the two
are both directly accessible in the result proxy
- handwringing over the damn "name fallback" thing in results. can't
really make it perfect yet
- fix up oracle returning clause. not sure why its guarding against
labels, remove that for now and see what the bot says.
Mike Bayer [Wed, 22 Aug 2012 17:54:13 +0000 (13:54 -0400)]
- [feature] Enhanced GenericFunction and func.*
to allow for user-defined GenericFunction
subclasses to be available via the func.*
namespace automatically by classname,
optionally using a package name as well.
Mike Bayer [Mon, 20 Aug 2012 22:18:17 +0000 (18:18 -0400)]
- [feature] The Query.update() method is now
more lenient as to the table
being updated. Plain Table objects are better
supported now, and additional a joined-inheritance
subclass may be used with update(); the subclass
table will be the target of the update,
and if the parent table is referenced in the
WHERE clause, the compiler will call upon
UPDATE..FROM syntax as allowed by the dialect
to satisfy the WHERE clause. Target columns
must still be in the target table i.e.
does not support MySQL's multi-table update
feature (even though this is in Core).
PG's DELETE..USING is also not available
in Core yet.
Mike Bayer [Mon, 20 Aug 2012 21:04:25 +0000 (17:04 -0400)]
- [feature] The Core oeprator system now includes
the `getitem` operator, i.e. the bracket
operator in Python. This is used at first
to provide index and slice behavior to the
Postgresql ARRAY type, and also provides a hook
for end-user definition of custom __getitem__
schemes which can be applied at the type
level as well as within ORM-level custom
operator schemes.
Note that this change has the effect that
descriptor-based __getitem__ schemes used by
the ORM in conjunction with synonym() or other
"descriptor-wrapped" schemes will need
to start using a custom comparator in order
to maintain this behavior.
- [feature] postgresql.ARRAY now supports
indexing and slicing. The Python [] operator
is available on all SQL expressions that are
of type ARRAY; integer or simple slices can be
passed. The slices can also be used on the
assignment side in the SET clause of an UPDATE
statement by passing them into Update.values();
see the docs for examples.
- [feature] Added new "array literal" construct
postgresql.array(). Basically a "tuple" that
renders as ARRAY[1,2,3].
Mike Bayer [Mon, 20 Aug 2012 17:20:09 +0000 (13:20 -0400)]
- [bug] Fixes to the interpretation of the
Column "default" parameter as a callable
to not pass ExecutionContext into a keyword
argument parameter. [ticket:2520]
Mike Bayer [Mon, 20 Aug 2012 01:15:40 +0000 (21:15 -0400)]
- [feature] The prefix_with() method is now available
on each of select(), insert(), update(), delete(),
all with the same API, accepting multiple
prefix calls, as well as a "dialect name" so that
the prefix can be limited to one kind of dialect.
[ticket:2431]
Mike Bayer [Sun, 19 Aug 2012 16:35:39 +0000 (12:35 -0400)]
- [bug] Lazy loads emitted within flush events
such as before_flush(), before_update(),
etc. will now function as they would
within non-event code, regarding consideration
of the PK/FK values used in the lazy-emitted
query. Previously,
special flags would be established that
would cause lazy loads to load related items
based on the "previous" value of the
parent PK/FK values specifically when called
upon within a flush; the signal to load
in this way is now localized to where the
unit of work actually needs to load that
way. Note that the UOW does
sometimes load these collections before
the before_update() event is called,
so the usage of "passive_updates" or not
can affect whether or not a collection will
represent the "old" or "new" data, when
accessed within a flush event, based
on when the lazy load was emitted.
The change is backwards incompatible in
the exceedingly small chance that
user event code depended on the old
behavior. [ticket:2350]
Mike Bayer [Sat, 18 Aug 2012 04:54:00 +0000 (00:54 -0400)]
- fix the labeled column with column_expression() issue, finishes [ticket:1534]
- epic documentation sweep for new operator system, making ORM links consistent
and complete, full documentation and examples for type/SQL expression feature
- type_coerce() explicitly accepts BindParamClause objects
- change UserDefinedType to coerce the other side to itself by default as this
is much more likely what's desired
- make coerce_compared_type() fully public on all types
- have profiling run the test no matter what so that the test_zoomarks don't fail
when callcounts are missing
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.