Commit Graph

67 Commits

Author SHA1 Message Date
Mike Bayer 7c6bde1c15 The long-deprecated and non-functional `assert_unicode` flag on
:func:`.create_engine` as well as :class:`.String` is removed.
2012-10-25 12:07:38 -04: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 60913b8ccf don't need this is_really_none() thing anymore 2012-08-08 19:20:17 -04:00
Mike Bayer 22ba1c43b7 -whitespace bonanza, contd 2012-07-28 17:05:50 -04:00
Mike Bayer 800efc7525 - [feature] *Very limited* support for
inheriting mappers to be GC'ed when the
    class itself is deferenced.  The mapper
    must not have its own table (i.e.
    single table inh only) without polymorphic
    attributes in place.
    This allows for the use case of
    creating a temporary subclass of a declarative
    mapped class, with no table or mapping
    directives of its own, to be garbage collected
    when dereferenced by a unit test.
    [ticket:2526]
2012-07-14 15:41:31 -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 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 e3dbb87d94 - move _fixtures to work via the normal methods of _base.MappedTest, convert
all referncing tests to not use globals
- tests that deal with pickle specifically load the fixture classes
from test.lib.pickleable, which gets some more classes added
- removed weird sa05 pickling tests that don't matter
2011-03-26 20:44:47 -04:00
Mike Bayer cbaa4c9d5d - remove old perf/ tests from pre-2007 2011-01-16 20:24:05 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer 182fc1a7c6 - some good inlinings to the whole cascade_iterator() thing.
cascade_iterator() should probably not yield the "instance" at all
and only deal in states.   30-40K methods taken off the orm2010 test.
2010-12-18 12:14:23 -05:00
Mike Bayer a6e5b66001 - add a perf script to illustrate 0.7 speed improvements 2010-12-12 15:02:22 -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 a104f9d57d - explain that these are not part of the test suite 2010-12-05 19:48:20 -05:00
Mike Bayer f1e54a69fb - merge default tip 2010-12-05 14:56:26 -05:00
Mike Bayer c848624f9d - SqlSoup overhaul
- Added "map_to()" method to SqlSoup, which is a "master"
method which accepts explicit arguments for each aspect of
the selectable and mapping, including a base class per
mapping. [ticket:1975]

- Mapped selectables used with the map(), with_labels(),
join() methods no longer put the given argument into the
internal "cache" dictionary.  Particularly since the
join() and select() objects are created in the method
itself this was pretty much a pure memory leaking behavior.
2010-11-24 12:21:59 -05:00
Mike Bayer e1402efb19 - move sqlalchemy.test to test.lib 2010-11-15 19:37:50 -05:00
Mike Bayer 3cefadd926 a little bit of refinement 2010-04-17 06:44:44 -04:00
Mike Bayer 1cf4a745d8 - beef up the --reversetop test option to embed RandomSet throughout the ORM
- with m2m we have to go back to the previous approach of having both sides of
the DP fire off, tracking each pair of objects.   history may not be consistently present
in one side or the other
- this revealed a whole lot of issues with self-referential m2m, which are fixed
2010-04-15 00:13:48 -04:00
Mike Bayer 44c67fef8c - starting to groom the branch for its inclusion
- one-to-many relationships now maintain a list of positive
parent-child associations within the flush, preventing
previous parents marked as deleted from cascading a
delete or NULL foreign key set on those child objects,
despite the end-user not removing the child from the old
association. [ticket:1764]
- re-established Preprocess as unique on their arguments,
as they were definitely duped in inheritance scenarios
- added a "memo" feature to UOWTransaction which represents the usual
pattern of using the .attributes collection
- added the test case from [ticket:1081] into perf/
2010-04-10 19:21:54 -04:00
Mike Bayer c6bceb7775 - converted all lazy=True|False|None to 'select'|'joined'|'noload'
- converted all eager to joined in examples
- fixed beaker/advanced.py to reference RelationshipCache
2010-03-24 19:19:03 -04:00
Mike Bayer 1675811029 - To accomodate the fact that there are now two kinds of eager
loading available, the new names for eagerload() and
eagerload_all() are joinedload() and joinedload_all().  The
old names will remain as synonyms for the foreseeable future.

- The "lazy" flag on the relationship() function now accepts
a string argument for all kinds of loading: "select", "joined",
"subquery", "noload" and "dynamic", where the default is now
"select".  The old values of True/
False/None still retain their usual meanings and will remain
as synonyms for the foreseeable future.

