Commit Graph

5242 Commits

Author SHA1 Message Date
Mike Bayer ae000fb550 - added "alias" argument to contains_eager(). use it to specify the string name
or Alias instance of an alias used in the query for the eagerly loaded child items.
    easier to use than "decorator"
2007-02-20 01:04:07 +00:00
Mike Bayer eb311db5ec - moved SynonymProperty to interfaces, since its more generalized and synonym-aware operations
take place without knowning so much about properties
- mapper options like eagerload(), lazyload(), deferred(), will work for "synonym()" relationships [ticket:485]
2007-02-20 00:09:37 +00:00
Mike Bayer 6458a670c0 reverted unit test change 2007-02-19 04:36:18 +00:00
Rick Morrison e7ac502b81 Completed previously missed patches from tickets 422 and 415
get unit tests to work with pyodbc [ticket:481]
fix blank password on adodbapi [ticket:371]
2007-02-18 19:43:05 +00:00
Mike Bayer 2019974544 - fixes to tometadata() operation to propigate Constraints at column and table level 2007-02-17 19:08:36 +00:00
Mike Bayer b5bb6bb06d - fixed generation of CHECK constraints on columns [ticket:464] 2007-02-17 03:46:13 +00:00
Mike Bayer f4b1484ff5 - extension() query option propigates to Mapper._instance() method so that
all loading-related methods get called [ticket:454]
2007-02-17 03:14:36 +00:00
Mike Bayer 225e51a796 - added a Sequence to the unicode test tables to help Oracle
- fixed named PrimaryKeyConstraint generation on oracle [ticket:466] courtesy andrija at gmail
2007-02-17 02:31:56 +00:00
Mike Bayer 5f83c55fc7 - fixed oracle list of binary types to check for their presence in the module (such as BFILE not in all versions of cx_Oracle)
- removed oracle-handicap from binary unit test to test [ticket:435] fix, added an extra row containing None
2007-02-17 01:18:54 +00:00
Mike Bayer 40a29d198a - some cleanup to the unitofwork test suite (needs much more)
- fixed relationship deletion error when one-to-many child item is moved to a new
  parent in a single unit of work [ticket:478]
