Commit Graph

192 Commits

Author SHA1 Message Date
Mike Bayer 576224edd0 - add workaround for sqlite memusage tests, so no longer need to count to 220/skip tests
- Fixed potential memory leak which could occur if an
arbitrary number of :class:`.sessionmaker` objects
were created.   The anonymous subclass created by
the sessionmaker, when dereferenced, would not be garbage
collected due to remaining class-level references from the
event package.  This issue also applies to any custom system
that made use of ad-hoc subclasses in conjunction with
an event dispatcher.  Also in 0.7.10. [ticket:2650]
2013-01-12 17:21:35 -05:00
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 0f56aa56c5 need to disable hstore for the "player" here. should really get rid of the recorder/player thing
at this point
2012-11-18 03:01:49 -05:00
Mike Bayer 08f104f7e7 - import fixes 2012-09-29 16:58:00 -04:00
Mike Bayer be40b51cb0 getting everything to pass again 2012-09-27 16:33:54 -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 a2468c8a31 - [feature] To complement [ticket:2547], types
can now provide "bind expressions" and
"column expressions" which allow compile-time
injection of SQL expressions into statements
on a per-column or per-bind level.   This is
to suit the use case of a type which needs
to augment bind- and result- behavior at the
SQL level, as opposed to in the Python level.
Allows for schemes like transparent encryption/
decryption, usage of Postgis functions, etc.
[ticket:1534]
- update postgis example fully.
- still need to repair the result map propagation
here to be transparent for cases like "labeled column".
2012-08-17 18:35:25 -04:00
Mike Bayer a4c651420b - this is a refcount test 2012-08-11 17:55:37 -04:00
Mike Bayer 48c9993b65 OK! let's turn this around completely. Forget making a single count across
all platforms.  let's instead store callcounts for *all* observed platforms in a datafile.
Will try to get enough platforms in the file for jenkins to have meaningful results.
for platforms not in the file, it's just skiptest.
2012-08-11 15:51:08 -04:00
Mike Bayer 3986fd7626 adjustments 2012-08-11 02:57:25 -04:00
Mike Bayer 2f522bd221 final cleanup 2012-08-10 11:10:21 -04:00
Mike Bayer 153248cf7b adjust 2012-08-09 17:49:36 -04:00
Mike Bayer 92ceb399c9 - make sure event mechanics have completed before running this test, lower callcount 2012-08-09 17:38:59 -04:00
Mike Bayer 781fff75d0 adjustment 2012-08-09 16:52:11 -04:00
Mike Bayer 4e54072397 more adjustments 2012-08-09 16:43:46 -04:00
Mike Bayer 442237afaa - a new approach to profiling where we attempt to strip out
parts of the pstats that are idiosyncratic to different platforms.
the goal is no per-version assertions on tests, version differences
in theory would go into the list of profiling exceptions.
2012-08-09 16:08:48 -04:00
Mike Bayer c13d4f613f - fixes 2012-08-07 14:55:41 -04:00
Mike Bayer 22ba1c43b7 -whitespace bonanza, contd 2012-07-28 17:05:50 -04:00
Mike Bayer 27913554a8 trailing whitespace bonanza 2012-07-28 15:50:05 -04:00
Mike Bayer 37ced0946c - some more interpret_as_froms 2012-07-23 20:59:46 -04:00
Mike Bayer 2bee05098e callcounts due to more engine event logic 2012-07-19 09:49:36 -04:00
Mike Bayer 6051636d89 try to get these to pass on jenkins 2012-07-17 12:41:06 -04:00
Mike Bayer 5b2df4215f relax this variance for now 2012-07-17 09:33:52 -04:00
Mike Bayer 8f04c53191 some test fixes and cleanup 2012-07-16 17:37:32 -04:00
Mike Bayer 9cab0f1f16 move mapper-level UOW functionality straight into unitofwork also. there's
no need for this to be per-mapper.   can't move dependency init
off of property though as this init needs to happen up front, added a test
to prove it.
2012-07-14 12:52:21 -04:00
Mike Bayer a1a58219c2 turn commit_all into an iterative method 2012-06-25 13:12:48 -04:00
Mike Bayer 467f7c1e02 - somehting is making this test have an inconsistent callcount 2012-06-24 02:07:43 -04:00
Mike Bayer 04e6faa2d9 callcounts, due to the DummyLock cleanup 2012-06-23 11:46:47 -04:00
Mike Bayer bc15fb6066 a likely callcount 2012-06-21 01:50:59 -04:00
Mike Bayer e4efa7f5d0 callcount 2012-06-20 19:39:35 -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 df8f0f5d6b obnoxious callcounts 2012-06-16 19:55:35 -04:00
Mike Bayer 9c1a311139 callcount fix 2012-06-13 10:12:16 -04:00
Mike Bayer c238fb0c62 weird, seems like hasattr() doesn't count as a function call in the same way as isinstance()... 2012-06-12 10:32:52 -04:00
Mike Bayer 5cc0bb0474 - [bug] Fixed bug affecting Py3K whereby
string positional parameters passed to
engine/connection execute() would fail to be
interpreted correctly, due to __iter__
being present on Py3K string.
[ticket:2503].  Also in 0.7.8.
2012-06-11 20:11:05 -04:00
Mike Bayer 405b00f1de callcount 2012-06-11 19:44:58 -04:00
Mike Bayer e6749b6973 make sure integer is here. only the C ext doesn't try to call "key_fallback" for integer here,
pure python one does.
2012-06-11 12:15:15 -04:00
Mike Bayer 34124e6e3a callcount adjust 2012-06-08 14:43:52 -04:00
Mike Bayer c6d599f993 - [bug] Fixed memory leak in C version of
result proxy whereby DBAPIs which don't deliver
    pure Python tuples for result rows would
    fail to decrement refcounts correctly.
    The most prominently affected DBAPI
    is pyodbc.  [ticket:2489]
