Commit Graph

2308 Commits

Author SHA1 Message Date
Mike Bayer 4c19f98651 update example to work with new collections class 2007-06-28 19:26:24 +00:00
Mike Bayer e94baeaacd some comparison fixes 2007-06-28 18:25:39 +00:00
Jason Kirtland f431017f40 - Applied some safe collections optimizations and annotated a few key places
for future optimization.  As-is, masseagerload shows a speed up and overall
  function reduction compared to 0.4 pre-collections.
- Some minor cleanups in collections + related
2007-06-28 17:42:34 +00:00
Jason Kirtland 7b87fcecd6 - Replaced collection api: The "InstrumentedList" proxy is replaced with
a proxy-free, decorator-based approach for user-space instrumentation and
  a "view" adapter for interaction with the user's collection within the orm.
  Fixes [ticket:213], [ticket:548], [ticket:563].
- This needs many more unit tests.  There is significant indirect coverage
  through association proxy, but direct tests are needed, specifically in
  the decorators and add/remove event firing.
- Collections are now instrumented via decorations rather than
  proxying.  You can now have collections that manage their own
  membership, and your class instance will be directly exposed on the
  relation property.  The changes are transparent for most users.
- InstrumentedList (as it was) is removed, and relation properties no
  longer have 'clear()', '.data', or any other added methods beyond those
  provided by the collection type.  You are free, of course, to add them
  to a custom class.
- __setitem__-like assignments now fire remove events for the existing
  value, if any.
- dict-likes used as collection classes no longer need to change __iter__
  semantics- itervalues() is used by default instead.  This is a backwards
  incompatible change.
- subclassing dict for a mapped collection is no longer needed in most cases.
  orm.collections provides canned implementations that key objects by a
  specified column or a custom function of your choice.
- collection assignment now requires a compatible type- assigning None
  to clear a collection or assinging a list to a dict collection will now
  raise an argument error.
- AttributeExtension moved to interfaces, and .delete is now .remove
  The event method signature has also been swapped around.