2007-02-15 02:07:06 +00:00
Rick Morrison 66a74c136f revert old unittest patch for MSSQL 2007-02-15 00:22:07 +00:00
Mike Bayer 902cd69528 - fixed relationship deletion error where parent/child with a single column as PK/FK
on the child would raise a "blank out the primary key" error, if manually deleted
or "delete" cascade without "delete-orphan" was used
2007-02-14 02:00:49 +00:00
Mike Bayer e7aaeb2852 - fixed argument passing to straight textual execute() on engine, connection.
can handle *args or a list instance for positional, **kwargs or a dict instance
for named args, or a list of list or dicts to invoke executemany()
2007-02-13 22:53:05 +00:00
Mike Bayer 238e8620ee - fix for very large topological sorts, courtesy ants.aasma at gmail [ticket:423] 2007-02-13 01:25:51 +00:00
Mike Bayer 1da55184e5 - implemented foreign_keys argument on relation() [ticket:385]
- PropertyLoader figures out accurate remote_side collection based
on foreign_keys, legacy foreignkey, primary/secondaryjoin/polymorphic
- reworked lazyloader, sync to work straight off foreign_keys/
remote_side collections
2007-02-10 23:39:06 +00:00
Mike Bayer 6809b2b334 - fixed "remote_side" in testrelationonbaseclass [ticket:461]
- added --reversetop arg to testbase to allow reversing the input collection
for topological sorts, to better reveal dependency issues
2007-02-06 19:22:44 +00:00
Mike Bayer 55d455d7d0 - added distinct() method to SelectResults. generally should only make a difference
when using count().
2007-02-05 23:26:37 +00:00
Mike Bayer 54c5a47642 nested query will always use order_by even if distinct is present, added test case to back it up 2007-02-05 23:16:43 +00:00
Mike Bayer ffc7dbdae6 make sure auto-reflection of remote tables working too... 2007-02-04 23:52:21 +00:00
Mike Bayer e3b409f683 - added "schema" argument to all has_table() calls, only supported so far by PG
- added basic unit test for PG reflection of tables in an alternate schema
2007-02-04 23:45:45 +00:00
Mike Bayer fb1c544e81 added mockdbapi to mysql dialect create to better help unit tests pass 2007-02-04 19:10:07 +00:00
Mike Bayer 80f48f250b - added literal_column() to specify a column clause that should not undergo any quoting
- straight text sent to select() added as literal_column
- fix for issue in [ticket:450]
2007-02-04 03:43:22 +00:00
Mike Bayer a8cdead326 - more quoting fixes for [ticket:450]...quoting more aggressive (but still skips already-quoted literals)
- got mysql to have "format" as default paramstyle even if mysql module not available, allows unit tests
to pass in non-mysql system for [ticket:457].  all the dialects should be changed to pass in their usual
paramstyle.
2007-02-04 03:12:27 +00:00
Mike Bayer 5ce214c7d4 - sequences on a non-pk column will properly fire off on INSERT for PG/oracle 2007-02-02 18:58:11 +00:00
Mike Bayer ab0a6cf6a8 unit test for "cant execute" 2007-02-02 18:26:42 +00:00
Mike Bayer e767b76a3e added unit test for previous checked in lazy fix 2007-02-01 21:44:04 +00:00
Mike Bayer 154a831822 - the "polymorphic_primaryjoin" again goes against the parent's non-polymorphic local table.
lazy load clause evaluation is plenty solid enough to handle it this time.
- the join_to() method on PropertyLoader takes the parent mapper as an argument and alisiazes
the primaryjoin against that mapper's selectable, so that the same primary join can be used against
the base mapper, any inheriting mapper, etc., whether or not it uses a polymorphic union (although
needs to be tested against alternate polymorphic unions added on subclasses).  fixes [ticket:448]
2007-02-01 03:18:08 +00:00
Mike Bayer 72f479b324 - improved support for complex queries embedded into "where" criterion
for query.select() [ticket:449]
- contains_eager('foo') automatically implies eagerload('foo')
- query.options() can take a combiantion MapperOptions and tuples of MapperOptions,
so that functions can return groups
- refactoring to Aliasizer and ClauseAdapter so that they share a common base methodology,
which addresses all sql.ColumnElements instead of just schema.Column.  common list-processing
methods added.
- query.compile and eagerloader._aliasize_orderby make usage of improved list processing on
above.
- query.compile, within the "nested select generate" step processes the order_by clause using
the ClauseAdapter instead of Aliasizer since there is only one "target"
2007-02-01 01:47:54 +00:00
Mike Bayer 8d7833d27c - fix to deferred so that load operation doesnt mistakenly occur when only
PK col attributes are set
2007-01-30 22:04:53 +00:00
Mike Bayer d8204ea92a further work on insuring clear_mappers() really works. assignmapper identified
as a much trickier thing to clean out.  added a unit test so that if any new collections get introduced
we are still testing.
2007-01-30 01:01:22 +00:00
Mike Bayer 6f7af70174 - fixed bug where cascade operations incorrectly included deleted collection
items in the cascade [ticket:445]
2007-01-30 00:16:42 +00:00
Mike Bayer ac4b2a8d18 fixes to quoting on "fake" column when used off its table 2007-01-29 22:41:53 +00:00
Mike Bayer d0fd16baa3 removed erroneous "lazy" 2007-01-28 23:52:53 +00:00
Mike Bayer bbc5e7c285 merged the polymorphic relationship refactoring branch in. i want to go further on that branch and introduce the foreign_keys argument, and further centralize the "intelligence" about the joins and selectables into PropertyLoader so that lazyloader/sync can be simplified, but the current branch goes pretty far.
- relations keep track of "polymorphic_primaryjoin", "polymorphic_secondaryjoin" which it derives from the plain primaryjoin/secondaryjoin.
  - lazy/eagerloaders work from those polymorphic join objects.
  - the join exported by PropertyLoader to Query/SelectResults is the polymorphic join, so that join_to/etc work properly.
  - Query builds itself against the base Mapper again, not the "polymorphic" mapper.  uses the "polymorphic" version
 only as appropriate.  this helps join_by/join_to/etc to work with polymorphic mappers.
  - Query will also adapt incoming WHERE criterion to the polymorphic mapper, i.e. the "people" table becomes the "person_join" automatically.
  - quoting has been modified since labels made out of non-case-sensitive columns could themselves require quoting..so case_sensitive defaults to True if not otherwise specified (used to be based on the identifier itself).
  - the test harness gets an ORMTest base class and a bunch of the ORM unit tests are using it now, decreases a lot of redundancy.
