summaryrefslogtreecommitdiff
path: root/test/mapper.py
Commit message (Collapse)AuthorAgeFilesLines
* reorganized unit tests into subdirectoriesMike Bayer2006-06-051-952/+0
|
* - got rudimental "mapping to multiple tables" functionality cleaned up,Mike Bayer2006-06-021-1/+2
| | | | more correctly documented
* fixes half of [ticket:192], query.load()/get() with a unicode argument was ↵Mike Bayer2006-06-011-0/+16
| | | | failing to apply type conversion to the bind parameter
* brad clement's 0.2 firebird support !Mike Bayer2006-06-011-0/+2
|
* merged 0.2 branch into trunk; 0.1 now in sqlalchemy/branches/rel_0_1Mike Bayer2006-05-251-179/+274
|
* added unittest to verify eager loads refresh expired instancesMike Bayer2006-04-261-0/+14
|
* mapper's querying facilities migrated to new query.Query() object, which can ↵Mike Bayer2006-04-061-1/+1
| | | | | | | | | 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.
* added explicit "session" argument to get(), select_whereclause in mapper, as ↵Mike Bayer2006-04-061-0/+7
| | | | well as throughout the call-chain for those. lazy loader honors the "session" of the parent object, + added simple unit test
* attributes overhaul #2 - attribute manager now tracks class-level ↵Mike Bayer2006-04-031-1/+4
| | | | 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.
* fixed reset_history method when applied to an attribute that had an ↵Mike Bayer2006-04-021-0/+9
| | | | attribute-level TriggeredAttribute set on it, added unit test.
* introducing...the mods package ! the SelectResults thing moves as the first modMike Bayer2006-03-311-9/+9
|
* Jonas Borgström's fantastic SelectRsults patch that adds dynamic list ↵Mike Bayer2006-03-311-9/+9
| | | | argument support to the mapper.select() methd. associated unit test tweaks and mapper integration.
* rework to expire() to make it smarter. when you expire(), history is ↵Mike Bayer2006-03-261-5/+27
| | | | 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.
* removed circular loop in creating new list elements, fixes a common ↵Mike Bayer2006-03-251-0/+21
| | | | | | refresh() condition added None check in PropertyLoader many-to-one private deletion traversal, fixes byroot_tree (add a unit test for that)
* added expunge() method to objectstoreMike Bayer2006-03-251-1/+11
| | | | | 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
* refactor to Compiled.get_params() to return new ClauseParameters object, a ↵Mike Bayer2006-03-131-1/+1
| | | | | | | | | | | more intelligent bind parameter dictionary that does type conversions late and preserves the unconverted value; used to fix mappers not comparing correct value in post-fetch [ticket:110] removed pre_exec assertion from oracle/firebird regarding "check for sequence/primary key value" fix to Unicode type to check for null, fixes [ticket:109] create_engine() now uses genericized parameters; host/hostname, db/dbname/database, password/passwd, etc. for all engine connections fix to select([func(column)]) so that it creates a FROM clause to the column's table, fixes [ticket:111] doc updates for column defaults, indexes, connection pooling, engine params unit tests for the above bugfixes
* added expire() function + unit test fixes [ticket:95]Mike Bayer2006-03-101-0/+25
|
* adjustment to compile synchronizers which allows many-to-many synchronize to ↵Mike Bayer2006-02-261-0/+23
| | | | work even when one side of the relation has both tables in it (new unittest will be added to inheritance.py to show this...)
* merged eager loading overhaul rev 1001:1009Mike Bayer2006-02-201-3/+4
| | | | | | | | | | | | | | | | | this includes: sql.Alias object keeps track of the immediate thing it aliased as well as the ultimate non-aliased (usually a Table) object, so that proxied columns can have a "parent" attribute some cleanup to SelectBaseMixin.order_by_clause to allow easier access, needs more cleanup engine has been making two ResultProxies all this time, added "return_raw" quickie flag to disable that some cleanup to _get_col_by_original so that it also works for oid columns, new eager load stuff more aggressively aliaseses orderby's so this was needed EagerLoader now makes "chains" of unique aliased eager loaders in all cases. no need for use_alias/selectalias anymore since it aliases every time. properly detects recursive eager loads and terminates them with a lazyloader, instead of raising an exception. totally simplified setup() and init() is more straightforward and has a single codepath now instead of two or three.
* some comments, changed SmartProperty to be smarter, UOWMike Bayer2006-02-191-0/+7
| | | | | version has "property" accessor which returns MapperProperty at the class level
* exception package added, support throughoutMike Bayer2006-02-191-3/+3
|
* somewhat of an overhaul, got alltests to work againMike Bayer2006-02-091-3/+3
|
* deprecated relation(class, table)Mike Bayer2006-02-021-40/+40
| | | | changed unit tests/examples to not do it
* tests mapper column/property checkMike Bayer2006-01-131-0/+21
|
* added count func to mapperMike Bayer2006-01-081-1/+7
|
* small adjust after mapper/sql overhaulMike Bayer2006-01-081-1/+1
|
* broke apart deafult ordering into oid or primary key. a DB that has no oids ↵Mike Bayer2006-01-021-4/+4
| | | | will have a None oid_column attribute.
* rowid->oidMike Bayer2006-01-021-4/+4
|
* rowid_column becomes more like the "order by column". 'default_ordering' ↵Mike Bayer2006-01-011-1/+1
| | | | | | flag sent to create_engine enables whether or not the rowid_column on a Table will be None or not. mappers/relations will by default use the rowid_column for ordering if its not None, else theres no default ordering. still should better define 'default_ordering'/'rowid_column' relationship since its a little kludgy.
* license switchMike Bayer2005-12-311-0/+3
|
* changes related to mapping against arbitrary selects, selects with labels or ↵Mike Bayer2005-12-301-4/+7
| | | | | | | | | | | | | | functions: testfunction has a more complete test (needs an assert tho); added new labels, synonymous with column key, to "select" statements that are subqueries with use_labels=False, since SQLite wants them - this also impacts the names of the columns attached to the select object in the case that the key and name dont match, since it is now the key, not the name; aliases generate random names if name is None (need some way to make them more predictable to help plan caching); select statements have a rowid column of None, since there isnt really a "rowid"...at least cant figure out what it would be yet; mapper creates an alias if given a select to map against, since Postgres wants it; mapper checks if it has pks for a given table before saving/deleting, skips it otherwise; mapper will not try to order by rowid if table doesnt have a rowid (since select statements dont have rowids...)
* reworking concept of column lists, "FromObject", "Selectable";Mike Bayer2005-12-301-0/+8
| | | | | | | | support for types to be propigated into boolean expressions; new label() function/method to make any column/literal/function/bind param into a "foo AS bar" clause, better support in ansisql for this concept; trying to get column list on a select() object to be Column and ColumnClause objects equally, working on mappers that map to those select() objects
* updates for assignmapper, inherit_condition not requiredMike Bayer2005-12-291-10/+17
|
* mapper, when updating, only SET's those columns that have changed.Mike Bayer2005-12-231-4/+14
| | | | | this also allows "deferred" column properties to remain untouched by a save operation if they werent affected.
* added defer and undefer mapper optionsMike Bayer2005-12-231-3/+47
|
* refactor/cleanup to mapper options methodology to allow for incoming ↵Mike Bayer2005-12-231-9/+46
| | | | | | | | | | | | | | defer/undefer options mapper/relations are stricter about class attributes and primary mapper - is_primary flag on relations fixed (wasnt working before). new primary mappers clear off old class attributes, secondary mappers insure that their property was set up by the primary; otherwise secondary mappers can add behavior to properties that are unmanaged by the primary mapper added "group" option to deferred loaders so a group of properties can be loaded at once mapper adds the "oid" column to the select list if "distinct" is set to true and its using the default "order by oid" ordering (mysql benefits from ansisql fix to only print out unique columns in the select list since its oid is the same as the pk column) fixed unittests to comply with stricter primary mapper rules
* deferred property, checks for NULL primary key components and returns NoneMike Bayer2005-12-221-0/+3
|
* added 'deferred' keyword, allowing deferred loading of a particular columnMike Bayer2005-12-211-0/+20
|
* added select_by, get_by, magic methodsMike Bayer2005-12-141-0/+14
|
* echo can now be False, True or 'debug'. result sets are printed only if echo ↵Mike Bayer2005-12-121-2/+2
| | | | is 'debug'.
* more combinationsMike Bayer2005-12-121-0/+2
|
* added 'order_by' property to mapper constructorMike Bayer2005-12-121-0/+9
| | | | | | added 'no_sort' property to mapper _compile method to disable all ordering mapper _compile will not use its internal order_by if the given statement has an orderby lazyloader order_by used standalone when loading via mapper
* more grueling unit tests involving limit, offset and distinct (and unions)Mike Bayer2005-12-081-47/+114
|
* limit and offset support for mappers, insanity with eager loadingMike Bayer2005-12-071-1/+1
|
* added rudimentary support for limit and offset (with the hack version in oracle)Mike Bayer2005-12-071-17/+38
| | | | | fixed up order_by to support a list/scalar of columns or asc/desc fixed up query.py unit test
* added order_by to EagerLoader, LazyLoaderMike Bayer2005-12-041-0/+34
| | | | removed "scope" parameter from Mapper until we need to revisit that idea
* math operatorsMike Bayer2005-12-041-1/+1
| | | | | | &|~ boolean operators added 'literal' keyword working on column clauses being more flexible
* migrated __ALL__ to __all__, oops, and reworked moduleMike Bayer2005-11-301-2/+1
| | | | import scheme
* some cleanup to tests, adjustments to support mysql quirksMike Bayer2005-11-271-10/+12
|
* mysql somewhat presentMike Bayer2005-11-271-1/+0
|