Mike Bayer [Fri, 14 Apr 2006 18:11:54 +0000 (18:11 +0000)]
had to take out the "treeification" of the dependency sort as it doenst really work , added test conditions to the dependency test + the original test that failed
Mike Bayer [Thu, 6 Apr 2006 23:46:02 +0000 (23:46 +0000)]
split up Session into Session/LegacySession, added some new constructor args
created AbstractEngine class which provides base for SQLEngine and will also
provide base for ConnectionProxy, so SQL binding can be to an engine or specific
connection resource
ClauseElements get using() method which can take AbstractEngines for execution
made more separation between SchemaItems and bound engine
Mike Bayer [Thu, 6 Apr 2006 21:12:00 +0000 (21:12 +0000)]
mapper's querying facilities migrated to new query.Query() object, which can receive session-specific context via the mapper.using() statement. reuslting object instances will be bound to this session, but query execution still handled by the SQLEngines implicit in the mapper's Table objects.
session now propigates to the unitofwork UOWTransaction object, as well as mapper's save_obj/delete_obj via the UOWTransaction it receives. UOWTransaction explicitly calls the Session for the engine corresponding to each Mapper in the flush operation, although the Session does not yet affect the choice of engines used, and mapper save/delete is still using the Table's implicit SQLEngine.
changed internal unitofwork commit() method to be called flush().
removed all references to 'engine' from mapper module, including adding insert/update specific SQLEngine methods such as last_inserted_ids, last_inserted_params, etc. to the returned ResultProxy so that Mapper need not know which SQLEngine was used for the execute.
changes to unit tests, SelectResults to support the new Query object.
Mike Bayer [Thu, 6 Apr 2006 19:01:14 +0000 (19:01 +0000)]
added explicit "session" argument to get(), select_whereclause in mapper, as well as throughout the call-chain for those. lazy loader honors the "session" of the parent object, + added simple unit test
Mike Bayer [Mon, 3 Apr 2006 21:43:22 +0000 (21:43 +0000)]
added 'entity_name' keyword argument to mapper. a mapper is now associated with a class via
the class object as well as the optional entity_name parameter, which is a string defaulting to None.
any number of primary mappers can be created for a class, qualified by the entity name. instances of those classes
will issue all of their load and save operations through their entity_name-qualified mapper, and maintain separate identity from an otherwise equilvalent object.
Mike Bayer [Mon, 3 Apr 2006 21:04:16 +0000 (21:04 +0000)]
attributes overhaul #2 - attribute manager now tracks class-level initializers strictly through the SmartPropery instances attached to the class, so that attributes retain their natural polymorphic behavior. naming conventions migrating to "managed_attribute", simplifying codepaths.
Mike Bayer [Mon, 3 Apr 2006 05:00:53 +0000 (05:00 +0000)]
made order_by/group_by construction a little more simplisitc
fix to mapper extension
CompoundSelect can export all columns now, not sure if theres any advantage there
Mike Bayer [Sat, 1 Apr 2006 21:00:41 +0000 (21:00 +0000)]
cleanup of attributes, better naming, added weak reference to base managed attribute to break circular refs, slightly shorter codepaths in some cases. added performance tester
Mike Bayer [Fri, 31 Mar 2006 23:43:20 +0000 (23:43 +0000)]
added unit test for the old commit that was in [changeset:1186]. modified its behavior a bit to not delete private relationships unless they were already marked as deleted at the attribute manipulation level. got "switching" behavior from one private relationship to another to work, added a unit test for that.
Mike Bayer [Fri, 31 Mar 2006 02:25:59 +0000 (02:25 +0000)]
Jonas Borgström's fantastic SelectRsults patch that adds dynamic list argument support to the mapper.select() methd. associated unit test tweaks and mapper integration.
Mike Bayer [Mon, 27 Mar 2006 02:02:06 +0000 (02:02 +0000)]
backrefs on cyclical relationships were breaking for the "root" node which had None for a parent, due to addition in [changeset:1186] which added a "deletion" traversal for many-to-one relationships. added unittest.
Mike Bayer [Sun, 26 Mar 2006 23:51:13 +0000 (23:51 +0000)]
added always_refresh flag. when the mapper loads rows, it will pull objects from the identity map normally, but always blows away their attributes and replaces with those from the database, including changes
Mike Bayer [Sun, 26 Mar 2006 21:44:22 +0000 (21:44 +0000)]
rework to expire() to make it smarter. when you expire(), history is immediately removed as well as explicit from dirty/deleted lists. this also changes uow.rollback_object() to remove from those lists, which is strange that it didnt do that before. anyway the mapper, when selecting and creating instances, asks the uow if this already identity-mapped instance is expired, and if so refreshes it on the fly, saving the need for the re-_get() operation, if some other query happens to touch upon the expired object. unit test added to confirm this.
Mike Bayer [Sun, 26 Mar 2006 06:26:02 +0000 (06:26 +0000)]
util: the __setitem__ method on historyarraylist was meaningless, surprising nobody noticed that.
types: added PickleType, its slightly trickier than trivial, so OK now its standard.
attributes: the level of pain if an AttributeError occurs inside a CallableProp, in combination with an object that implements __getattr__, is too deep for me to put the users through....so convert AttributeErrors to Assertions...
engine: im not a fan of catching universal exceptions and squashing them
Mike Bayer [Sat, 25 Mar 2006 21:44:42 +0000 (21:44 +0000)]
removed circular loop in creating new list elements, fixes a common refresh() condition
added None check in PropertyLoader many-to-one private deletion traversal, fixes byroot_tree (add a unit test for that)
Mike Bayer [Sat, 25 Mar 2006 21:14:54 +0000 (21:14 +0000)]
removed all "tablename + '_' + columname" code and replaced with column._label, to take
advantage of column labeling rules
bind param compilation,when it unique-ifys the name of bind params, maintains the length
of the bind parameter name instead of appending to it
Mike Bayer [Sat, 25 Mar 2006 00:17:51 +0000 (00:17 +0000)]
added expunge() method to objectstore
correction in attributes reset_history to really reset in all cases
added unit tests testing refresh()/expire() bug that was fixed by reset_history thing