Mike Bayer [Tue, 1 Apr 2008 03:16:47 +0000 (03:16 +0000)]
- removed redundant get_history() method
- the little bit at the bottom of _sort_circular_dependencies is absolutely covered by test/orm/cycles.py ! removing it breaks the test as run on PG.
Mike Bayer [Sun, 30 Mar 2008 23:30:31 +0000 (23:30 +0000)]
- reverted previous "strings instead of tuples" change due to more specific test results showing tuples faster
- changed cache decorator call on default_schema_name call to a connection.info specific one
Mike Bayer [Sun, 30 Mar 2008 21:48:19 +0000 (21:48 +0000)]
- schema-qualified tables now will place the schemaname
ahead of the tablename in all column expressions as well
as when generating column labels. This prevents cross-
schema name collisions in all cases [ticket:999]
- the "use_schema" argument to compiler.visit_column() is removed. It uses
schema in all cases now.
- added a new test to the PG dialect to test roundtrip insert/update/delete/select
statements with full schema qualification
Mike Bayer [Sun, 30 Mar 2008 16:03:23 +0000 (16:03 +0000)]
- rearranged LoaderStrategies a bit
- removed awareness of "dynamic" from attributes and replaced with "impl_class"
- moved DynaLoader into dynamic.py
- removed create_strategy() method from StrategizedProperty; they set up
'strategy_class' so that StrategizedProperty treats the default the same
as the optional loaders
Mike Bayer [Sat, 29 Mar 2008 14:41:41 +0000 (14:41 +0000)]
- declarative_base() takes optional kwarg "mapper", which
is any callable/class/method that produces a mapper,
such as declarative_base(mapper=scopedsession.mapper).
This property can also be set on individual declarative
classes using the "__mapper_cls__" property.
Mike Bayer [Sat, 29 Mar 2008 00:00:49 +0000 (00:00 +0000)]
- merged with_polymorphic branch, which was merged with query_columns branch
- removes everything to do with select_table, which remains as a keyword argument synonymous with
with_polymorphic=('*', select_table).
- all "polymorphic" selectables find their way to Query by way of _set_select_from() now, so that
all joins/aliasing/eager loads/etc. is handled consistently. Mapper has methods for producing
polymorphic selectables so that Query and eagerloaders alike can get to them.
- row aliasing simplified, so that they don't need to nest. they only need the source selectable
and adapt to whatever incoming columns they get.
- Query is more egalitarian about mappers/columns now. Still has a strong sense of "entity zero",
but also introduces new unpublished/experimental _values() method which sets up a columns-only query.
- Query.order_by() and Query.group_by() take *args now (also still take a list, will likely deprecate
in 0.5). May want to do this for select() as well.
- the existing "check for False discriminiator" "fix" was not working completely, added coverage
- orphan detection was broken when the target object was a subclass of the mapper with the orphaned
relation, fixed that too.
Mike Bayer [Fri, 28 Mar 2008 15:55:26 +0000 (15:55 +0000)]
- can now allow selects which correlate all FROM clauses
and have no FROM themselves. These are typically
used in a scalar context, i.e. SELECT x, (SELECT x WHERE y)
FROM table. Requires explicit correlate() call.
Mike Bayer [Sat, 22 Mar 2008 19:30:42 +0000 (19:30 +0000)]
- the "owner" keyword on Table is now deprecated, and is
exactly synonymous with the "schema" keyword. Tables
can now be reflected with alternate "owner" attributes,
explicitly stated on the Table object or not using
"schema".
- all of the "magic" searching for synonyms, DBLINKs etc.
during table reflection
are disabled by default unless you specify
"oracle_resolve_synonyms=True" on the Table object.
Resolving synonyms necessarily leads to some messy
guessing which we'd rather leave off by default.
When the flag is set, tables and related tables
will be resolved against synonyms in all cases, meaning
if a synonym exists for a particular table, reflection
will use it when reflecting related tables. This is
stickier behavior than before which is why it's
off by default.
Mike Bayer [Fri, 21 Mar 2008 17:21:41 +0000 (17:21 +0000)]
- made some fixes to the "from_joinpoint" argument to
query.join() so that if the previous join was aliased
and this one isn't, the join still happens successfully.
Mike Bayer [Fri, 21 Mar 2008 16:43:51 +0000 (16:43 +0000)]
- adjusted the definition of "self-referential" to be
any two mappers with a common parent (this affects
whether or not aliased=True is required when joining
with Query).
Mike Bayer [Wed, 19 Mar 2008 19:35:42 +0000 (19:35 +0000)]
- like() and ilike() take an optional keyword argument
"escape=<somestring>", which is set as the escape character
using the syntax "x LIKE y ESCAPE '<somestring>'"
[ticket:993]
Mike Bayer [Tue, 18 Mar 2008 20:59:52 +0000 (20:59 +0000)]
- fixed/added coverage for various cascade scenarios
- added coverage for some extra cases in dynamic relations
- removed some unused methods from unitofwork
Mike Bayer [Tue, 18 Mar 2008 17:42:07 +0000 (17:42 +0000)]
- added support for declarative deferred(Column(...))
- changed "instrument" argument on synonym() to "descriptor", for consistency with comparable_proeprty()
Jason Kirtland [Mon, 17 Mar 2008 22:06:49 +0000 (22:06 +0000)]
- Added comparable_property(), adds query Comparator behavior to regular, unmanaged Python properties
- Some aspects of MapperProperty initialization are streteched pretty thin now
and need a refactor; will proceed with these on the user_defined_state branch
Mike Bayer [Sun, 16 Mar 2008 23:49:55 +0000 (23:49 +0000)]
- fixed "cascade delete" operation of dynamic relations,
which had only been implemented for foreign-key nulling
behavior in 0.4.2 and not actual cascading deletes
[ticket:895]
Mike Bayer [Sat, 15 Mar 2008 20:18:54 +0000 (20:18 +0000)]
- the "synonym" function is now directly usable with
"declarative". Pass in the decorated property using
the "instrument" keyword argument, e.g.:
somekey = synonym('_somekey', instrument=property(g, s))
- declared_synonym deprecated
Mike Bayer [Mon, 10 Mar 2008 17:14:08 +0000 (17:14 +0000)]
- a new super-small "declarative" extension has been added,
which allows Table and mapper() configuration to take place
inline underneath a class declaration. This extension differs
from ActiveMapper and Elixir in that it does not redefine
any SQLAlchemy semantics at all; literal Column, Table
and relation() constructs are used to define the class
behavior and table definition.
Mike Bayer [Mon, 10 Mar 2008 00:59:51 +0000 (00:59 +0000)]
- relation() can accept a callable for its first argument,
which returns the class to be related. This is in place
to assist declarative packages to define relations without
classes yet being in place.
Mike Bayer [Fri, 7 Mar 2008 03:16:46 +0000 (03:16 +0000)]
- moved property._is_self_referential() to be more generalized; returns True for any mapper.isa() relationship between parent and child, and indicates that aliasing should be used for any join/correlation across the relation. allows joins/any()/has() to work with inherited mappers referencing the parent etc.
- the original _is_self_referential() is now _refers_to_parent_table() and is only used during "direction" calculation to indicate the relation is from a single table to itself
Mike Bayer [Thu, 6 Mar 2008 18:44:45 +0000 (18:44 +0000)]
- added assert_raises() to TestBase class
- session.refresh() and session.expire() raise an error when
called on instances which are not persistent within the session
- session._validate_persistent() properly raises an error for false check
Mike Bayer [Thu, 6 Mar 2008 16:53:40 +0000 (16:53 +0000)]
- adjusted generative.py test for revised error message
- mapper with non_primary asserts primary mapper already created
- added any()/instance compare test to query