2007-01-28 23:33:53 +00:00
Mike Bayer 1b4e9a9221 - added a standardized test harness for ORM tests
- added three-level mapping test.  needed some massaging for postgres
2007-01-27 22:31:39 +00:00
Mike Bayer 931decd845 - eager relation to an inheriting mapper wont fail if no rows returned for
the relationship.
2007-01-27 01:40:26 +00:00
Mike Bayer 38aa219a69 added a close() to the single SQL execute, useful for testing pool behavior with the ORM 2007-01-27 01:08:39 +00:00
Mike Bayer 9349ef38ef - calling corresponding_column with keys_ok matches columns on name, not key, since
the name is meaningful with regards to SQL relationships, the key is not
- adjustments to the recent polymorphic relationship refactorings, specifically
for many-to-one relationships to polymorphic unions that did not contain the
base table [ticket:439].  the lazy/eager clause adaption to the selectable
will match up on straight column names (i.e. its a more liberal policy)
- lazy loader will not attempt to adapt the clause to the selectable if
loads_polymorphic is not enabled, since the more liberal policy of adapting
columns fails for more elaborate join conditions
- will have to see if ppl want to do complex joins with polymorphic relations...
may have to add "polymorphic_primaryjoin" in that case as a last resort (would make
working around these issues a snap, tho...)
2007-01-24 23:37:03 +00:00
Mike Bayer 142d3f4bfd added unit tests illustrating current workaround for assignmapper method name/collection class collision 2007-01-24 22:43:25 +00:00
Mike Bayer 0b90751a1c test patches from [ticket:422] 2007-01-23 21:14:54 +00:00
Mike Bayer b8662333bb - *slight* support for binary, but still need to figure out how to insert reasonably large
values (over 4K).  requires auto_setinputsizes=True sent to create_engine(), rows must
be fully fetched individually, etc.
2007-01-23 20:25:48 +00:00
Mike Bayer 30f75c2157 relationships no longer compile against the "selectable" mapper (i.e. the polymorphic mapper). join conditions, foreign keys etc. are configured against the actual mappers used in the relationship in all cases. the lazy and eager loaders in turn "adapt" their lazy/eager clauses to that of the "selectable" mapper if one is present. this is because the join conditions between the mapper's base tables are *far* easier to work with and detect direction etc. compared to an enormous polymorphic union; dealing with the polymorphic union is pushed further out into select query construction. 2007-01-23 04:05:07 +00:00
Mike Bayer fb7c98d41c added a session transaction test 2007-01-22 19:36:21 +00:00
Mike Bayer bf5a921cac added merge unit test from [ticket:430] 2007-01-21 19:49:38 +00:00
Mike Bayer 5f33323bc6 added recursion check to merge 2007-01-21 19:47:25 +00:00
Mike Bayer 99924c8645 docs: [ticket:345], [ticket:356], [ticket:48], [ticket:403], [ticket:394],
cleanup/completion of keyword arg documentation for create_engine(), mapper(), and
relation()
2007-01-21 00:09:25 +00:00
Mike Bayer c95faa5e8d - mysql table create options work on a generic passthru now, i.e. Table(..., mysql_engine='InnoDB',
mysql_collate="latin1_german2_ci", mysql_auto_increment="5", mysql_<somearg>...),
helps [ticket:418]
2007-01-20 21:00:08 +00:00
Mike Bayer a319799372 - tightened down conditions used to locate "relation direction", associating
the "foreignkey" of the relationship with the "primaryjoin".  the column match now
  must be exact, not just "corresponding".  this enables self-referential relationships on a
  polymorphic mapper.
  - a little bit of improvement to the concept of a "concrete" inheritance mapping, though that concept
  is not well fleshed out yet (added test case to support concrete mappers on top of a polymorphic base).
2007-01-20 12:31:27 +00:00
Mike Bayer 19de5346c2 removed 2007-01-20 12:13:10 +00:00
Mike Bayer e7f428e9f5 - fix to "proxy=True" behavior on synonym() 2007-01-20 03:14:59 +00:00