Mike Bayer [Fri, 2 May 2008 01:02:23 +0000 (01:02 +0000)]
- factored out the logic used by Join to create its join condition
- With declarative, joined table inheritance mappers use a slightly relaxed
function to create the "inherit condition" to the parent
table, so that other foreign keys to not-yet-declared
Table objects don't trigger an error.
Mike Bayer [Wed, 30 Apr 2008 01:16:05 +0000 (01:16 +0000)]
- added a feature to eager loading whereby subqueries set
as column_property() with explicit label names (which is not
necessary, btw) will have the label anonymized when
the instance is part of the eager join, to prevent
conflicts with a subquery or column of the same name
on the parent object. [ticket:1019]
Mike Bayer [Sat, 26 Apr 2008 16:34:14 +0000 (16:34 +0000)]
- improved behavior of text() expressions when used as
FROM clauses, such as select().select_from(text("sometext"))
[ticket:1014]
- removed _TextFromClause; _TextClause just adds necessary FromClause descriptors
at the class level
Mike Bayer [Fri, 18 Apr 2008 14:49:21 +0000 (14:49 +0000)]
- restored usage of append_result() extension method for primary
query rows, when the extension is present and only a single-
entity result is being returned.
Mike Bayer [Mon, 14 Apr 2008 18:23:59 +0000 (18:23 +0000)]
- simplified __create_lazy_clause to make better usage of the new local/remote pairs collection
- corrected the direction of local/remote pairs for manytoone
- added new tests which demonstrate lazyloading working when the bind param is embedded inside of a SQL function,
when _local_remote_pairs argument is used; fixes the viewonly version of [ticket:610]
- removed needless kwargs check from visitors.traverse
Mike Bayer [Mon, 14 Apr 2008 15:49:39 +0000 (15:49 +0000)]
- added experimental relation() flag to help with primaryjoins
across functions, etc., _local_remote_pairs=[tuples].
This complements a complex primaryjoin condition allowing
you to provide the individual column pairs which comprise
the relation's local and remote sides.
Rick Morrison [Tue, 8 Apr 2008 19:09:33 +0000 (19:09 +0000)]
Add a new 'odbc_autotranslate' engine/dburi kwd parm to the MSSQL pyodbc dialect; string kwd contents will be passed through to ODBC connection string.
[ticket:1005]
Mike Bayer [Mon, 7 Apr 2008 19:49:41 +0000 (19:49 +0000)]
- removed ancient assertion that mapped selectables require
"alias names" - the mapper creates its own alias now if
none is present. Though in this case you need to use
the class, not the mapped selectable, as the source of
column attributes - so a warning is still issued.
Mike Bayer [Mon, 7 Apr 2008 01:12:44 +0000 (01:12 +0000)]
- merged -r4458:4466 of query_columns branch
- this branch changes query.values() to immediately return an iterator, adds a new "aliased" construct which will be the primary method to get at aliased columns when using values()
- tentative ORM versions of _join and _outerjoin are not yet public, would like to integrate with Query better (work continues in the branch)
- lots of fixes to expressions regarding cloning and correlation. Some apparent ORM bug-workarounds removed.
- to fix a recursion issue with anonymous identifiers, bind parameters generated against columns now just use the name of the column instead of the tablename_columnname label (plus the unique integer counter). this way expensive recursive schemes aren't needed for the anon identifier logic. This, as usual, impacted a ton of compiler unit tests which needed a search-n-replace for the new bind names.
Mike Bayer [Fri, 4 Apr 2008 18:41:08 +0000 (18:41 +0000)]
factored down exportable_columns/flatten_cols/proxy_column/oid_etc_yada down to a single, streamlined "_populate_column_collection" method called for all selectables
Mike Bayer [Fri, 4 Apr 2008 00:21:28 +0000 (00:21 +0000)]
- merged sync_simplify branch
- The methodology behind "primaryjoin"/"secondaryjoin" has
been refactored. Behavior should be slightly more
intelligent, primarily in terms of error messages which
have been pared down to be more readable. In a slight
number of scenarios it can better resolve the correct
foreign key than before.
- moved collections unit test from relationships.py to collection.py
- PropertyLoader now has "synchronize_pairs" and "equated_pairs"
collections which allow easy access to the source/destination
parent/child relation between columns (might change names)
- factored out ClauseSynchronizer (finally)
- added many more tests for priamryjoin/secondaryjoin
error checks
Jason Kirtland [Thu, 3 Apr 2008 17:08:08 +0000 (17:08 +0000)]
- Experimental: prefer cProfile over hotspot for 2.5+
- The latest skirmish in the battle against zoomark and sanity:
3rd party code is factored out in the function call count canary tests
Mike Bayer [Thu, 3 Apr 2008 16:34:03 +0000 (16:34 +0000)]
- case() interprets the "THEN" expressions
as values by default, meaning case([(x==y, "foo")]) will
interpret "foo" as a bound value, not a SQL expression.
use text(expr) for literal SQL expressions in this case.
For the criterion itself, these may be literal strings
only if the "value" keyword is present, otherwise SA
will force explicit usage of either text() or literal().
Ants Aasma [Thu, 3 Apr 2008 14:08:22 +0000 (14:08 +0000)]
The case() function now also takes a dictionary as its whens parameter. But beware that it doesn't escape literals, use the literal construct for that.
Mike Bayer [Thu, 3 Apr 2008 13:12:42 +0000 (13:12 +0000)]
- Added some convenience descriptors to Query:
query.statement returns the full SELECT construct,
query.whereclause returns just the WHERE part of the
SELECT construct.
Mike Bayer [Wed, 2 Apr 2008 22:33:50 +0000 (22:33 +0000)]
- Got PG server side cursors back into shape, added fixed
unit tests as part of the default test suite. Added
better uniqueness to the cursor ID [ticket:1001]
- update().values() and insert().values() take keyword
arguments.
Jason Kirtland [Wed, 2 Apr 2008 11:39:26 +0000 (11:39 +0000)]
- Revamped the Connection memoize decorator a bit, moved to engine
- MySQL character set caching is more aggressive but will invalidate the cache if a SET is issued.
- MySQL connection memos are namespaced: info[('mysql', 'server_variable')]
Mike Bayer [Tue, 1 Apr 2008 17:13:09 +0000 (17:13 +0000)]
- merge() may actually work now, though we've heard that before...
- merge() uses the priamry key attributes on the object if _instance_key not present. so merging works for instances that dont have an instnace_key, will still issue UPDATE for existing rows.
- improved collection behavior for merge() - will remove elements from a destination collection that are not in the source.
- fixed naive set-mutation issue in Select._get_display_froms
- simplified fixtures.Base a bit
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.