2007-06-27 21:08:14 +00:00
Ants Aasma a1a2fe7400 merge from trunk fix for undetected disconnects for mysql (ticket #625), r2793 2007-06-27 09:54:33 +00:00
Ants Aasma 6f630e98a6 merge 2791 from trunk, fix for bad error message (ticket #607) 2007-06-26 19:07:51 +00:00
Ants Aasma 8b89aa795c merge compound select grouping patch from trunk (ticket #623) 2007-06-26 18:31:57 +00:00
Ants Aasma c533030643 merge from trunk #624 fix, modulo operator escaping 2007-06-26 16:38:16 +00:00
Ants Aasma 73b76e57ac merged between precedence from trunk ([2785]) 2007-06-25 19:20:53 +00:00
Mike Bayer 9225b3dee9 merged operator precedence fixes/tests IN fixes/tests from trunk r2782-r2783 2007-06-25 17:22:14 +00:00
Mike Bayer 4cc6c4f4fc docstring cleanup, removal of some ORM cruft 2007-06-25 03:47:29 +00:00
Mike Bayer 0e209828b5 moved "clone" conditional blocks into separate copy_internals() method; was a
conflation of tasks having them in the same place like that.
2007-06-25 03:14:01 +00:00
Mike Bayer 952c9e8f6d removed ConnectionProvider. engines have a "pool" attribute now. 2007-06-24 20:58:08 +00:00
Mike Bayer 11b0fdc1b6 merged trunk r2755-r2778 2007-06-24 20:09:54 +00:00
Mike Bayer 3404bd8d82 - fixed limit/offset compilation for postgres 2007-06-24 20:00:44 +00:00
Mike Bayer 13ac46eb3f - merge of generative_sql branch
- copy_container() removed.  ClauseVisitor.traverse() now features "clone"
flag which allows traversal with copy-and-modify-in-place behavior
- select() objects copyable now [ticket:52] [ticket:569]
- improved support for custom column_property() attributes which
  feature correlated subqueries...work better with eager loading now.
- accept_visitor()  methods removed.  ClauseVisitor now genererates method
names based on class names, or an optional __visit_name__ attribute.  calls
regular visit_XXX methods as they exist, can optionally call an additional
"pre-descent" enter_XXX method to allow stack-based operations on traversals
- select() and union()'s now have "generative" behavior.  methods like
order_by() and group_by() return a *new* instance - the original instance
is left unchanged.  non-generative methods remain as well.
- the internals of select/union vastly simplified - all decision making
regarding "is subquery" and "correlation" pushed to SQL generation phase.
select() elements are now *never* mutated by their enclosing containers
or by any dialect's compilation process
2007-06-24 19:58:41 +00:00
Jason Kirtland 909cf3fd5d - Added missing orm import 2007-06-22 21:10:30 +00:00
Jason Kirtland 64e920cee8 - expanded assignment test, ensure that re-assigning the value of
an association mutates the backing object (rather than a delete and
  create with new primary keys)
2007-06-21 21:01:04 +00:00
Mike Bayer a0f01fc86c - merged trunk r2730-r2755
- removed "clear_mapper()" method
2007-06-20 22:53:03 +00:00
Mike Bayer e846724192 update changelog 2007-06-20 22:09:51 +00:00
Mike Bayer 671d7fdadf added a unit test to test PK "collapsing" as in [changeset:2636], to help illustrate for [ticket:611] 2007-06-20 21:59:38 +00:00
Mike Bayer 58dbbab392 fixed overly eager check for ClauseElement type in filter() 2007-06-20 21:24:34 +00:00
Mike Bayer 6793bbd079 fixed outerjoin() to use correct start point 2007-06-20 21:17:28 +00:00
Mike Bayer 2e82f5de0c - finally figured out how to get setuptools version in, available
as sqlalchemy.__version__ [ticket:428]
2007-06-19 17:48:46 +00:00
Mike Bayer 243ce000ec filter() checks for ClauseElement [ticket:535] 2007-06-17 01:06:00 +00:00
Mike Bayer 37762aad5c - merged last_inserted_ids() fix from trunk [changeset:2743] 2007-06-17 00:57:06 +00:00
Jason Kirtland c19a707131 - Eh, dummy_threading trick didn't actually work for no-op'ing overflow.
Works now, but less readable.
- Shaped the script from ticket #608 into a test case
2007-06-16 18:46:23 +00:00
Jason Kirtland 3c9ed9f4bc - Put a mutex around the QueuePool's overflow handlings 2007-06-16 15:51:13 +00:00
Jason Kirtland 5b779d30c3 - Added testbase.Table and testbase.Column, interceptors that can set up
test-run- and dialect-specific options on those objects
  All tests re-pointed to go through the interceptors
- Removed mysql_engine= from table declarations, replaced with a general
  flag indicating storage requirements
- Added ability to choose a global MySQL storage engine for all tests
  --mysql-engine=<whatever>
  If none is specified, tests use the old db-default/InnoDB behavior
- Added ability to append arbitrary table creation params
  --table-option=KEY=VALUE
  For MySQL 3, use this to set mysql_type instead of --mysql-engine
- Removed a couple dead test modules
2007-06-15 22:35:53 +00:00
Mike Bayer 1fba10839c unit test fix 2007-06-15 16:53:00 +00:00
Mike Bayer 4b3af119f7 - added "explcit" create/drop/execute support for sequences
(i.e. you can pass a "connectable" to each of those methods
on Sequence)
- checkfirst flag propigates for sequence creates/drops
2007-06-15 16:51:25 +00:00
Mike Bayer 47c3ce38aa - merged trunk 2629-2730
- fixes to is_select() which is now an important method
- mysql unit tests fixes
2007-06-14 18:37:20 +00:00
Mike Bayer baba8281df - result sets from CRUD operations close their underlying cursor immediately.
will also autoclose the connection if defined for the operation; this
    allows more efficient usage of connections for successive CRUD operations
    with less chance of "dangling connections".
2007-06-14 18:17:05 +00:00
Mike Bayer ca5480de91 fixed up really old tests to work without legacy engine syntax 2007-06-14 04:14:19 +00:00
Jonathan Ellis e629fa9685 r/m psycopg1 support 2007-06-12 20:44:13 +00:00
Jonathan Ellis a95c6e3fa9 add explanation of prefab db connections 2007-06-12 20:43:43 +00:00
Jonathan Ellis a9da36da05 fix apparent typo 2007-06-12 20:39:48 +00:00
Jonathan Ellis 32310c713f merge 2684-2686 from trunk 2007-06-12 20:22:57 +00:00
Jason Kirtland e1ae27d94f - Faster FOR UPDATE tests 2007-06-12 01:58:26 +00:00
Jason Kirtland 60bbb80202 - Added tests for SELECT ... FOR UPDATE
- Added postgres support for FOR UPDATE NOWAIT via select(for_update='nowait')
2007-06-12 00:45:23 +00:00
Mike Bayer 2a052cd593 - result.last_inserted_ids() should return a list that is identically
sized to the primary key constraint of the table.  values that were
    "passively" created and not available via cursor.lastrowid will be None.
2007-06-11 22:39:03 +00:00
Mike Bayer 6b293a78d3 - MetaData loses 'name' attribute
- no more global_connect()
2007-06-11 19:48:36 +00:00
Mike Bayer ce2d1c7159 added separate test for metadata
some cleanup to query.py unit test
added settable "engine" property on MetaData
2007-06-11 19:31:19 +00:00
Mike Bayer cd358b8c9d - added "aliased joins" feature to query.filter_by()
- further work on modernizing/cleaning up unit tests
2007-06-10 23:53:03 +00:00
Mike Bayer f17ba4c7be merged StaticPool implementation 2007-06-09 21:44:36 +00:00
Mike Bayer a337890d82 version number 2007-06-09 17:50:24 +00:00
Mike Bayer eb3ee48990 added test for testing against "outerjoin" 2007-06-08 15:08:30 +00:00
Mike Bayer 561203f232 - added a third layer of inheritance to polymorph test
- added some extra logic to mapper to try to convert a "foreign key" holding PK-col
into a non-FK col
- apparently, polymorphic loading can now be achieved with LEFT OUTER JOINs quite easily (i.e. no UNIONs).
this needs to be studied further (i.e. why was I making everyone use UNION ALL all this time)
2007-06-08 02:12:36 +00:00
Mike Bayer 5430c7177a - fixed bug where selectable.corresponding_column(selectable.c.col)
would not return selectable.c.col, if the selectable is a join
of a table and another join involving the same table.  messed
up ORM decision making [ticket:593]
- removed is_natural_case function from ANSIIdentifierPreparer
2007-06-06 23:39:25 +00:00
Mike Bayer 9b61ea39a8 - moved another chunk of mapper.py tests to query.py test suite
- got all tests/extensions working with new APIs
- axed proxyengine until further notice
- SelectResults folds into a 10 line wrapper for Query, loses join_to() (use join())
- test cleanup
2007-06-05 23:12:03 +00:00