Commit Graph

34 Commits

Author SHA1 Message Date
Mike Bayer b66dad46f3 - refactor of pathing mechanics, to address #2614, #2617
- paths now store Mapper + MapperProperty now instead of string key,
so that the parent mapper for the property is known, supports same-named
properties on multiple subclasses
- the Mapper within the path is now always relevant to the property
to the right of it.  PathRegistry does the translation now, instead
of having all the outside users of PathRegistry worry about it,
to produce a path that is much more consistent.  Paths are now
consistent with mappings in all cases.  Special logic to get at
"with_polymorphic" structures and such added also.
- AliasedClass now has two modes, "use_mapper_path" and regular;
"use_mapper_path" is for all those situations where we put an AliasedClass
in for a plain class internally, and want it to "path" with the
plain mapper.
- The AliasedInsp is now the first class "entity" for an AliasedClass,
and is passed around internally and used as attr._parententity
and such.  it is the AliasedClass analogue for Mapper.
2012-12-01 20:12:23 -05:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
2012-09-27 02:37:33 -04:00
Mike Bayer 22ba1c43b7 -whitespace bonanza, contd 2012-07-28 17:05:50 -04:00
Mike Bayer 3dd536ac06 - [feature] The of_type() construct on attributes
now accepts aliased() class constructs as well
as with_polymorphic constructs, and works with
query.join(), any(), has(), and also
eager loaders subqueryload(), joinedload(),
contains_eager()
[ticket:2438] [ticket:1106]
- a rewrite of the query path system to use an
object based approach for more succinct usage.  the system
has been designed carefully to not add an excessive method overhead.
- [feature] select() features a correlate_except()
method, auto correlates all selectables except those
passed.   Is needed here for the updated any()/has()
functionality.
- remove some old cruft from LoaderStrategy, init(),debug_callable()
- use a namedtuple for _extended_entity_info.  This method should
become standard within the orm internals
- some tweaks to the memory profile tests, number of runs can
be customized to work around pysqlite's very annoying behavior
- try to simplify PropertyOption._get_paths(), rename to _process_paths(),
returns a single list now.  overall works more completely as was needed
for of_type() functionality
2012-06-20 19:28:29 -04:00
Mike Bayer 841ea194bd - [removed] The legacy "mutable" system of the
ORM, including the MutableType class as well
as the mutable=True flag on PickleType
and postgresql.ARRAY has been removed.
In-place mutations are detected by the ORM
using the sqlalchemy.ext.mutable extension,
introduced in 0.7.   The removal of MutableType
and associated constructs removes a great
deal of complexity from SQLAlchemy's internals.
The approach performed poorly as it would incur
a scan of the full contents of the Session
when in use. [ticket:2442]
2012-04-23 18:59:17 -04:00
Mike Bayer 5448f6129c - [bug] Fixed memory leak in core which would
occur when C extensions were used with
  particular types of result fetches,
  in particular when orm query.count()
  were called.  [ticket:2427]
2012-03-10 16:18:52 -08:00
Mike Bayer fdbfed3f30 - this helps oracle here since it has a panic attack otherwise 2011-04-25 22:51:58 -04:00
Mike Bayer 46ee78431c mark all aaa_profiling tests with __requires__ = 'cpython', 2011-04-23 12:34:38 -07:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer 0a46523a92 triple check that the dict is empty 2010-12-19 19:13:40 -05:00
Mike Bayer 68fb34ba57 - system to cache the bind/result processors in a dialect-wide registry.
its an idea with pointy edges.
2010-12-13 12:53:56 -05:00
Mike Bayer c691b4cbdf - support for cdecimal
- add --with-cdecimal flag to tests, monkeypatches cdecimal in
- fix mssql/pyodbc.py to not use private '_int' accessor in decimal conversion
routines
- pyodbc version 2.1.8 is needed for cdecimal in any case as
previous versions also called '_int', 2.1.8 adds the same string
logic as our own dialect, so that logic is skipped for modern
pyodbc version
- make the imports for "Decimal" consistent across the whole lib.  not sure
yet how we should be importing "Decimal" or what the best way forward
is that would allow a clean user-invoked swap of cdecimal; for now,
added docs suggesting a global monkeypatch - the two decimal libs
are not compatible with each other so any chance of mixing produces
serious issues.  adding adapters to DBAPIs tedious and adds in-python
overhead.  suggestions welcome on how we should be doing
Decimal/cdecimal.
2010-12-11 17:44:46 -05:00
Mike Bayer f1e54a69fb - merge default tip 2010-12-05 14:56:26 -05:00
Mike Bayer 58b2939433 - sqlalchemy.test and nose plugin moves back to being entirely
outside of "sqlalchemy" and under "test/".