- Added documentation to tutorial,mapper doc, api docs
for subqueryload, subqueryload_all, and other options.
2010-03-24 19:11:01 -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
Gaëtan de Menten 17fee657a6 timings should use getitem syntax and not the slow getattr one 2010-03-03 20:40:39 +00:00
Gaëtan de Menten 165609a190 - Added an optional C extension to speed up the sql layer by
reimplementing the highest impact functions.
  The actual speedups will depend heavily on your DBAPI and
  the mix of datatypes used in your tables, and can vary from
  a 50% improvement to more than 200%. It also provides a modest
  (~20%) indirect improvement to ORM speed for large queries.
  Note that it is *not* built/installed by default.
  See README for installation instructions.

- The most common result processors conversion function were
  moved to the new "processors" module.  Dialect authors are
  encouraged to use those functions whenever they correspond
  to their needs instead of implementing custom ones.
2010-02-13 22:53:39 +00:00
Mike Bayer aedcd6aea6 - reduced a bit of overhead in attribute expiration, particularly
the version called by column loaders on an incomplete row (i.e.
joined table inheritance).  there are more dramatic changes
that can be made here but this one is conservative so far
as far as how much we're altering how InstanceState tracks
"expired" attributes.
2010-02-13 21:16:08 +00:00
Gaëtan de Menten f4573f73d0 misc cleanups in tests (courtesy of Michael Bayer's revisiting of my
patch)
2010-02-13 20:53:17 +00:00
Mike Bayer ffe0ab5ba6 - For those who might use debug logging on
sqlalchemy.orm.strategies, most logging calls during row
loading have been removed.   These were never very helpful
and cluttered up the code.

- Some internal streamlining of object loading grants a
small speedup for large results, estimates are around
10-15%.
2010-02-13 19:27:14 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00
Mike Bayer 31b95e6cdc - removed test.testing.ORMTest, test.fixtures, and all
dependencies on those.
2009-06-02 21:42:14 +00:00
Michael Trier 4cd99f5536 Global propigate -> propagate change to correct spelling. Additionally found a couple of insures that should be ensure. 2008-11-09 01:53:08 +00:00
Mike Bayer 060c3ce33c - In addition to expired attributes, deferred attributes
also load if their data is present in the result set
[ticket:870]
2008-06-21 16:08:04 +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 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 c0b5a0446b - updated the naming scheme of the base test classes in test/testlib/testing.py;
tests extend from either TestBase or ORMTest, using additional mixins for
special assertion methods as needed
2008-02-11 00:28:39 +00:00
Mike Bayer 2999ea9554 test for session close efficiency 2008-02-08 15:45:54 +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
Jason Kirtland 784eaa108a Added a profiled benchmark for orm attribute modification & flush 2007-11-03 22:03:18 +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 da45a65a48 - Expanded insert speed test to cover execute as well as executemany 2007-10-08 18:51:51 +00:00
Jason Kirtland 9d16ae440b Tightened up time measurement. 2007-09-26 16:13:43 +00:00
Jason Kirtland 75c2230476 Added. 2007-09-22 18:03:27 +00:00
Mike Bayer 9717c71709 merged current entity_management brach r3457-r3462. cleans up
'_state' mamangement in attributes, moves __init__() instrumntation into attributes.py,
and reduces method call overhead by removing '_state' property.
future enhancements may include _state maintaining a weakref to the instance and a
strong ref to its __dict__ so that garbage-collected instances can get added to 'dirty',
when weak-referenced identity map is used.
2007-09-05 17:25:32 +00:00
Mike Bayer 38a55648a1 added sqlite/sa "unprofiled" raw time tests 2007-08-14 17:51:15 +00:00
Mike Bayer ce9828ff07 added full fetching of result columns, cut overall size to 50000 2007-08-14 17:43:03 +00:00
Mike Bayer 55e80ace66 a mass insert/ select benchmarking test, from
http://pyinsci.blogspot.com/2007/07/fastest-python-database-interface.html
2007-08-14 17:34:17 +00:00
Mike Bayer 6c6cd47c02 - fixed endless loop
- fixed perf imports in masseagerload
2007-08-14 03:34:38 +00:00
Mike Bayer ed4fc64bb0 merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to maintenance branch in branches/rel_0_3. 2007-07-27 04:08:53 +00:00
Mike Bayer 687d9342e6 - a new mutex that was added in 0.3.9 causes the pool_timeout
feature to fail during a race condition; threads would
raise TimeoutError immediately with no delay if many threads
push the pool into overflow at the same time.  this issue has been
fixed.
2007-07-20 15:10:56 +00:00
Jason Kirtland 177d30cc01 - Deprecated DynamicMetaData- use ThreadLocalMetaData or MetaData instead
- Deprecated BoundMetaData- use MetaData instead
- Removed DMD and BMD from documentation
2007-07-06 00:58:09 +00:00