Mike Bayer [Mon, 16 Jul 2012 21:29:02 +0000 (17:29 -0400)]
- express most of the orm.util functions in terms of the inspection system
- modify inspection system:
1. raise a new exception for any case where the inspection
context can't be returned. this supersedes the "not mapped"
errors.
2. don't configure mappers on a mapper inspection. this allows
the inspectors to be used during mapper config time. instead,
the mapper configures on "with_polymorphic_selectable" now,
which is needed for all queries
- add a bunch of new "is_XYZ" attributes to inspectors
- finish making the name change of "compile" -> "configure", for some reason
this was only done partially
Mike Bayer [Sun, 15 Jul 2012 00:33:16 +0000 (20:33 -0400)]
- [bug] Fixed bug mostly local to new
AbstractConcreteBase helper where the "type"
attribute from the superclass would not
be overridden on the subclass to produce the
"reserved for base" error message, instead placing
a do-nothing attribute there. This was inconsistent
vs. using ConcreteBase as well as all the behavior
of classical concrete mappings, where the "type"
column from the polymorphic base would be explicitly
disabled on subclasses, unless overridden
explicitly.
Mike Bayer [Sat, 14 Jul 2012 19:41:31 +0000 (15:41 -0400)]
- [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]
Mike Bayer [Sat, 14 Jul 2012 18:24:51 +0000 (14:24 -0400)]
- [feature] The registry of classes
in declarative_base() is now a
WeakValueDictionary. So subclasses of
"Base" that are dereferenced will be
garbage collected, *if they are not
referred to by any other mappers/superclass
mappers*. [ticket:2526]
Mike Bayer [Sat, 14 Jul 2012 16:52:21 +0000 (12:52 -0400)]
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.
Mike Bayer [Tue, 10 Jul 2012 15:00:49 +0000 (11:00 -0400)]
- [bug] Fixed more un-intuitivenesses in CTEs
which prevented referring to a CTE in a union
of itself without it being aliased.
CTEs now render uniquely
on name, rendering the outermost CTE of a given
name only - all other references are rendered
just as the name. This even includes other
CTE/SELECTs that refer to different versions
of the same CTE object, such as a SELECT
or a UNION ALL of that SELECT. We are
somewhat loosening the usual link between object
identity and lexical identity in this case.
A true name conflict between two unrelated
CTEs now raises an error.
Mike Bayer [Thu, 5 Jul 2012 14:19:59 +0000 (10:19 -0400)]
- [bug] ORM will perform extra effort to determine
that an FK dependency between two tables is
not significant during flush if the tables
are related via joined inheritance and the FK
dependency is not part of the inherit_condition,
saves the user a use_alter directive.
[ticket:2527]
Mike Bayer [Mon, 25 Jun 2012 16:42:47 +0000 (12:42 -0400)]
- move cte tests into their own test/sql/test_cte.py
- rework bindtemplate system of "numbered" params by applying
the numbers last, as we now need to generate these out of order
in some cases
- add positional assertion to assert_compile
- add new cte_positional collection to track bindparams generated
within cte visits; splice this onto the beginning of self.positiontup
at cte render time, [ticket:2521]
Mike Bayer [Sun, 24 Jun 2012 06:06:10 +0000 (02:06 -0400)]
- [moved] The InstrumentationManager interface
and the entire related system of alternate
class implementation is now moved out
to sqlalchemy.ext.instrumentation. This is
a seldom used system that adds significant
complexity and overhead to the mechanics of
class instrumentation. The new architecture
allows it to remain unused until
InstrumentationManager is actually imported,
at which point it is bootstrapped into
the core.
Mike Bayer [Sat, 23 Jun 2012 18:45:47 +0000 (14:45 -0400)]
- move all of orm to use absolute imports
- break out key mechanics of loading objects
into new "orm.loading" module, removing implementation
details from both mapper.py and query.py. is analogous
to persistence.py
- some other cleanup and old cruft removal
Mike Bayer [Fri, 22 Jun 2012 16:42:01 +0000 (12:42 -0400)]
- [bug] Fixed bug whereby if a database restart
affected multiple connections, each
connection would individually invoke a new
disposal of the pool, even though only
one disposal is needed. [ticket:2522]
Mike Bayer [Fri, 22 Jun 2012 16:24:08 +0000 (12:24 -0400)]
- [bug] Fixed bug whereby
a disconnect detect + dispose that occurs
when the QueuePool has threads waiting
for connections would leave those
threads waiting for the duration of
the timeout on the old pool. The fix
now notifies those waiters with a special
exception case and has them move onto
the new pool. This fix may or may
not be ported to 0.7. [ticket:2522]
Mike Bayer [Thu, 21 Jun 2012 20:49:29 +0000 (16:49 -0400)]
- [bug] quoting is applied to the column names
inside the WITH RECURSIVE clause of a
common table expression according to the
quoting rules for the originating Column.
[ticket:2512]
Mike Bayer [Thu, 21 Jun 2012 20:32:38 +0000 (16:32 -0400)]
- [feature] Added "MATCH" clause to ForeignKey,
ForeignKeyConstraint, courtesy Ryan Kelly.
[ticket:2502]
- [feature] Added support for DELETE and UPDATE from
an alias of a table, which would assumedly
be related to itself elsewhere in the query,
courtesy Ryan Kelly. [ticket:2507]
- [feature] Added support for the Postgresql ONLY
keyword, which can appear corresponding to a
table in a SELECT, UPDATE, or DELETE statement.
The phrase is established using with_hint().
Courtesy Ryan Kelly [ticket:2506]
Mike Bayer [Thu, 21 Jun 2012 18:55:04 +0000 (14:55 -0400)]
- [bug] Fixed regression introduced in 0.7.6
whereby the FROM list of a SELECT statement
could be incorrect in certain "clone+replace"
scenarios. [ticket:2518]
Mike Bayer [Wed, 20 Jun 2012 23:28:29 +0000 (19:28 -0400)]
- [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
Mike Bayer [Wed, 20 Jun 2012 22:55:13 +0000 (18:55 -0400)]
- [feature] Dramatic improvement in memory
usage of the event system; instance-level
collections are no longer created for a
particular type of event until
instance-level listeners are established
for that event. [ticket:2516] Also in 0.7.9.
Mike Bayer [Sat, 16 Jun 2012 23:02:48 +0000 (19:02 -0400)]
- [bug] Fixed bug whereby append_column()
wouldn't function correctly on a cloned
select() construct, courtesy
Gunnlaugur Por Briem. [ticket:2482]
Also in 0.7.8.
Mike Bayer [Sat, 16 Jun 2012 22:41:54 +0000 (18:41 -0400)]
- [bug] The ResultProxy methods inserted_primary_key,
last_updated_params(), last_inserted_params(),
postfetch_cols(), prefetch_cols() all
assert that the given statement is a compiled
construct, and is an insert() or update()
statement as is appropriate, else
raise InvalidRequestError. [ticket:2498]
- ResultProxy.last_inserted_ids is removed,
replaced by inserted_primary_key.
Mike Bayer [Wed, 13 Jun 2012 22:21:42 +0000 (18:21 -0400)]
- [bug] Repaired common table expression
rendering to function correctly when the
SELECT statement contains UNION or other
compound expressions, courtesy btbuilder.
[ticket:2490]
Mike Bayer [Tue, 12 Jun 2012 00:11:05 +0000 (20:11 -0400)]
- [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.
Mike Bayer [Fri, 8 Jun 2012 19:56:58 +0000 (15:56 -0400)]
Add some `Sphinx` related version informations paragraph-level markups,
such as ``.. versionaddedd::``, ``.. versionchanged::`` and ``.. deprecated::``.
Mike Bayer [Fri, 1 Jun 2012 20:22:44 +0000 (16:22 -0400)]
- [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]
Mike Bayer [Thu, 24 May 2012 22:49:23 +0000 (18:49 -0400)]
- [bug] Dialect no longer emits expensive server
collations query, as well as server casing,
on first connect. These functions are still
available as semi-private. [ticket:2404]
Mike Bayer [Thu, 24 May 2012 14:58:43 +0000 (10:58 -0400)]
- identify another condition, indirectly via #2491, where
remote/local detection was regressing vs. 0.7. use a more
liberal check for "tables overlap".
Mike Bayer [Thu, 24 May 2012 14:17:54 +0000 (10:17 -0400)]
- [bug] Fixed bug in declarative
whereby the precedence of columns
in a joined-table, composite
column (typically for id) would fail to
be correct if the columns contained
names distinct from their attribute
names. This would cause things like
primaryjoin conditions made against the
entity attributes to be incorrect. Related
to [ticket:1892] as this was supposed
to be part of that, this is [ticket:2491].
Also in 0.7.8.
Mike Bayer [Fri, 18 May 2012 14:55:28 +0000 (10:55 -0400)]
- reorganize the usage of __mapper_args__ so that it's only
called after the __prepare__() step, if any, so that everything to
do with the mapping occurs after the table is reflected.
Mike Bayer [Thu, 17 May 2012 19:48:39 +0000 (15:48 -0400)]
- [feature] Added utility feature
Session.enable_relationship_loading(),
supersedes relationship.load_on_pending.
Both features should be avoided, however.
[ticket:2372]
Mike Bayer [Thu, 17 May 2012 18:18:05 +0000 (14:18 -0400)]
- [bug] Fixed bug whereby subqueryload() from
a polymorphic mapping to a target would incur
a new invocation of the query for each
distinct class encountered in the polymorphic
result. [ticket:2480]. Also in 0.7.8.