Rationale:

- coverage plugin works without issue, without need for an awkward
additional package install
- command line for "nosetests" isn't polluted with SQLAlchemy options

[ticket:1949]
2010-11-28 14:19:44 -05:00
Mike Bayer 17fdeb77ad - fix test related to [ticket:1980] 2010-11-28 12:55:59 -05:00
Gaëtan de Menten 20418096d5 fixed a small potential memory leak in UnicodeResultProcessor (for some weird
reason, it didn't actually leak in my tests) by providing a dealloc method to
the type, and added a test to ensure it stays that way. Closes #1981.
2010-11-27 22:27:42 +01:00
Taavi Burns 42a4445bf3 Remove unused import. 2010-11-20 08:32:00 -05:00
Taavi Burns 426501cba7 DecimalResultProcessor memory testing is likely to catch something only when cextensions are enabled. [ticket:1978] 2010-11-20 08:30:07 -05:00
Taavi Burns df1d3cb9d5 Shorter tests for [ticket:1978] 2010-11-19 21:27:30 -05:00
Taavi Burns f19d7e5b97 Fix memory leaks in the cprocessors DecimalResultProcessor, including tests. [ticket:1978] 2010-11-19 17:44:39 -05:00
Mike Bayer e1402efb19 - move sqlalchemy.test to test.lib 2010-11-15 19:37:50 -05:00
Mike Bayer a6b62cc3fe Python-tidy test/engine and test/aaa_profiling, 80% auto + 20% manual intervention 2010-07-11 13:15:51 -04:00
Mike Bayer c5ed8dfd8d version_info is the tuple 2010-06-15 14:05:02 -04:00
Mike Bayer 1769b2d8de - hypothesize that newer pysqlites are also growing a warning log on non-unicdoe strings 2010-06-14 20:15:27 -04:00
Mike Bayer 03e0f776be - The warning emitted by the Unicode and String types
with convert_unicode=True no longer embeds the actual
value passed.   This so that the Python warning
registry does not continue to grow in size, the warning
is emitted once as per the warning filter settings,
and large string values don't pollute the output.
[ticket:1822]
2010-06-13 16:09:13 -04:00
Mike Bayer 464f295854 fix this test for oracle 2010-05-31 14:46:21 -04:00
Mike Bayer cfe9fadc61 change the weakkeydict to be just an LRU cache. Add tests
for the "many combinations of UPDATE keys" issue.
2010-05-31 11:56:08 -04:00
Mike Bayer 9bab63b693 - Pool classes will reuse the same "pool_logging_name" setting
after a dispose() occurs.

- Engine gains an "execution_options" argument and
update_execution_options() method, which will apply to
all connections generated by this engine.

- Added more aggressive caching to the mapper's usage of
UPDATE, INSERT, and DELETE expressions.  Assuming the
statement has no per-object SQL expressions attached,
the expression objects are cached by the mapper after
the first create, and their compiled form is stored
persistently in a cache dictionary for the duration of
the related Engine.

- change #3 required change #1 so that we could test
a set of mappers operating over the course of many engines without
memory usage increase.
2010-05-30 20:24:08 -04:00
Mike Bayer cf65d1e42e check_reverse was failing a not well covered m2m case. 2010-04-10 20:13:51 -04:00
Mike Bayer 065fcbd9d2 - The official name for the relation() function is now
relationship(), to eliminate confusion over the relational
algebra term.  relation() however will remain available
in equal capacity for the foreseeable future.  [ticket:1740]
2010-03-17 17:48:29 -04:00
Mike Bayer aa6f068a92 - merge sqlite 2.5 memory exception from r6567 of 0.5 branch 2009-12-25 16:50:49 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00
Mike Bayer 45cec095b4 - unit tests have been migrated from unittest to nose.
See README.unittests for information on how to run
the tests.  [ticket:970]
2009-06-10 21:18:24 +00:00