2012-06-01 16:22:44 -04:00
Mike Bayer 554200e3e5 callcount bump to work around sqlite's silly column name workaround 2012-05-04 20:44:12 -04:00
Mike Bayer dab892d14f callcount 2012-04-24 22:17:53 -04:00
Mike Bayer 09e8c9240c py3k fixes 2012-04-24 19:15:00 -04:00
Mike Bayer 9cf10db8aa - [feature] Calling rollback() within a
session.begin_nested() will now only expire
those objects that had net changes within the
scope of that transaction, that is objects which
were dirty or were modified on a flush.  This
allows the typical use case for begin_nested(),
that of altering a small subset of objects, to
leave in place the data from the larger enclosing
set of objects that weren't modified in
that sub-transaction.  [ticket:2452]
- inline the "register_newly_XYZ" functions to operate
upon collections to reduce method calls
2012-04-24 18:06:27 -04:00
Mike Bayer 87bbba32bc - [feature] The behavior of column targeting
in result sets is now case sensitive by
default.   SQLAlchemy for many years would
run a case-insensitive conversion on these values,
probably to alleviate early case sensitivity
issues with dialects like Oracle and
Firebird.   These issues have been more cleanly
solved in more modern versions so the performance
hit of calling lower() on identifiers is removed.
The case insensitive comparisons can be re-enabled
by setting "case_insensitive=False" on
create_engine().  [ticket:2423]
2012-04-24 16:03:00 -04:00
Mike Bayer 1bab44c2ba callcount tweak here, this moved up due to r5b6237e3f068 2012-04-24 11:34:56 -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 101da94e12 the callcounts are greater here since object_mapper() has a little more overhead to it now 2012-04-23 18:53:58 -04:00
Mike Bayer ee5dd855a7 - some adjustments to keep hybrid properties working
- callcount here seems to have gone up by five, reason not certain
2012-04-23 12:48:26 -04:00
Mike Bayer 713a4e19fa - merged #1401 branch from bitbucket
- resolved some serious speed hits I missed, we need to ensure
only deannotated columns are used in the local/remote collections and soforth
so that hash lookups against mapped columns don't dig into __eq__()
- fix some other parity mismatches regarding stuff from [ticket:2453],
including finding another case where _deep_annotate() was doing the wrong thing,
new tests.
- [feature] Major rewrite of relationship()
internals now allow join conditions which
include columns pointing to themselves
within composite foreign keys.   A new
API for very specialized primaryjoin conditions
is added, allowing conditions based on
SQL functions, CAST, etc. to be handled
by placing the annotation functions
remote() and foreign() inline within the
expression when necessary.  Previous recipes
using the semi-private _local_remote_pairs
approach can be upgraded to this new
approach. [ticket:1401]
2012-04-22 19:43:31 -04:00
Mike Bayer 768bd7ec0a callcounts for py3k 2012-03-14 17:19:15 -07:00