Mike Bayer [Sat, 13 Aug 2011 02:48:40 +0000 (22:48 -0400)]
- add test profiling merge() behavior when merging lots of bidirectional collections/m2os,
collections present in given merge field. This shows that the change proposed
in [ticket:2221] adds over 10% method call overhead including significantly more
SQL statements.
Mike Bayer [Tue, 9 Aug 2011 23:45:20 +0000 (19:45 -0400)]
- Narrowed the assumption made when reflecting
a foreign-key referenced table with schema in
the current search path; an explicit schema will
be applied to the referenced table only if
it actually matches that of the referencing table,
which also has an explicit schema. Previously
it was assumed that "current" schema was synonymous
with the full search_path. [ticket:2249]
Mike Bayer [Sun, 7 Aug 2011 23:04:10 +0000 (19:04 -0400)]
- basic relational patterns -> all declarative. classical mapper folks can
figure it out.
- update self-referential examples to be fully declarative/aliased etc.
Mike Bayer [Sat, 6 Aug 2011 23:30:34 +0000 (19:30 -0400)]
- Repaired edge case where mapper would fail
to fully update internal state when a relationship
on a new mapper would establish a backref on the
first mapper.
- continuing with tutorial, moving eager loading into its
own place and describing more fully
Mike Bayer [Sat, 6 Aug 2011 19:03:33 +0000 (15:03 -0400)]
- Query will convert an OFFSET of zero when
slicing into None, so that needless OFFSET
clauses are not invoked.
- mssql: "0" is accepted as an argument for limit() which
will produce "TOP 0". [ticket:2222]
- add tests to default compiler test for LIMIT/OFFSET generation
Mike Bayer [Sat, 6 Aug 2011 18:23:07 +0000 (14:23 -0400)]
- Fixed bug in query.join() which would occur
in a complex multiple-overlapping path scenario,
where the same table could be joined to
twice. Thanks *much* to Dave Vitek
for the excellent fix here. [ticket:2247]
Mike Bayer [Sat, 6 Aug 2011 01:29:21 +0000 (21:29 -0400)]
- rewrite the docs for association proxy using declarative, add new examples, querying,
etc., part of [ticket:2246]
- add some accessors to AssociationProxy for attributes, test in join(), [ticket:2236]
- update relationship docs to talk about callables, part of [ticket:2246]
Mike Bayer [Thu, 4 Aug 2011 19:34:24 +0000 (15:34 -0400)]
- Ensured that the same ValueError is raised for
illegal date/time/datetime string parsed from
the database regardless of whether C
extensions are in use or not.
Mike Bayer [Mon, 1 Aug 2011 18:16:46 +0000 (14:16 -0400)]
- Added after_soft_rollback() Session event. This
event fires unconditionally whenever rollback()
is called, regardless of if an actual DBAPI
level rollback occurred. This event
is specifically designed to allow operations
with the Session to proceed after a rollback
when the Session.is_active is True.
[ticket:2241]
- SessionTransaction is mentioned in public docs, many
more docstrings for events etc. otherwise
Mike Bayer [Sun, 31 Jul 2011 21:32:07 +0000 (17:32 -0400)]
- Load of a deferred() attribute on an object
where row can't be located raises
ObjectDeletedError instead of failing later
on; improved the message in ObjectDeletedError
to include other conditions besides a simple
"delete". [ticket:2191]
- break up test_get_refreshes() in test_expire
Mike Bayer [Sat, 30 Jul 2011 17:53:41 +0000 (13:53 -0400)]
- add CoerceUTF8 example
- New feature: with_variant() method on
all types. Produces an instance of Variant(),
a special TypeDecorator which will select
the usage of a different type based on the
dialect in use. [ticket:2187]
Mike Bayer [Sat, 30 Jul 2011 16:12:32 +0000 (12:12 -0400)]
- Fixed bug where query.join() + aliased=True
from a joined-inh structure to itself on
relationship() with join condition on the child
table would convert the lead entity into the
joined one inappropriately. [ticket:2234]
Also in 0.6.9.
Mike Bayer [Sat, 30 Jul 2011 15:41:53 +0000 (11:41 -0400)]
- Added public attribute ".validators" to
Mapper, an immutable dictionary view of
all attributes that have been decorated
with the @validates decorator.
[ticket:2240] courtesy Stefano Fontanelli
Mike Bayer [Thu, 28 Jul 2011 15:53:18 +0000 (11:53 -0400)]
- SQLite dialect no longer strips quotes
off of reflected default value, allowing
a round trip CREATE TABLE to work.
This is consistent with other dialects
that also maintain the exact form of
the default. [ticket:2189]
Mike Bayer [Mon, 25 Jul 2011 00:41:42 +0000 (20:41 -0400)]
- rework Annotated to no longer use __cmp__(), supply an __eq__() that
works with ColumnElement as well as works with non-__eq__() suppliers,
works with sets, on Py3K as well.
Mike Bayer [Sun, 24 Jul 2011 21:51:01 +0000 (17:51 -0400)]
- rewrite cloned_traverse() and replacement_traverse() to use a straight
recursive descent with clone() + _copy_internals(). This is essentially
what it was doing anyway with lots of unnecessary steps.
Fix Alias() to honor the given clone() function which may have been the
reason the traversal hadn't been fixed sooner. Alias._copy_internals()
will specifically skip an alias of a Table
as a more specific form of what it was doing before. This may need to
be further improved such that ClauseAdapter or replacement_traverse()
send it some specific hints what not to dig into; **kw has been added
to all _copy_internals() to support this. replacement/clone traversal
is at least clear now.
- apply new no_replacement_traverse annotation to join created by
_create_joins(), fixes [ticket:2195]
- can replace orm.query "_halt_adapt" with "no_replacement_traverse"
Mike Bayer [Sun, 24 Jul 2011 16:37:48 +0000 (12:37 -0400)]
- Fixed regression from 0.6 where Session.add()
against an object which contained None in a
collection would raise an internal exception.
Reverted this to 0.6's behavior which is to
accept the None but obviously nothing is
persisted. Ideally, collections with None
present or on append() should at least emit a
warning, which is being considered for 0.8.
[ticket:2205]
Mike Bayer [Sun, 24 Jul 2011 15:45:30 +0000 (11:45 -0400)]
- Fixed bug apparent only in Python 3 whereby
sorting of persistent + pending objects during
flush would produce an illegal comparison,
if the persistent object primary key
is not a single integer. [ticket:2228]
Also in 0.6.9
Mike Bayer [Thu, 21 Jul 2011 15:44:31 +0000 (11:44 -0400)]
- Added an informative error message when
ForeignKeyConstraint refers to a column name in
the parent that is not found. Also in 0.6.9.
- add tests for [ticket:2226], as if we hit each @declared_attr
directly with obj.__get__(obj, name) instead of using
getattr(cls, name). Basic inheritance mechanics are improperly
used in this case, so 2226 is invalid.
Mike Bayer [Wed, 20 Jul 2011 22:30:57 +0000 (18:30 -0400)]
- Fixed regression from 0.6 where a get history
operation on some relationship() based attributes
would fail when a lazyload would emit; this could
trigger within a flush() under certain conditions.
[ticket:2224] Thanks to the user who submitted
the great test for this.
Mike Bayer [Wed, 20 Jul 2011 22:03:35 +0000 (18:03 -0400)]
- Fixed bug whereby the source clause
used by query.join() would be inconsistent
if against a column expression that combined
multiple entities together. [ticket:2197]
Mike Bayer [Wed, 20 Jul 2011 14:49:36 +0000 (10:49 -0400)]
- Added new "postgresql_ops" argument to
Index, allows specification of PostgreSQL
operator classes for indexed columns.
[ticket:2198] Courtesy Filip Zyzniewski.
Mike Bayer [Sun, 17 Jul 2011 20:44:37 +0000 (16:44 -0400)]
- Fixed bug whereby if a mapped class
redefined __hash__() or __eq__() to something
non-standard, which is a supported use case
as SQLA should never consult these,
the methods would be consulted if the class
was part of a "composite" (i.e. non-single-entity)
result set. [ticket:2215]
Also in 0.6.9.
Mike Bayer [Sun, 17 Jul 2011 19:14:03 +0000 (15:14 -0400)]
- Feature enhancement: joined and subquery
loading will now traverse already-present related
objects and collections in search of unpopulated
attributes throughout the scope of the eager load
being defined, so that the eager loading that is
specified via mappings or query options
unconditionally takes place for the full depth,
populating whatever is not already populated.
Previously, this traversal would stop if a related
object or collection were already present leading
to inconsistent behavior (though would save on
loads/cycles for an already-loaded graph). For a
subqueryload, this means that the additional
SELECT statements emitted by subqueryload will
invoke unconditionally, no matter how much of the
existing graph is already present (hence the
controversy). The previous behavior of "stopping"
is still in effect when a query is the result of
an attribute-initiated lazyload, as otherwise an
"N+1" style of collection iteration can become
needlessly expensive when the same related object
is encountered repeatedly. There's also an
as-yet-not-public generative Query method
_with_invoke_all_eagers()
which selects old/new behavior [ticket:2213]
Mike Bayer [Thu, 7 Jul 2011 15:34:59 +0000 (11:34 -0400)]
- add a latex Makefile to texinputs that gets copied on latex build,
ensures pdflatex/latex errors are totally ignored
- fix all SQL/code examples in the inherits doc to be within 79 chars.
will need to do this for all the docs to get pdf to not look crappy.
- add an abspath to the "templates" dir, not sure of the rationale
here but is harmless, [ticket:2211]
- integrate pdf build with site-mako build
Mike Bayer [Wed, 6 Jul 2011 16:35:45 +0000 (12:35 -0400)]
- The join condition produced by with_parent
as well as when using a "dynamic" relationship
against a parent will generate unique
bindparams, rather than incorrectly repeating
the same bindparam. [ticket:2207].
Also in 0.6.9.
Mike Bayer [Mon, 4 Jul 2011 20:31:58 +0000 (16:31 -0400)]
- fix pypostgresql typo, [ticket:2185]
- rewrite "getting a session" docs to delineate
all sessionmaker() use cases distinctly
- rewrite "Managing Transactions" doc to spell out
each specific step completely, [ticket:2204]
- add to create_engine() and main "engine" doc
an unambiguous statement that the create_engine()
does not create a connection
- other link fixes
- rewrite "deleting" section so that "deleting from collections"
is separate, well-described, [ticket:2202]
- rephrase "autocommit mode" into its own section, move it down,
put some bold text that you shouldn't be using it.
- simplify the "subtransactions" section and make it local to
"autocommit" since it is utterly unneeded by anybody.
- oracle is not doing 2-phase anytime soon
Mike Bayer [Mon, 4 Jul 2011 17:56:17 +0000 (13:56 -0400)]
- Added an improved repr() to TypeEngine objects
that will only display constructor args which
are positional or kwargs that deviate
from the default. [ticket:2209]
Mike Bayer [Fri, 1 Jul 2011 21:09:57 +0000 (17:09 -0400)]
- add doc to schema docs linking to declarative usage of __table__
- add more examples to __table__ such as that asked on a recent
stackoverflow question.
Mike Bayer [Fri, 1 Jul 2011 20:52:11 +0000 (16:52 -0400)]
- Failures on connect which raise dbapi.Error
will forward the error to dialect.is_disconnect()
and set the "connection_invalidated" flag if
the dialect knows this to be a potentially
"retryable" condition. Only Oracle ORA-01033
implemented for now. [ticket:2201]
- Added ORA-01033 to disconnect codes, which
can be caught during a connection
event. [ticket:2201]
Mike Bayer [Fri, 1 Jul 2011 15:32:07 +0000 (11:32 -0400)]
- Fixed bug in the mutable extension whereby
if None or a non-corresponding type were set,
an error would be raised. None is now accepted
which assigns None to all attributes,
illegal values raise ValueError.
Mike Bayer [Thu, 30 Jun 2011 22:48:01 +0000 (18:48 -0400)]
- Fixed bug where "autoincrement" detection on
Table would fail if the type had no "affinity"
value, in particular this would occur when using
the UUID example on the site that uses TypeEngine
as the "impl".
Mike Bayer [Thu, 30 Jun 2011 14:43:53 +0000 (10:43 -0400)]
- Fixed bug in the mutable extension whereby
if the same type were used twice in one
mapping, the attributes beyond the first
would not get instrumented.
Mike Bayer [Thu, 30 Jun 2011 14:27:52 +0000 (10:27 -0400)]
- Fixed bug whereby adaptation of old append_ddl_listener()
function was passing unexpected **kw through
to the Table event. Table gets no kws, the MetaData
event in 0.6 would get "tables=somecollection",
this behavior is preserved. [ticket:2206]
Mike Bayer [Mon, 27 Jun 2011 23:25:35 +0000 (19:25 -0400)]
- Fixed subtle bug that caused SQL to blow
up if: column_property() against subquery +
joinedload + LIMIT + order by the column
property() occurred. [ticket:2188].
Also in 0.6.9
Mike Bayer [Thu, 23 Jun 2011 23:54:50 +0000 (19:54 -0400)]
- the "cascade" section of the session doc was totally screwed up, mappings
used the wrong form, example for cascade_backref used the wrong names.
- rewrite relationship cascade_backrefs doc
Mike Bayer [Wed, 22 Jun 2011 15:45:28 +0000 (11:45 -0400)]
- Added mixin class sqlalchemy.ext.DontWrapMixin.
User-defined exceptions of this type are never
wrapped in StatementException when they
occur in the context of a statement
execution.
- StatementException wrapping will display the
original exception class in the message.
Mike Bayer [Tue, 21 Jun 2011 14:01:46 +0000 (10:01 -0400)]
- Repaired the "no statement condition"
assertion in Query which would attempt
to raise if a generative method were called
after from_statement() were called.
[ticket:2199]. Also in 0.6.9.
Mike Bayer [Thu, 16 Jun 2011 16:09:45 +0000 (12:09 -0400)]
- Repaired the examples/versioning test runner
to not rely upon SQLAlchemy test libs,
nosetests must be run from within
examples/versioning to get around setup.cfg
breaking it.
- Tweak to examples/versioning to pick the
correct foreign key in a multi-level
inheritance situation.
Mike Bayer [Tue, 14 Jun 2011 14:08:34 +0000 (10:08 -0400)]
- Fixed declarative bug where a class inheriting
from a superclass of the same name would fail
due to an unnecessary lookup of the name
in the _decl_class_registry. [ticket:2194]
Mike Bayer [Mon, 13 Jun 2011 00:35:37 +0000 (20:35 -0400)]
- Fixed bug whereby comparison of column
expression to a Query() would not call
as_scalar() on the underlying SELECT
statement to produce a scalar subquery,
in the way that occurs if you called
it on Query().subquery(). [ticket:2190]
- some cleanup to test.orm.test_query