Commit Graph

107 Commits

Author SHA1 Message Date
Jason Kirtland 8fa48edbf9 - Removed 2.3 set emulations/enhancements.
(sets.Set-based collections & DB-API returns still work.)
2008-07-15 19:23:52 +00:00
Mike Bayer be2d349ade - fixed some concrete inheritance ramifications regarding r4866
- added explicit test coverage for r4866 with joined table inheritance
2008-06-21 18:08:34 +00:00
Mike Bayer c5e2d673a9 - implemented [ticket:887], refresh readonly props upon save
- moved up "eager_defaults" active refresh step (this is an option used by just one user pretty much)
to be per-instance instead of per-table
- fixed table defs from previous deferred attributes enhancement
- CompositeColumnLoader equality comparison fixed for a/b == None; I suspect the composite capability in SA
needs a lot more work than this
2008-06-21 17:23:14 +00:00
Mike Bayer 3cd10102e4 - Query.UpdateDeleteTest.test_delete_fallback fails on mysql due to subquery in DELETE; not sure how to do this exact operation in MySQL
- added query_cls keyword argument to sessionmaker(); allows user-defined Query subclasses to be generated by query().
- added @attributes.on_reconstitute decorator, MapperExtension.on_reconstitute, both receieve 'on_load' attribute event allowing
non-__init__ dependent instance initialization routines.
- push memusage to the top to avoid pointless heisenbugs
- renamed '_foostate'/'_fooclass_manager' to '_sa_instance_state'/'_sa_class_manager'
- removed legacy instance ORM state accessors
- query._get() will use _remove_newly_deleted instead of expunge() on ObjectDeleted, so that transaction rollback
restores the previous state
- removed MapperExtension.get(); replaced by a user-defined Query subclass
- removed needless **kwargs from query.get()
- removed Session.get(cls, id); this is redundant against Session.query(cls).get(id)
- removed Query.load() and Session.load(); the use case for this method has never been clear, and the same functionality is available in more explicit ways
2008-06-09 01:24:08 +00:00
Mike Bayer ae9297bd18 a comment indicating why we can't raise an error for relation(Foo, uselist=False, order_by=something) 2008-05-26 18:35:24 +00:00
Mike Bayer 6510bfbcf7 - PropertyLoader.foreign_keys becomes private
- removed most __foo() defs from properties.py
- complexity reduction in PropertyLoader.do_init()
2008-05-24 18:53:57 +00:00
Mike Bayer ad23f3b068 - zoomark/zoomark_orm seem to work with pool_threadlocal turned off, [ticket:1050] becomes WORKSFORME
- fixed probably errenous unique=True checkin on unitofwork.py
2008-05-19 22:35:32 +00:00
Jason Kirtland ced326dc1f - Implemented generic CHAR_LENGTH for sqlite (-> LENGTH())
- Updated .requires for firebird
2008-05-19 19:37:44 +00:00
Lele Gaifax f071ba1d3b Remove some noise from the uow test 2008-05-19 18:35:34 +00:00
Jason Kirtland dd20ca5cb9 - Removed @unsupported 2008-05-14 22:09:23 +00:00
Jason Kirtland 65f4f02ec8 Columns now have default= and server_default=. PassiveDefault fades away. 2008-05-14 19:49:40 +00:00
Mike Bayer 9d700bc60c correcting dataload profiles for various tests 2008-05-10 18:38:20 +00:00
Jason Kirtland 2de2900e59 Chipping away at remaining cruft. 2008-05-10 00:05:03 +00:00
Mike Bayer d3621ae961 - fixed a fairly critical bug in clause adaption/corresponding column in conjunction with annotations
- implicit order by is removed, modified many tests to explicitly set ordering, probably many more to go
once it hits the buildbot.
2008-05-09 23:58:30 +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 b089e8615b - refined mapper._save_obj() which was unnecessarily calling
__ne__() on scalar values during flush [ticket:1015]
2008-04-26 16:13:49 +00:00
Mike Bayer 6b387602d6 test not supported on sqlite 2008-03-18 23:50:30 +00:00
Mike Bayer 7d33391e29 some fixup to one-to-many delete cascade 2008-03-18 23:35:47 +00:00
Mike Bayer 0b890e1ccd heisenbug in aisle 3
(when db.dispose is called in unitofwork test with sqlite, the first test that runs in memusage grows by two gc'ed objects on every iteration; then the problem vanishes.  doesnt matter what test runs in memusage.  doing a dispose() in memusage solves the problem also.  screwing wiht the mechanics of engine.dispose() only fix it when both the pool.dispose() *and* the pool.ressurect() are disabled.  its just a subtle python/pysqlite bug afaict)
2008-02-09 01:24:01 +00:00
Jason Kirtland 1b228e8481 - Added deferrability support to constraints 2008-02-08 20:50:33 +00:00
Ants Aasma 4506425966 unit-of-work flush didn't close the failed transaction when the session was not in a transaction and commiting the transaction failed. 2008-02-06 17:38:29 +00:00
Mike Bayer da7fef941c - "Passive defaults" and other "inline" defaults can now
be loaded during a flush() call if needed; in particular,
this allows constructing relations() where a foreign key
column references a server-side-generated, non-primary-key
column. [ticket:954]
2008-01-28 23:15:40 +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 04ad3303dc - unit test for r4048 2008-01-10 22:45:07 +00:00
Jason Kirtland bf36c648f2 Reworked r4042- undeclared deprecation warnings are now *fatal* to tests. No surprises. 2008-01-10 02:37:39 +00:00
Mike Bayer 979c9323dc - fixed bug with session.dirty when using "mutable scalars"
(such as PickleTypes)

- added a more descriptive error message when flushing on a
relation() that has non-locally-mapped columns in its primary or
secondary join condition
2008-01-09 18:52:35 +00:00
Mike Bayer 0df750223a - merged instances_yields branch r3908:3934, minus the "yield" part which remains slightly problematic
- cleanup of mapper._instance, query.instances().  mapper identifies objects which are part of the
current load using a app-unique id on the query context.
- attributes refactor; attributes now mostly use copy-on-modify instead of copy-on-load behavior,
simplified get_history(), added a new set of tests
- fixes to OrderedSet such that difference(), intersection() and others can accept an iterator
- OrderedIdentitySet passes in OrderedSet to the IdentitySet superclass for usage in difference/intersection/etc. operations so that these methods actually work with ordering behavior.
- query.order_by() takes into account aliased joins, i.e.  query.join('orders', aliased=True).order_by(Order.id)
- cleanup etc.
2007-12-14 05:53:18 +00:00
Jason Kirtland 8128a6378a - Removed @testing.supported. Dialects in development or maintained outside
the tree can now run the full suite of tests out of the box.
- Migrated most @supported to @fails_on, @fails_on_everything_but, or (last
  resort) @unsupported.  @fails_on revealed a slew of bogus test skippage,
  which was corrected.
- Added @fails_on_everything_but.  Yes, the first usage *was*
  "fails_on_everything_but('postgres')".  How did you guess!
- Migrated @supported in dialect/* to the new test-class attribute __only_on__.
- Test classes can also have __unsupported_on__ and __excluded_on__.
2007-12-13 09:59:14 +00:00
Mike Bayer 8b1beee112 add some updates too 2007-12-09 16:13:27 +00:00
Mike Bayer 901829a7e3 - added a test for boolean saves/retrieves 2007-12-09 16:11:21 +00:00
Mike Bayer acdb90784b - mutable primary key support is added. primary key columns can be
changed freely, and the identity of the instance will change upon
flush. In addition, update cascades of foreign key referents (primary
key or not) along relations are supported, either in tandem with the
database's ON UPDATE CASCADE (required for DB's like Postgres) or
issued directly by the ORM in the form of UPDATE statements, by setting
the flag "passive_cascades=False".
2007-12-09 05:00:12 +00:00
Mike Bayer c863f9fdec more assertion hints... 2007-12-05 21:51:16 +00:00
Mike Bayer 9e4052dc8b - a major behavioral change to collection-based backrefs: they no
longer trigger lazy loads !  "reverse" adds and removes
are queued up and are merged with the collection when it is
actually read from and loaded; but do not trigger a load beforehand.
For users who have noticed this behavior, this should be much more
convenient than using dynamic relations in some cases; for those who
have not, you might notice your apps using a lot fewer queries than
before in some situations. [ticket:871]
2007-12-05 20:43:16 +00:00
Mike Bayer 4ee7070223 new synonym() behavior, including auto-attribute gen, attribute decoration,
and auto-column mapping implemented; [ticket:801]
2007-11-28 21:13:35 +00:00
Mike Bayer 329703a371 un-screw up the attribute manager checkin 2007-11-27 05:44:16 +00:00
Mike Bayer 378c02348c AttributeManager class and "cached" state removed....attribute listing
is tracked from _sa_attrs class collection
2007-11-27 05:15:13 +00:00
Mike Bayer d86eb9ba4f oops, print statements... 2007-11-18 02:18: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 429e69db67 - Removed equality, truth and hash() testing of mapped instances. Mapped
classes can now implement arbitrary __eq__ and friends. [ticket:676]
2007-11-03 20:23:26 +00:00
Mike Bayer 3f4d34b42c - split ScalarInstrumentedAttribute into a "scalar" and an "object" version.
The "object" version loads the existing value on set/del, fires events,
 and handles trackparent operations; the "scalar" version does not.
- column loaders now use the "scalar" version of InstrumentedAttribute, so that
event handlers etc. don't fire off for regular column attribute operations.
- some adjustments to AttributeHistory to work properly for non-loaded attributes
- deferred column attributes no longer trigger a load operation when the
attribute is assigned to.  in those cases, the newly assigned
value will be present in the flushes' UPDATE statement unconditionally.
2007-10-31 19:11:22 +00:00
Ants Aasma 5a1863d092 - also added proxying of save_or_update to scoped sessions.
- session.update() raises an error when updating an instance that is already in the session with a different identity
- adjusted zoomarks lower limits so I can get a nice clean run
2007-10-31 16:30:06 +00:00
Mike Bayer 206c0b9792 - fix to "row switch" behavior, i.e. when an INSERT/DELETE is combined into a
single UPDATE; many-to-many relations on the parent object update properly.
  [ticket:841]
- it's an error to session.save() an object which is already persistent
  [ticket:840]
- changed a bunch of repr(obj) calls in session.py exceptions to use mapperutil.instance_str()
2007-10-30 18:04:00 +00:00
Jason Kirtland 6378c34799 - Added initial version of MaxDB dialect.
- All optional test Sequences are now optional=True
2007-10-23 07:38:07 +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
Mike Bayer b56ed8ccb8 - backref remove object operation doesn't fail if the other-side
collection doesn't contain the item, supports noload collections
[ticket:813]
2007-10-14 18:06:13 +00:00
Jason Kirtland 0d9d87560b - No longer using reserved-ish column names in MutableTypesTest. 2007-10-07 23:55:59 +00:00
Mike Bayer 7f6bf93da8 - added 'comparator' keyword argument to PickleType. By default, "mutable"
PickleType does a "deep compare" of objects using their dumps() representation.
  But this doesn't work for dictionaries.  Pickled objects which provide an
  adequate __eq__() implementation can be set up with "PickleType(comparator=operator.eq)"
  [ticket:560]
2007-09-22 15:55:02 +00:00
Mike Bayer 9d5264f9f9 - added 'passive_deletes="all"' flag to relation(), disables all
nulling-out of foreign key attributes during a flush where the parent
  object is deleted.

- fix to FK compile fix from yesterday
2007-09-09 17:01:38 +00:00
Mike Bayer e92d5cff7e - mapper compilation has been reorganized such that most compilation
occurs upon mapper construction.  this allows us to have fewer
  calls to mapper.compile() and also to allow class-based properties
  to force a compilation (i.e. User.addresses == 7 will compile all
  mappers; this is [ticket:758]).  The only caveat here is that
  an inheriting mapper now looks for its inherited mapper upon construction;
  so mappers within inheritance relationships need to be constructed in
  inheritance order (which should be the normal case anyway).
2007-09-02 19:55:33 +00:00