Mike Bayer [Wed, 12 Jan 2011 20:49:59 +0000 (15:49 -0500)]
- dont count server_default absense as part of autoincrement, PG
will have a value here upon reflection.
- mysql, others will have to check "server_default" when rendering
special keywords like AUTOINCREMENT
Mike Bayer [Wed, 12 Jan 2011 20:35:20 +0000 (15:35 -0500)]
- rename hybrid.property_, hybrid.method to hybrid_property, hybrid_method. more typing
on the import but this is just clearer.
- adapt dictlike-polymorphic.py to use hybrid.
Mike Bayer [Tue, 11 Jan 2011 20:22:46 +0000 (15:22 -0500)]
- A TypeDecorator of Integer can be used with a primary key
column, and the "autoincrement" feature of various dialects
as well as the "sqlite_autoincrement" flag will honor
the underlying database type as being Integer-based.
[ticket:2005]
- Result-row processors are applied to pre-executed SQL
defaults, as well as cursor.lastrowid, when determining
the contents of result.inserted_primary_key.
[ticket:2006]
- Bind parameters present in the "columns clause" of a select
are now auto-labeled like other "anonymous" clauses,
which among other things allows their "type" to be meaningful
when the row is fetched, as in result row processors.
- TypeDecorator is present in the "sqlalchemy" import space.
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 18:48:46 +0000 (13:48 -0500)]
- The Index() construct can be created inline with a Table
definition, using strings as column names, as an alternative
to the creation of the index outside of the Table.
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 [Mon, 3 Jan 2011 00:54:31 +0000 (19:54 -0500)]
- add support for pickling with mutable scalars, mutable composites
- add pickle/unpickle events to ORM events. these are needed
for the mutable extension.
- finish mutable extension documentation, consolidate examples,
add full descriptions
Mike Bayer [Fri, 31 Dec 2010 16:46:30 +0000 (11:46 -0500)]
- add QueryContext to load(), refresh()
- add list of attribute names to refresh()
- ensure refresh() only called when attributes actually refreshed
- tests. [ticket:2011]
Mike Bayer [Thu, 30 Dec 2010 17:14:32 +0000 (12:14 -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 [Wed, 29 Dec 2010 20:04:35 +0000 (15:04 -0500)]
- mutable examples now move into sqlalchemy.ext.mutable
- streamline interfaces, get Mutable/MutableComposite to be as minimal
in usage as possible
- docs for mutable, warnings regrarding mapper events being global
- move MutableType/mutable=True outwards, move orm tests to its
own module, note in all documentation
- still need more events/tests for correct pickling support of
composites, mutables. in the case of composites its needed
even without mutation. see [ticket:2009]
Mike Bayer [Wed, 29 Dec 2010 03:23:13 +0000 (22:23 -0500)]
- restore mapper.get_property() to use the _props dict. at the moment
synonyms for relationships might just be taken out altogether, since they aren't
documented and are of little use. a plain proxying descriptor, combined with
attribute-based usage with Query (as opposted to naming it by string)
can do the same thing more simply.
- add event support to composites, change the model around so that the composite
is generated at the point of load.
- add a recipe for tracking mutations on composites. will probably make both
of these mutations examples into extensions since they're intricate, should
have a lot of test coverage, and what they need to do is fairly straightforward.
Will use metaclasses so that no extra userland step is needed beyond usage
of the type.
Mike Bayer [Tue, 28 Dec 2010 22:50:36 +0000 (17:50 -0500)]
- simplified the descriptor system to no longer use the hybrid extension, instead presenting
the Proxy(QueryableAttribute) object as the public facing interface. This simplifies
the descriptor system and will allow straightforward integration with attribute events.
Mike Bayer [Sat, 25 Dec 2010 19:08:03 +0000 (14:08 -0500)]
- on_expire event, since we are starting to build off of events around
full lifecycle
- composite will use events to do everything we want it to, i.e.
storing the composite in __dict__, invalidating it on change
of any of the columns.
- will reinstate mutability of composites via callable attached
to the composite - but userland code will still need to establish
change event listening on the composite itself, perhaps via
a "mutable" mixin like the scalars.py example, perhaps via
addition of descriptors to the mutable object.
Mike Bayer [Mon, 20 Dec 2010 18:47:48 +0000 (13:47 -0500)]
- crudely, this replaces CompositeProperty's base to be
DescriptorProperty. We have to lose mutability (yikes
composites were using mutable too !). Also the getter
is not particularly efficient since it recreates the composite
every time, probably want to stick it in __dict__. also
rewrite the unit tests
Mike Bayer [Sat, 18 Dec 2010 17:14:23 +0000 (12:14 -0500)]
- some good inlinings to the whole cascade_iterator() thing.
cascade_iterator() should probably not yield the "instance" at all
and only deal in states. 30-40K methods taken off the orm2010 test.
Mike Bayer [Sat, 18 Dec 2010 00:27:01 +0000 (19:27 -0500)]
this innocuous change allows sqlite to work with pypy. sadly, pypy is twice as slow
even if i run the same test script four or five times to prime the jit.
Mike Bayer [Fri, 17 Dec 2010 02:08:26 +0000 (21:08 -0500)]
- remove the need to use LoadDeferredColumns, LoadLazyAttribute in most cases,
these are back to being part of LoaderStrategy
- simplify attribute.get()
- inline the dict get inside of attribute.__get__()
- revert some memoized attrs from InstanceState which are called in almost
all cases regardless
- inlining
Mike Bayer [Thu, 16 Dec 2010 22:52:43 +0000 (17:52 -0500)]
- MSSQL - the String/Unicode types, and their counterparts VARCHAR/
NVARCHAR, emit "max" as the length when no length is
specified. This makes it more compatible with Postgresql's
VARCHAR type which is similarly unbounded when no length
specified.
Mike Bayer [Wed, 15 Dec 2010 17:44:37 +0000 (12:44 -0500)]
- an approach I like better, remove most adapt() methods and use a generic
copier
- mssql reflection fix, but this will come in again from the tip merge