Mike Bayer [Sat, 8 Jan 2011 20:33:38 +0000 (15:33 -0500)]
- Threadlocal engine returns itself upon begin(),
begin_nested(); engine then implements contextmanager
methods to allow the "with" statement. [ticket:2004]
Mike Bayer [Thu, 6 Jan 2011 17:25:17 +0000 (12:25 -0500)]
- Fixed bug regarding "subqueryload" strategy whereby
the join would fail if using a multi-level load
of the form from A->joined-subclass->C [ticket:2014]
Mike Bayer [Tue, 4 Jan 2011 17:38:54 +0000 (12:38 -0500)]
- sorry, I really don't want metaclass recipes in the main documentation. Don't
want people using them, thinking they're needed in the general case, confused, etc.
The two sections here are moved to the wiki for now.
Mike Bayer [Tue, 4 Jan 2011 02:11:12 +0000 (21:11 -0500)]
- Firebird numeric type now checks for Decimal explicitly,
lets float() pass right through, thereby allowing
special values such as float('inf'). [ticket:2012]
Mike Bayer [Thu, 30 Dec 2010 17:20:03 +0000 (12:20 -0500)]
- A little more verbiage to the "primaryjoin" error,
in an unusual condition that the join condition
"works" for viewonly but doesn't work for non-viewonly,
and foreign_keys wasn't used - adds "foreign_keys" to
the suggestion. Also add "foreign_keys" to the
suggestion for the generic "direction" error.
Mike Bayer [Tue, 28 Dec 2010 19:56:26 +0000 (14:56 -0500)]
- A warning is emitted when version_id_col is specified
on an inheriting mapper when the inherited mapper
already has one, if those column expressions are not
the same. [ticket:1987]
Mike Bayer [Tue, 21 Dec 2010 20:58:28 +0000 (15:58 -0500)]
- Fixed bug which prevented composite mapped
attributes from being used on a mapped select statement.
[ticket:1997]. Note the workings of composite are slated to
change significantly in 0.7.
Mike Bayer [Wed, 15 Dec 2010 21:26:05 +0000 (16:26 -0500)]
- Fixed uow bug whereby expired objects passed to
Session.delete() would not have unloaded references
or collections taken into account when deleting
objects, despite passive_deletes remaining at
its default of False. [ticket:2002]
Mike Bayer [Wed, 8 Dec 2010 18:46:29 +0000 (13:46 -0500)]
- Threadlocal engine methods rollback(), commit(),
prepare() won't raise if no transaction is in progress;
this was a regression introduced in 0.6. [ticket:1998]
Mike Bayer [Sun, 28 Nov 2010 16:10:41 +0000 (11:10 -0500)]
- Query.get() will raise if the number of params
in a composite key is too large, as well as too
small. [ticket:1977]
- the above change smoked out an old mistake in a unit test.
Gaëtan de Menten [Sat, 27 Nov 2010 21:27:42 +0000 (22:27 +0100)]
fixed a small potential memory leak in UnicodeResultProcessor (for some weird
reason, it didn't actually leak in my tests) by providing a dealloc method to
the type, and added a test to ensure it stays that way. Closes #1981.
Mike Bayer [Thu, 25 Nov 2010 17:20:13 +0000 (12:20 -0500)]
- Fixed operator precedence rules for multiple
chains of a single non-associative operator.
I.e. "x - (y - z)" will compile as "x - (y - z)"
and not "x - y - z". Also works with labels,
i.e. "x - (y - z).label('foo')"
[ticket:1984]
- Single element tuple expressions inside an IN clause
parenthesize correctly, also from [ticket:1984],
added tests for PG
- re-fix again importlater, [ticket:1983]
Mike Bayer [Wed, 24 Nov 2010 17:21:59 +0000 (12:21 -0500)]
- SqlSoup overhaul
- Added "map_to()" method to SqlSoup, which is a "master"
method which accepts explicit arguments for each aspect of
the selectable and mapping, including a base class per
mapping. [ticket:1975]
- Mapped selectables used with the map(), with_labels(),
join() methods no longer put the given argument into the
internal "cache" dictionary. Particularly since the
join() and select() objects are created in the method
itself this was pretty much a pure memory leaking behavior.
Mike Bayer [Fri, 19 Nov 2010 23:44:09 +0000 (18:44 -0500)]
- active_history flag also added to composite().
The flag has no effect in 0.6, but is instead
a placeholder flag for forwards compatibility,
as it will be needed in 0.7 for composites.
[ticket:1976]
Mike Bayer [Thu, 18 Nov 2010 23:44:35 +0000 (18:44 -0500)]
- Added as_uuid=True flag to the UUID type, will receive
and return values as Python UUID() objects rather than
strings. Currently, the UUID type is only known to
work with psycopg2. [ticket:1956]
Mike Bayer [Thu, 18 Nov 2010 19:55:19 +0000 (14:55 -0500)]
- Added active_history flag to relationship()
and column_property(), forces attribute events to
always load the "old" value, so that it's available to
attributes.get_history(). [ticket:1961]
- modernize test_relationship, give test classes meaningful names
Mike Bayer [Thu, 18 Nov 2010 17:19:31 +0000 (12:19 -0500)]
- The cx_oracle "decimal detection" logic, which takes place
for for result set columns with ambiguous numeric characteristics,
now uses the decimal point character determined by the locale/
NLS_LANG setting, using an on-first-connect detection of
this character. cx_oracle 5.0.3 or greater is also required
when using a non-period-decimal-point NLS_LANG setting.
[ticket:1953].
Mike Bayer [Sat, 13 Nov 2010 18:19:36 +0000 (13:19 -0500)]
- move inline "import" statements to use new "util.importlater()" construct. cuts
down on clutter, timeit says there's a teeny performance gain, at least where
the access is compared against attr.subattr. these aren't super-critical
calls anyway
- slight inlining in _class_to_mapper
Mike Bayer [Fri, 12 Nov 2010 15:49:17 +0000 (10:49 -0500)]
- On the same theme, the REFERENCES clause in a CREATE TABLE
that includes a remote schema to a *different* schema
than that of the parent table doesn't render at all,
as cross-schema references do not appear to be supported.
Mike Bayer [Fri, 12 Nov 2010 15:36:03 +0000 (10:36 -0500)]
- The REFERENCES clause in a CREATE TABLE that includes
a remote schema name now renders the remote name without
the schema clause, as required by SQLite. [ticket:1851]
Mike Bayer [Tue, 9 Nov 2010 16:40:23 +0000 (11:40 -0500)]
- Implemented sequence check capability for the C
version of RowProxy, as well as 2.7 style
"collections.Sequence" registration for RowProxy.
[ticket:1871]
Mike Bayer [Fri, 5 Nov 2010 05:02:48 +0000 (01:02 -0400)]
- "innerjoin" flag doesn't take effect along the chain
of joinedload() joins if a previous join in that chain
is an outer join, thus allowing primary rows without
a referenced child row to be correctly returned
in results. [ticket:1954]
Mike Bayer [Wed, 3 Nov 2010 19:45:21 +0000 (15:45 -0400)]
- mysql
- Fixed error handling for Jython + zxjdbc, such that
has_table() property works again. Regression from
0.6.3 (we don't have a Jython buildbot, sorry)
[ticket:1960]
Mike Bayer [Tue, 26 Oct 2010 20:12:04 +0000 (16:12 -0400)]
- Fixed bug whereby a non-"mutable" attribute modified event
which occurred on an object that was clean except for
preceding mutable attribute changes would fail to strongly
reference itself in the identity map. This would cause the
object to be garbage collected, losing track of any changes
that weren't previously saved in the "mutable changes"
dictionary.
Mike Bayer [Sun, 24 Oct 2010 16:00:58 +0000 (12:00 -0400)]
- mssql+pymssql dialect now honors the "port" portion
of the URL instead of discarding it. [ticket:1952]
- testing.only_on() accepts db specs optionally as a list
Mike Bayer [Sat, 23 Oct 2010 22:09:36 +0000 (18:09 -0400)]
- Rewrote the reflection of indexes to use sys.
catalogs, so that column names of any configuration
(spaces, embedded commas, etc.) can be reflected.
Note that reflection of indexes requires SQL
Server 2005 or greater. [ticket:1770]
Mike Bayer [Sat, 23 Oct 2010 20:40:39 +0000 (16:40 -0400)]
- Added type_coerce(expr, type_) expression element.
Treats the given expression as the given type when evaluating
expressions and processing result rows, but does not
affect the generation of SQL, other than an anonymous label.
Mike Bayer [Sat, 23 Oct 2010 19:27:21 +0000 (15:27 -0400)]
- Oracle - the implicit_retunring argument to create_engine()
is now honored regardless of detected version of
Oracle. Previously, the flag would be forced
to False if server version info was < 10.
[ticket:1878]
Mike Bayer [Sat, 23 Oct 2010 17:07:56 +0000 (13:07 -0400)]
- New Query methods: query.label(name), query.as_scalar(),
return the query's statement as a scalar subquery
with /without label [ticket:1920];
query.with_entities(*ent), replaces the SELECT list of
the query with new entities.
Roughly equivalent to a generative form of query.values()
which accepts mapped entities as well as column
expressions.
Mike Bayer [Thu, 21 Oct 2010 20:42:32 +0000 (16:42 -0400)]
- Fixed bug in TypeDecorator whereby the dialect-specific
type was getting pulled in to generate the DDL for a
given type, which didn't always return the correct result.
- TypeDecorator can now have a fully constructed type
specified as its "impl", in addition to a type class.
- TypeDecorator will now place itself as the resulting
type for a binary expression where the type coercion
rules would normally return its impl type - previously,
a copy of the impl type would be returned which would
have the TypeDecorator embedded into it as the "dialect"
impl, this was probably an unintentional way of achieving
the desired effect.
- TypeDecorator.load_dialect_impl() returns "self.impl" by
default, i.e. not the dialect implementation type of
"self.impl". This to support compilation correctly.
Behavior can be user-overridden in exactly the same way
as before to the same effect.
Mike Bayer [Wed, 20 Oct 2010 21:58:35 +0000 (17:58 -0400)]
- document is_modified() caveats including that the "old" value isn't always
present, and that this results in a positive response for "changed"
[ticket:1928]