Mike Bayer [Mon, 5 Nov 2007 00:59:19 +0000 (00:59 +0000)]
- rewrote and simplified the system used to "target" columns across
selectable expressions. On the SQL side this is represented by the
"corresponding_column()" method. This method is used heavily by the ORM
to "adapt" elements of an expression to similar, aliased expressions,
as well as to target result set columns originally bound to a
table or selectable to an aliased, "corresponding" expression. The new
rewrite features completely consistent and accurate behavior.
- the "orig_set" and "distance" elements as well as all associated
fanfare are gone (hooray !)
- columns now have an optional "proxies" list which is a list of all
columns they are a "proxy" for; only CompoundSelect cols proxy more than one column
(just like before). set operations are used to determine lineage.
- CompoundSelects (i.e. unions) only create one public-facing proxy column per
column name. primary key collections come out with just one column per embedded
PK column.
- made the alias used by eager load limited subquery anonymous.
Mike Bayer [Sat, 3 Nov 2007 23:17:34 +0000 (23:17 +0000)]
- eager loading with LIMIT/OFFSET applied no longer adds the primary
table joined to a limited subquery of itself; the eager loads now
join directly to the subquery which also provides the primary table's
columns to the result set. This eliminates a JOIN from all eager loads
with LIMIT/OFFSET. [ticket:843]
Mike Bayer [Sat, 3 Nov 2007 22:13:17 +0000 (22:13 +0000)]
- rewritten ClauseAdapter merged from the eager_minus_join branch; this is a much simpler
and "correct" version which will copy all elements exactly once, except for those which were
replaced with target elements. It also can match a wider variety of target elements including
joins and selects on identity alone.
Mike Bayer [Sat, 3 Nov 2007 20:12:59 +0000 (20:12 +0000)]
- removed "name" attribute from FromClause, Join, Select, CompoundSelect. its needless
and led to some very strange anonymous label names
- removed what was apparently cruft in some column-targeting code
Mike Bayer [Fri, 2 Nov 2007 17:58:20 +0000 (17:58 +0000)]
- merge() includes a keyword argument "dont_load=True". setting this flag will cause
the merge operation to not load any data from the database in response to incoming
detached objects, and will accept the incoming detached object as though it were
already present in that session. Use this to merge detached objects from external
caching systems into the session.
Mike Bayer [Thu, 1 Nov 2007 20:12:36 +0000 (20:12 +0000)]
- session checks more carefully when determining "object X already in another session";
e.g. if you pickle a series of objects and unpickle (i.e. as in a Pylons HTTP session
or similar), they can go into a new session without any conflict
- added stricter checks around session.delete() similar to update()
- shored up some old "validate" stuff in session/uow
Mike Bayer [Thu, 1 Nov 2007 03:58:21 +0000 (03:58 +0000)]
- merged factor_down_bindparams branch.
- removed ClauseParameters object; compiled.params returns a regular dictionary
now, as well as result.last_inserted_params()/last_updated_params().
- various code trimming, method removals.
Mike Bayer [Wed, 31 Oct 2007 19:11:22 +0000 (19:11 +0000)]
- split ScalarInstrumentedAttribute into a "scalar" and an "object" version.
The "object" version loads the existing value on set/del, fires events,
and handles trackparent operations; the "scalar" version does not.
- column loaders now use the "scalar" version of InstrumentedAttribute, so that
event handlers etc. don't fire off for regular column attribute operations.
- some adjustments to AttributeHistory to work properly for non-loaded attributes
- deferred column attributes no longer trigger a load operation when the
attribute is assigned to. in those cases, the newly assigned
value will be present in the flushes' UPDATE statement unconditionally.
Ants Aasma [Wed, 31 Oct 2007 16:30:06 +0000 (16:30 +0000)]
- also added proxying of save_or_update to scoped sessions.
- session.update() raises an error when updating an instance that is already in the session with a different identity
- adjusted zoomarks lower limits so I can get a nice clean run
Mike Bayer [Tue, 30 Oct 2007 18:04:00 +0000 (18:04 +0000)]
- fix to "row switch" behavior, i.e. when an INSERT/DELETE is combined into a
single UPDATE; many-to-many relations on the parent object update properly.
[ticket:841]
- it's an error to session.save() an object which is already persistent
[ticket:840]
- changed a bunch of repr(obj) calls in session.py exceptions to use mapperutil.instance_str()
Mike Bayer [Sun, 28 Oct 2007 21:28:53 +0000 (21:28 +0000)]
- fixed INSERT statements w.r.t. primary key columns that have SQL-expression
based default generators on them; SQL expression executes inline as normal
but will not trigger a "postfetch" condition for the column, for those DB's
who provide it via cursor.lastrowid
Mike Bayer [Sun, 28 Oct 2007 01:51:43 +0000 (01:51 +0000)]
- merged path_based_options branch
- behavior of query.options() is now fully based on paths, i.e. an option
such as eagerload_all('x.y.z.y.x') will apply eagerloading to only
those paths, i.e. and not 'x.y.x'; eagerload('children.children') applies
only to exactly two-levels deep, etc. [ticket:777]
- removes old compiler()/schemagenerator()/schemadropper() methods from mysql dialect
Mike Bayer [Sat, 27 Oct 2007 18:45:20 +0000 (18:45 +0000)]
- inlined a couple of context variables
- PG two phase was calling text() without the correct bind param format, previous compiler checkin revealed issue
Mike Bayer [Sat, 27 Oct 2007 17:41:30 +0000 (17:41 +0000)]
- removed regular expression step from most statement compilations.
also fixes [ticket:833]
- inlining on PG with_returning() call
- extra options added for profiling
Mike Bayer [Thu, 25 Oct 2007 16:57:04 +0000 (16:57 +0000)]
- refactored _compile_properties/_compile_property, removed redundant code.
still a little squirrely but much less complex.
- improved behavior of add_property() etc., fixed [ticket:831] involving
synonym/deferred
Mike Bayer [Sun, 21 Oct 2007 16:36:34 +0000 (16:36 +0000)]
- the whole OperationContext/QueryContext/SelectionContext thing greatly scaled back;
all MapperOptions process the Query and that's it, one very simpliied QueryContext object gets passed
around at query.compile() and query.instances() time
- slight optimization to MapperExtension allowing the mapper to check for the presence of an extended method, takes 3000 calls off of masseagerload.py test (only a slight increase in speed though)
- attempting to centralize the notion of a "path" along mappers/properties, need to define what that is better. heading towards [ticket:777]...
Jason Kirtland [Sat, 20 Oct 2007 17:14:46 +0000 (17:14 +0000)]
Excluding older sqlite versions from the new insert tests. Currently conservative- 2.8 definitely fails, 3.3 works. The 3.0 and 3.1 binaries from sqlite.org segfault for me so the version check should be revisited when possible.
Mike Bayer [Wed, 17 Oct 2007 16:49:15 +0000 (16:49 +0000)]
- removed __len__ from "dynamic" collection as it would require issuing
a SQL "count()" operation, thus forcing all list evaluations to issue
redundant SQL [ticket:818]
Mike Bayer [Tue, 16 Oct 2007 16:03:59 +0000 (16:03 +0000)]
- Fixed SQL compiler's awareness of top-level column labels as used
in result-set processing; nested selects which contain the same column
names don't affect the result or conflict with result-column metadata.
- query.get() and related functions (like many-to-one lazyloading)
use compile-time-aliased bind parameter names, to prevent
name conflicts with bind parameters that already exist in the
mapped selectable.
Mike Bayer [Sun, 14 Oct 2007 19:15:09 +0000 (19:15 +0000)]
- PG reflection, upon seeing the default schema name being used explicitly
as the "schema" argument in a Table, will assume that this is the the
user's desired convention, and will explicitly set the "schema" argument
in foreign-key-related reflected tables, thus making them match only
with Table constructors that also use the explicit "schema" argument
(even though its the default schema).
In other words, SA assumes the user is being consistent in this usage.
Mike Bayer [Sun, 14 Oct 2007 16:56:32 +0000 (16:56 +0000)]
- attempted to add a test for #622 / #751, but cant reproduce the failing condition
- fixed major oracle bug introduced by r3561, since colnames come back as unicode now,
need to encode keys in setinputsizes() step