Commit Graph

28 Commits

Author SHA1 Message Date
Mike Bayer 4769ea895b - renamed autoexpire to expire_on_commit
- renamed SessionTransaction autoflush to reentrant_flush to more clearly state its purpose
- added _enable_transaction_accounting, flag for Mike Bernson which disables the whole 0.5 transaction state management; the system depends on expiry on rollback in order to function.
2008-08-03 18:03:57 +00:00
Mike Bayer a4781e4d76 - A critical fix to dynamic relations allows the
"modified" history to be properly cleared after
a flush().
2008-07-19 21:33:58 +00:00
Jason Kirtland 2de2900e59 Chipping away at remaining cruft. 2008-05-10 00:05:03 +00:00
Jason Kirtland e41c0f4107 Test suite modernization in progress. Big changes:
- @unsupported now only accepts a single target and demands a reason
   for not running the test.
 - @exclude also demands an exclusion reason
 - Greatly expanded @testing.requires.<feature>, eliminating many
   decorators in the suite and signficantly easing integration of
   multi-driver support.
 - New ORM test base class, and a featureful base for mapped tests
 - Usage of 'global' for shared setup going away, * imports as well
2008-05-09 20:26:09 +00:00
Mike Bayer 4a6afd469f r4695 merged to trunk; trunk now becomes 0.5.
0.4 development continues at /sqlalchemy/branches/rel_0_4
2008-05-09 16:34:10 +00:00
Mike Bayer e3b2305d67 - merged -r4458:4466 of query_columns branch
- this branch changes query.values() to immediately return an iterator, adds a new "aliased" construct which will be the primary method to get at aliased columns when using values()
- tentative ORM versions of _join and _outerjoin are not yet public, would like to integrate with Query better (work continues in the branch)
- lots of fixes to expressions regarding cloning and correlation.  Some apparent ORM bug-workarounds removed.
- to fix a recursion issue with anonymous identifiers, bind parameters generated against columns now just use the name of the column instead of the tablename_columnname label (plus the unique integer counter).  this way expensive recursive schemes aren't needed for the anon identifier logic.   This, as usual, impacted a ton of compiler unit tests which needed a search-n-replace for the new bind names.
2008-04-07 01:12:44 +00:00
Mike Bayer 13475937e4 - fixed/added coverage for various cascade scenarios
- added coverage for some extra cases in dynamic relations
- removed some unused methods from unitofwork
2008-03-18 20:59:52 +00:00
Mike Bayer 190436e58d - fixed "cascade delete" operation of dynamic relations,
which had only been implemented for foreign-key nulling
behavior in 0.4.2 and not actual cascading deletes
[ticket:895]
2008-03-16 23:49:55 +00:00
Mike Bayer 4bd956b50f - dynamic_loader() / lazy="dynamic" now accepts and uses
the order_by parameter in the same way in which it works
with relation().
2008-03-09 22:51:55 +00:00
Mike Bayer 9ea6574841 added sanity test for order_by 2008-03-09 18:00:04 +00:00
Jason Kirtland 4be99db15b - Restored 2.3 compat. in lib/sqlalchemy
- Part one of test suite fixes to run on 2.3
  Lots of failures still around sets; sets.Set differs from __builtin__.set
  particularly in the binops. We depend on set extensively now and may need to
  provide a corrected sets.Set subclass on 2.3.
