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
Mike Bayer [Mon, 13 Dec 2010 05:15:32 +0000 (00:15 -0500)]
- why type.dialect_impl(dialect).bind_processor(dialect), caching just the impl?
just call type._cached_bind_processor(dialect), cache the impl *and* the processor function.
same for result sets.
- use plain dict + update for defaultexecutioncontext.execution_options
Mike Bayer [Sun, 12 Dec 2010 06:35:37 +0000 (01:35 -0500)]
- refactor query._get() into two methods - a static one that does
just the identity map lookup + expired check, the other
which does the load unconditionally. All the refresh/deferred load
calls use the unconditional load method, query.get() and
LoadLazyAttribute call the identity check by itself first. m2o
lazyloads for object already in the identity map callcounts are
now cut in half, since no Query object is created.
Mike Bayer [Sat, 11 Dec 2010 22:44:46 +0000 (17:44 -0500)]
- support for cdecimal
- add --with-cdecimal flag to tests, monkeypatches cdecimal in
- fix mssql/pyodbc.py to not use private '_int' accessor in decimal conversion
routines
- pyodbc version 2.1.8 is needed for cdecimal in any case as
previous versions also called '_int', 2.1.8 adds the same string
logic as our own dialect, so that logic is skipped for modern
pyodbc version
- make the imports for "Decimal" consistent across the whole lib. not sure
yet how we should be importing "Decimal" or what the best way forward
is that would allow a clean user-invoked swap of cdecimal; for now,
added docs suggesting a global monkeypatch - the two decimal libs
are not compatible with each other so any chance of mixing produces
serious issues. adding adapters to DBAPIs tedious and adds in-python
overhead. suggestions welcome on how we should be doing
Decimal/cdecimal.
Mike Bayer [Sat, 11 Dec 2010 08:05:03 +0000 (03:05 -0500)]
- clean up the batch insert thing
- add a test for batch inserts
- don't need elaborate _inserted_primary_key thing
- take some cruft out of ExecutionContext, ResultProxy,
EC members can be non-underscored, have mapper just call the
EC members for now.
- simplify "connection_callable", no need for a "flush_opts"
dictionary since this point of expansion is not needed