Mike Bayer [Wed, 13 Aug 2008 22:41:17 +0000 (22:41 +0000)]
- with 2.3 support dropped,
all usage of thread.get_ident() is removed, and replaced
with threading.local() usage. this allows potentially
faster and safer thread local access.
Mike Bayer [Tue, 12 Aug 2008 20:31:14 +0000 (20:31 +0000)]
- joins along a relation() from a mapped
class to a mapped subclass, where the mapped
subclass is configured with single table
inheritance, will include an
IN clause which limits the subtypes of the
joined class to those requsted, within the
ON clause of the join. This takes effect for
eager load joins as well as query.join().
Note that in some scenarios the IN clause will
appear in the WHERE clause of the query
as well since this discrimination has multiple
trigger points.
Mike Bayer [Mon, 11 Aug 2008 17:18:10 +0000 (17:18 +0000)]
- The composite() property type now supports
a __set_composite_values__() method on the composite
class which is required if the class represents
state using attribute names other than the
column's keynames; default-generated values now
get populated properly upon flush. Also,
composites with attributes set to None compare
correctly. [ticket:1132]
Mike Bayer [Wed, 6 Aug 2008 20:58:48 +0000 (20:58 +0000)]
- Improved the determination of the FROM clause
when placing SQL expressions in the query()
list of entities. In particular scalar subqueries
should not "leak" their inner FROM objects out
into the enclosing query.
Mike Bayer [Tue, 5 Aug 2008 20:15:28 +0000 (20:15 +0000)]
- The RowTuple object returned by Query(*cols) now
features keynames which prefer mapped attribute
names over column keys, column keys over
column names, i.e.
Query(Class.foo, Class.bar) will have names
"foo" and "bar" even if those are not the names
of the underlying Column objects. Direct
Column objects such as Query(table.c.col) will
return the "key" attribute of the Column.
Mike Bayer [Mon, 4 Aug 2008 15:21:29 +0000 (15:21 +0000)]
- fixed endless loop bug which could occur
within a mapper's deferred load of
inherited attributes.
- declarative initialization of Columns adjusted so that
non-renamed columns initialize in the same way as a non
declarative mapper. This allows an inheriting mapper
to set up its same-named "id" columns in particular
such that the parent "id" column is favored over the child
column, reducing database round trips when this value
is requested.
Mike Bayer [Sun, 3 Aug 2008 21:19:32 +0000 (21:19 +0000)]
- compiler visit_label() checks a flag "within_order_by" and will render its own name
and not its contained expression, if the dialect reports true for supports_simple_order_by_label.
the flag is not propagated forwards, meant to closely mimic the syntax Postgres expects which is
that only a simple name can be in the ORDER BY, not a more complex expression or function call
with the label name embedded (mysql and sqlite support more complex expressions).
This further sets the standard for propigation of **kwargs within compiler, that we can't just send
**kwargs along blindly to each XXX.process() call; whenever a **kwarg needs to propagate through,
most methods will have to be aware of it and know when they should send it on forward and when not.
This was actually already the case with result_map as well.
The supports_simple_order_by dialect flag defaults to True but is conservatively explicitly set to
False on all dialects except SQLite/MySQL/Postgres to start.
Mike Bayer [Sun, 3 Aug 2008 18:03:57 +0000 (18:03 +0000)]
- renamed autoexpire to expire_on_commit
- renamed SessionTransaction autoflush to reentrant_flush to more clearly state its purpose
- added _enable_transaction_accounting, flag for Mike Bernson which disables the whole 0.5 transaction state management; the system depends on expiry on rollback in order to function.
Mike Bayer [Sun, 3 Aug 2008 16:52:31 +0000 (16:52 +0000)]
a correction to the recent should_exclude change. should_exclude is a little mixed
up as to when it honors "column_prefix" and when it doesn't, depending on whether or not
the prop is coming from a column name or from an inherited class. Will need more testing
to uncover potential issues here.
Mike Bayer [Sat, 2 Aug 2008 22:21:42 +0000 (22:21 +0000)]
- The "entity_name" feature of SQLAlchemy mappers
has been removed. For rationale, see
http://groups.google.com/group/sqlalchemy/browse_thread/thread/9e23a0641a88b96d?hl=en
Jason Kirtland [Sat, 2 Aug 2008 17:07:33 +0000 (17:07 +0000)]
- Refactored declarative_base() as a thin wrapper over type()
- The supplied __init__ is now optional
- The name of the generated class can be specified
- Accepts multiple bases
Mike Bayer [Thu, 31 Jul 2008 16:41:41 +0000 (16:41 +0000)]
- Fixed bug whereby the "unsaved, pending instance"
FlushError raised for a pending orphan would not take
superclass mappers into account when generating
the list of relations responsible for the error.
Michael Trier [Wed, 23 Jul 2008 05:10:04 +0000 (05:10 +0000)]
Corrected problem with detecting closed connections. Fixed issues in reflecttable for reflecting the mssql tables. Removed unicode reflection test from mssql. Need to investigate this further.
Mike Bayer [Sun, 20 Jul 2008 18:23:44 +0000 (18:23 +0000)]
- An inheriting class can now override an attribute
inherited from the base class with a plain descriptor,
or exclude an inherited attribute via the
include_properties/exclude_properties collections.
Mike Bayer [Sat, 19 Jul 2008 19:23:37 +0000 (19:23 +0000)]
- Some improvements to the _CompileOnAttr mechanism which
should reduce the probability of "Attribute x was
not replaced during compile" warnings. (this generally
applies to SQLA hackers, like Elixir devs).
Mike Bayer [Sat, 19 Jul 2008 18:55:11 +0000 (18:55 +0000)]
- Class-bound attributes sent as arguments to
relation()'s remote_side and foreign_keys parameters
are now accepted, allowing them to be used with declarative.
Mike Bayer [Sat, 19 Jul 2008 18:18:50 +0000 (18:18 +0000)]
- reverted r4955, that was wrong. The backref responsible for the operation is the one where the "cascade" option should take effect.
- can use None as a value for cascade.
- documented cascade options in docstring, [ticket:1064]
Mike Bayer [Fri, 18 Jul 2008 22:11:22 +0000 (22:11 +0000)]
- save-update and delete-orphan cascade event handler
now considers the cascade rules of the event initiator only, not the local
attribute. This way the cascade of the initiator controls the behavior
regardless of backref events.
Mike Bayer [Fri, 18 Jul 2008 17:42:11 +0000 (17:42 +0000)]
- Fixed a series of potential race conditions in
Session whereby asynchronous GC could remove unmodified,
no longer referenced items from the session as they were
present in a list of items to be processed, typically
during session.expunge_all() and dependent methods.
Mike Bayer [Wed, 16 Jul 2008 21:56:23 +0000 (21:56 +0000)]
- MapperProperty gets its .key attribute assigned early, in _compile_property.
MapperProperty compilation is detected using a "_compiled" flag.
- A mapper which inherits from another, when inheriting
the columns of its inherited mapper, will use any
reassigned property names specified in that inheriting
mapper. Previously, if "Base" had reassigned "base_id"
to the name "id", "SubBase(Base)" would still get
an attribute called "base_id". This could be worked
around by explicitly stating the column in each
submapper as well but this is fairly unworkable
and also impossible when using declarative [ticket:1111].
Jason Kirtland [Wed, 16 Jul 2008 18:24:20 +0000 (18:24 +0000)]
- mysql.MSEnum value literals now automatically quoted when used in a CREATE.
The change is backward compatible. Slight expansion of patch from catlee.
Thanks! [ticket:1110]
Mike Bayer [Tue, 15 Jul 2008 14:54:37 +0000 (14:54 +0000)]
- Added a new SessionExtension hook called after_attach().
This is called at the point of attachment for objects
via add(), add_all(), delete(), and merge().
Mike Bayer [Mon, 14 Jul 2008 20:04:35 +0000 (20:04 +0000)]
- The "allow_column_override" flag from mapper() has
been removed. This flag is virtually always misunderstood.
Its specific functionality is available via the
include_properties/exclude_properties mapper arguments.
Mike Bayer [Mon, 14 Jul 2008 19:39:50 +0000 (19:39 +0000)]
possible fix for MS-SQL version of match() test, but the real solution here may be to have the correct default paramstyle set up on the MS-SQL dialect.