2008-01-19 23:37:11 +00:00
Mike Bayer 55c0ab5b2b - dynamic relations, when referenced, create a strong
reference to the parent object so that the query
still has a parent to call against even if the
parent is only created (and otherwise dereferenced)
within the scope of a single expression [ticket:938]
2008-01-16 22:06:15 +00:00
Jason Kirtland 17d3c8764e - testbase is gone, replaced by testenv
- Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase
- testing.db has the configured db
- Fixed up the perf/* scripts
2008-01-12 22:03:42 +00:00
Mike Bayer 3715e10bf8 - also with dynamic, implemented correct count() behavior as well
as other helper methods.
2007-12-07 16:31:12 +00:00
Mike Bayer 7ca4797537 - added "cascade delete" behavior to "dynamic" relations just like
that of regular relations.  if passive_deletes flag (also just added)
is not set, a delete of the parent item will trigger a full load of
the child items so that they can be deleted or updated accordingly.
2007-12-07 16:13:19 +00:00
Mike Bayer 569c9fa65a - fixed endless loop issue when using lazy="dynamic" on both
sides of a bi-directional relationship [ticket:872]
2007-11-19 08:30:52 +00:00
Mike Bayer 622a26a655 - session.refresh() and session.expire() now support an additional argument
"attribute_names", a list of individual attribute keynames to be refreshed
or expired, allowing partial reloads of attributes on an already-loaded
instance.
- finally simplified the behavior of deferred attributes, deferred polymorphic
load, session.refresh, session.expire, mapper._postfetch to all use a single
codepath through query._get(), which now supports a list of individual attribute names
to be refreshed.  the *one* exception still remaining is mapper._get_poly_select_loader(),
which may stay that way since its inline with an already processing load operation.
otherwise, query._get() is the single place that all "load this instance's row" operation
proceeds.
- cleanup all over the place
2007-11-18 02:13:56 +00:00
Jason Kirtland bcb586a93c Migrated maxdb behavioral assumptions from unsupported to fails_on 2007-11-05 22:11:30 +00:00
Mike Bayer cb9321116f - removed __len__ from "dynamic" collection as it would require issuing
a SQL "count()" operation, thus forcing all list evaluations to issue
  redundant SQL [ticket:818]
2007-10-17 16:49:15 +00:00
Ants Aasma 6bbc7dd157 change the in_ API to accept a sequence or a selectable [ticket:750] 2007-10-16 22:57:05 +00:00
Jason Kirtland d8f2ca2dc9 Deleting an entity having a dynamic loader with cascade="all" has some issues at the moment. 2007-08-22 05:40:50 +00:00
Mike Bayer 7c6c1b99c2 1. Module layout. sql.py and related move into a package called "sql".
2. compiler names changed to be less verbose, unused classes removed.
3. Methods on Dialect which return compilers, schema generators, identifier preparers
have changed to direct class references, typically on the Dialect class itself
or optionally as attributes on an individual Dialect instance if conditional behavior is needed.
This takes away the need for Dialect subclasses to know how to instantiate these
objects, and also reduces method overhead by one call for each one.
4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now).  The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument.

5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py
2007-08-18 21:37:48 +00:00
Mike Bayer bc04505b8c - moved test/orm/fixtures.py to testlib
- flattened mapper calls in _instance() to operate directly
through a default MapperExtension
- more tests for ScopedSession, fixed [ticket:746]
- threadlocal engine propagates **kwargs through begin()
2007-08-16 22:15:15 +00:00
Mike Bayer b0253eb9b5 - added 'object_session' as classlevel method to Session
- moved 'identity_key' to be a classmethod on Session
- some docstrings
- merged r3229 from 0.3 branch to unconditonally quote schemaname in PG-reflected default
- name fixes in dynamic unit test
2007-08-09 19:51:36 +00:00
Mike Bayer f94d9efecc - removed import of old sqlite module [ticket:654]
- removed sqlite version warning, all tests pass 100% with py2.5's older sqlite lib
- fixed dynamic test for py2.5
2007-07-29 17:39:37 +00:00
Mike Bayer c23320f09a - trimming down redundancy in lazyloader code
- fixups to ORM test fixture code
- fixup to dynamic realtions, test for autoflush session, delete-orphan
- made new dynamic_loader() function to create them
- removed old hasparent() call on AttributeHistory
2007-07-28 05:16:03 +00:00
Jason Kirtland e9155b6138 Got basic backrefs going with dynamic attributes 2007-07-28 00:33:59 +00:00
Mike Bayer 3f1c33cdc7 - an experimental feature that combines a Query with an InstrumentedAttribute, to provide
"always live" results in conjunction with mutator capability
2007-07-27 23:02:20 +00:00