diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-08 18:58:03 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-08 18:58:03 +0000 |
commit | 8693d4b2876e9239cf48bbc42a7ffaa11c01b506 (patch) | |
tree | 6438a7f4a319c4e1f25376fb004de6fb73bfd7c0 /lib/sqlalchemy/engine/base.py | |
parent | 78bb82a44b7f382c6cfeab0cfc7f932e68c4de86 (diff) | |
download | sqlalchemy-8693d4b2876e9239cf48bbc42a7ffaa11c01b506.tar.gz |
- flush() refactor merged from uow_nontree branch r3871-r3885
- topological.py cleaned up, presents three public facing functions which
return list/tuple based structures, without exposing any internals. only
the third function returns the "hierarchical" structure. when results
include "cycles" or "child" items, 2- or 3- tuples are used to represent
results.
- unitofwork uses InstanceState almost exclusively now. new and deleted lists
are now dicts which ref the actual object to provide a strong ref for the
duration that they're in those lists. IdentitySet is only used for the public
facing versions of "new" and "deleted".
- unitofwork topological sort no longer uses the "hierarchical" version of the sort
for the base sort, only for the "per-object" secondary sort where it still
helps to group non-dependent operations together and provides expected insert
order. the default sort deals with UOWTasks in a straight list and is greatly
simplified. Tests all pass but need to see if svilen's stuff still works,
one block of code in _sort_cyclical_dependencies() seems to not be needed anywhere
but i definitely put it there for a reason at some point; if not hopefully we
can derive more test coverage from that.
- the UOWEventHandler is only applied to object-storing attributes, not
scalar (i.e. column-based) ones. cuts out a ton of overhead when setting
non-object based attributes.
- InstanceState also used throughout the flush process, i.e. dependency.py,
mapper.save_obj()/delete_obj(), sync.execute() all expect InstanceState objects
in most cases now.
- mapper/property cascade_iterator() takes InstanceState as its argument,
but still returns lists of object instances so that they are not dereferenced.
- a few tricks needed when dealing with InstanceState, i.e. when loading a list
of items that are possibly fresh from the DB, you *have* to get the actual objects
into a strong-referencing datastructure else they fall out of scope immediately.
dependency.py caches lists of dependent objects which it loads now (i.e. history
collections).
- AttributeHistory is gone, replaced by a function that returns a 3-tuple of
added, unchanged, deleted. these collections still reference the object
instances directly for the strong-referencing reasons mentiontioned, but
it uses less IdentitySet logic to generate.
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 45e4c036f..259909d47 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -320,6 +320,10 @@ class ExecutionContext(object): returns_rows True if the statement should return result rows + + postfetch_cols + a list of Column objects for which a server-side default + or inline SQL expression value was fired off. applies to inserts and updates. The Dialect should provide an ExecutionContext via the create_execution_context() method. The `pre_exec` and `post_exec` @@ -414,11 +418,6 @@ class ExecutionContext(object): raise NotImplementedError() - def postfetch_cols(self): - """return a list of Column objects for which a 'passive' server-side default - value was fired off. applies to inserts and updates.""" - - raise NotImplementedError() class Compiled(object): """Represent a compiled SQL expression. @@ -1481,7 +1480,7 @@ class ResultProxy(object): See ExecutionContext for details. """ - return self.context.postfetch_cols() + return self.context.postfetch_cols def supports_sane_rowcount(self): """Return ``supports_sane_rowcount`` from the dialect. |