Mike Bayer [Fri, 15 Apr 2011 03:44:03 +0000 (23:44 -0400)]
- fixed bug where "from" clause gathering from an
over() clause would be an itertools.chain() and
not a list, causing "can only concatenate list"
TypeError when combined with other clauses.
Mike Bayer [Wed, 13 Apr 2011 23:27:40 +0000 (19:27 -0400)]
- a "having" clause would be copied from the
inside to the outside query if from_self()
were used; in particular this would break
an 0.7 style count() query [ticket:2130].
(also in 0.6.7)
Mike Bayer [Mon, 11 Apr 2011 00:22:11 +0000 (20:22 -0400)]
- Added checks inside the UOW to detect the unusual
condition of being asked to UPDATE or DELETE
on a primary key value that contains NULL
in it. [ticket:2127]
- Some refinements to attribute history. More
changes are pending possibly in 0.8, but
for now history has been modified such that
scalar history doesn't have a "side effect"
of populating None for a non-present value.
This allows a slightly better ability to
distinguish between a None set and no actual
change, affects [ticket:2127] as well.
- rewriting the history tests in test_attributes to be
individual per operation/assertion. its a huge job
so this is partial for the moment.
Mike Bayer [Thu, 7 Apr 2011 21:56:01 +0000 (17:56 -0400)]
- Some fixes to the state handling regarding
backrefs, typically when autoflush=False, where
the back-referenced collection wouldn't
properly handle add/removes with no net
change. Thanks to Richard Murri for the
test case + patch. [ticket:2123]
(also in 0.6.7).
Mike Bayer [Thu, 7 Apr 2011 17:34:38 +0000 (13:34 -0400)]
- The limit/offset keywords to select() as well
as the value passed to select.limit()/offset()
will be coerced to integer. [ticket:2116]
(also in 0.6.7)
- Oracle dialect adds use_binds_for_limits=False
create_engine() flag, will render the LIMIT/OFFSET
values inline instead of as binds, reported to
modify the execution plan used by Oracle.
[ticket:2116] (Also in 0.6.7)
Mike Bayer [Thu, 7 Apr 2011 16:49:29 +0000 (12:49 -0400)]
- Some fixes to "evaulate" and "fetch" evaluation
when query.update(), query.delete() are called.
The retrieval of records is done after autoflush
in all cases, and before update/delete is
emitted, guarding against unflushed data present
as well as expired objects failing during
the evaluation. [ticket:2122]
Mike Bayer [Tue, 5 Apr 2011 16:40:55 +0000 (12:40 -0400)]
- REAL has been added to the core types. Supported
by Postgresql, SQL Server, MySQL, SQLite. Note
that the SQL Server and MySQL versions, which
add extra arguments, are also still available
from those dialects. [ticket:2081]
Mike Bayer [Tue, 5 Apr 2011 16:04:42 +0000 (12:04 -0400)]
- The 'useexisting' flag on Table has been superceded
by a new pair of flags 'keep_existing' and
'extend_existing'. 'extend_existing' is equivalent
to 'useexisting' - the existing Table is returned,
and additional constructor elements are added.
With 'keep_existing', the existing Table is returned,
but additional constructor elements are not added -
these elements are only applied when the Table
is newly created. [ticket:2109]
Mike Bayer [Sat, 2 Apr 2011 20:32:05 +0000 (16:32 -0400)]
- add some function examples, [ticket:2107]
- have "packagenames" be present on FunctionElement by default
so that compiler.visit_function() can be called
- add a test for that
Mike Bayer [Sat, 2 Apr 2011 17:29:11 +0000 (13:29 -0400)]
- Added @event.listens_for() decorator, given
target + event name, applies the decorated
function as a listener. [ticket:2106]
- remove usage of globals from test.base.test_events
Mike Bayer [Wed, 30 Mar 2011 16:30:54 +0000 (12:30 -0400)]
- AssertionPool now stores the traceback indicating
where the currently checked out connection was
acquired; this traceback is reported within
the assertion raised upon a second concurrent
checkout; courtesy Gunnlaugur Briem
[ticket:2103]
Mike Bayer [Mon, 28 Mar 2011 00:34:39 +0000 (20:34 -0400)]
- Documented SQLite DATE/TIME/DATETIME types.
[ticket:2029] (also in 0.6.7)
- add "currentmodule" directive to all the dialect type docs to
ensure users import from the dialect package, not the "base" module
Mike Bayer [Sun, 27 Mar 2011 23:39:39 +0000 (19:39 -0400)]
- Using column names that would require quotes
for the column itself or for a name-generated
bind parameter, such as names with special
characters, underscores, non-ascii characters,
now properly translate bind parameter keys when
talking to cx_oracle. [ticket:2100] (Also
in 0.6.7)
Mike Bayer [Sun, 27 Mar 2011 22:16:40 +0000 (18:16 -0400)]
- fix a callcount
- remove extra _load_fixtures() method. using the classbound version as the fixtures
seem to have everything classlevel at the moment (wondering if we want to change that
for non-classlevel setup/teardown)
Mike Bayer [Sun, 27 Mar 2011 21:52:30 +0000 (17:52 -0400)]
- reorganizing the test modules and fixtures, but keeping the essential method of
creating fixture classes the same, i.e. run a method, then inspect __subclasses__() of
a marked base class, seems to have broken that approach permanently. While the tests run
locally just fine, on the buildbot most of the environments continue to fail in entirely
random places. One of the key changes of the reorganization is that the big bunch of
classes from _fixtures.py is now created ad-hoc instead of reusing a set of module-bound
classes. This means there's a lot more class creation/teardown traffic occuring in the
cPython interpreter. Taking a look at the docs for __subclasses__() confirms that the
list of subclasses is of course a weak-referenced collection. So in the absense of the
tests working just fine for a couple of years, it would seem obvious that the bug
here is setup_classes()/mappers() is called, we come back, the new classes are now
not referenced at all, we then call __subclasses__() and maybe we get them, maybe we don't.
But it's totally not clear how this behavior just hasn't occurred at all for a couple
of years (except, possibly, for very rare occasions that I cannot reproduce). So in this changeset we switch
to a method of class tracking that I use in a lot of other places, that of using a metaclass
to positively stick classes in the registry the moment they are created. Test classes
are already built against a base that is created per-fixture run so we already have the advantage
of a local system. I send this changeset to the buildbot and beg of it to please allow our
tests to pass once again !
Mike Bayer [Sun, 27 Mar 2011 20:27:27 +0000 (16:27 -0400)]
- 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
Mike Bayer [Sun, 27 Mar 2011 19:04:06 +0000 (15:04 -0400)]
- move all the setup_classes(cls) and setup_mappers(cls) to use a
local cls.Basic, cls.Comparable base class so that there is no ambiguity
or hash identity behaviors getting in the way of class registration.
Mike Bayer [Sun, 27 Mar 2011 01:40:05 +0000 (21:40 -0400)]
- convert @provide_metadata to use self access
- having occasional issues with BasicEntity grabbing, if it persists
may have to pass an explicit base class into setup_classes()/setup_mappers()
Mike Bayer [Sun, 27 Mar 2011 00:44:47 +0000 (20:44 -0400)]
- 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
Mike Bayer [Sat, 26 Mar 2011 23:03:11 +0000 (19:03 -0400)]
- remove @testing.resolve_artifact_names, replace with direct attribute
access to the cls/self.tables/classes registries
- express orm/_base.py ORMTest in terms of engine/_base.py TablesTest,
factor out common steps into TablesTest, remove AltEngineTest as a
separate class. will further consolidate these base classes
Mike Bayer [Sat, 26 Mar 2011 15:53:07 +0000 (11:53 -0400)]
- changes to CHANGES
- The "-declarative" changes will now be listed
directly under the "-orm" section, as these
are closely related.
- The 0.5 series changes have been moved to
the file CHANGES_PRE_06 which replaces
CHANGES_PRE_05.
- The changelog for 0.6.7 and subsequent within
the 0.6 series is now listed only in the
CHANGES file within the 0.6 branch.
In the 0.7 CHANGES file all the
0.6 changes are listed inline within the 0.7
section in which they were also applied
(since all 0.6 changes are in 0.7 as well).
Changes that apply to an 0.6 version here
are noted as are if any differences in
implementation/behavior are present.
Mike Bayer [Wed, 23 Mar 2011 21:38:54 +0000 (17:38 -0400)]
- adjust the previous checkin a bit. need to transfer sequences over from pickle
even if they are *not* restated. its necessary here to do a "replacement"
scheme when an incoming sequence replaces the previous. Theoretically
we could do what Table does here, i.e. use a singleton constructor, but
this is heavyhanded. The most recent sequence placed in is the winner
is likely the most expected behavior.
Mike Bayer [Wed, 23 Mar 2011 21:25:57 +0000 (17:25 -0400)]
- Fixed regression whereby MetaData() coming
back from unpickling did not keep track of
new things it keeps track of now, i.e.
collection of Sequence objects, list
of schema names. [ticket:2104]
Mike Bayer [Wed, 23 Mar 2011 03:39:05 +0000 (23:39 -0400)]
- Fixed bug in QueuePool, SingletonThreadPool whereby
connections that were discarded via overflow or periodic
cleanup() were not explicitly closed, leaving garbage
collection to the task instead. This generally only
affects non-reference-counting backends like Jython
and Pypy. Thanks to Jaimy Azle for spotting
this. [ticket:2102]
Mike Bayer [Mon, 21 Mar 2011 15:49:43 +0000 (11:49 -0400)]
- Restored the "catchall" constructor on the base
TypeEngine class, with a deprecation warning.
This so that code which does something like
Integer(11) still succeeds.
Mike Bayer [Sun, 20 Mar 2011 18:00:16 +0000 (14:00 -0400)]
- add attrstrings for all the important mapper() attrbutes, [ticket:2094].
Sticking with quotes here since that's what's used everywhere else.
- rename "API Documentation - XYZ" to "XYZ API".
- move connection API docs to the bottom of that section. still
floating between separate API sections vs. inline API sections, not
sure how to be consistent.
- fix outdated paragraph about derived_attrbutes
- other target function fixes
Mike Bayer [Sun, 20 Mar 2011 16:49:28 +0000 (12:49 -0400)]
- Added new generic function "next_value()", accepts
a Sequence object as its argument and renders the
appropriate "next value" generation string on the
target platform, if supported. Also provides
".next_value()" method on Sequence itself.
[ticket:2085]
- added tests for all the conditions described
in [ticket:2085]
- postgresql dialect will exec/compile a Sequence
that has "optional=True". the optional flag is now only
checked specifically in the context of a Table primary key
evaulation.
- func.next_value() or other SQL expression can
be embedded directly into an insert() construct,
and if implicit or explicit "returning" is used
in conjunction with a primary key column,
the newly generated value will be present in
result.inserted_primary_key. [ticket:2084]
Mike Bayer [Fri, 18 Mar 2011 01:13:14 +0000 (21:13 -0400)]
- some doc reorg
- change engine.Connection to _connection_cls so sphinx doesn't get upset
- globally add "." to all :class:`Foo`
- start naming sections that are mostly docstrings "API Documentation - blah blah"
- move some ad-hoc docstrings into "API" sections, there is some inconsistency here
and it may be that we just have to leave it that way
- add "internals" rsts to core, orm, I'm not super thrilled how these look but they are
targeted by some of the public api docs, users typically become aware of these anyway
Mike Bayer [Thu, 17 Mar 2011 20:22:25 +0000 (16:22 -0400)]
- Fixed bug in query.options() whereby a path
applied to a lazyload using string keys could
overlap a same named attribute on the wrong
entity. Note 0.6 has a more conservative fix
to this. [ticket:2098]
Mike Bayer [Wed, 16 Mar 2011 22:15:27 +0000 (18:15 -0400)]
- Fixed AssertionPool regression bug. A replacement of finalize
logic did the wrong thing, but then also the logic it replaced also
doesn't seem like its needed. If it is, would rather have a test case
first so its out for now, added tests for assertionpool. [ticket:2097]
Mike Bayer [Wed, 16 Mar 2011 18:06:33 +0000 (14:06 -0400)]
- Rewrote the query used to get the definition of a view,
typically when using the Inspector interface, to
use sys.sql_modules instead of the information schema,
thereby allowing views definitions longer than 4000
characters to be fully returned. [ticket:2071]
Mike Bayer [Wed, 16 Mar 2011 16:43:22 +0000 (12:43 -0400)]
- The horizontal_shard ShardedSession class accepts the common
Session argument "query_cls" as a constructor argument,
to enable further subclassing of ShardedQuery.
[ticket:2090]
- The Beaker caching example allows a "query_cls" argument
to the query_callable() function. [ticket:2090]
Mike Bayer [Wed, 16 Mar 2011 16:30:13 +0000 (12:30 -0400)]
- Improvements to the error messages emitted when
querying against column-only entities in conjunction
with (typically incorrectly) using loader options,
where the parent entity is not fully present.
[ticket:2069]