Mike Bayer [Tue, 21 Aug 2007 18:18:21 +0000 (18:18 +0000)]
changing Pool to use weakref callback for auto-cleanup, instead of __del__.
Still leaving the RLock in Queue however since I see no guarantee that the weakref callback
isn't called at an arbitrary time.
Jason Kirtland [Tue, 21 Aug 2007 16:58:49 +0000 (16:58 +0000)]
Inlined ClauseParameters.set_parameter (simple assignment) in construct_params
Big drop in function count for inserts (22%) with about a 3% wall clock improvement.
Jason Kirtland [Tue, 21 Aug 2007 01:31:23 +0000 (01:31 +0000)]
- omitted 'table' and 'column' from 'from sqlalchemy import *'
- also omitted all modules and classes that aren't expicitly public
- omitted 'Smallinteger' (small i), but it's still in schema
- omitted NullType-related items from types.__all__
- patched up a few tests to use sql.table and sql.column, other related.
Mike Bayer [Mon, 20 Aug 2007 19:07:07 +0000 (19:07 +0000)]
- Engine and TLEngine assume "threadlocal" behavior on Pool; both use connect()
for contextual connection, unique_connection() for non-contextual.
- Pool use_threadlocal defaults to True, can be set to false at create_engine()
level with pool_threadlocal=False
- made all logger statements in pool conditional based on a flag calcualted once.
- chagned WeakValueDictionary() used for "threadlocal" pool to be a regular dict
referencing weakref objects. WVD had a lot of overhead, apparently. *CAUTION* -
im pretty confident about this change, as the threadlocal dict gets explicitly managed
anyway, tests pass with PG etc., but keep a close eye on this one regardless.
Jason Kirtland [Sun, 19 Aug 2007 17:57:51 +0000 (17:57 +0000)]
- Connection.begin() no longer accepts nested=True, a possible source of confusion as two forms of nesting are supported. SAVEPOINT-style nesting logic is now contained soley in begin_nested().
- Docstring love for the engine package. More is needed.
Mike Bayer [Sat, 18 Aug 2007 21:37:48 +0000 (21:37 +0000)]
1. Module layout. sql.py and related move into a package called "sql".
2. compiler names changed to be less verbose, unused classes removed.
3. Methods on Dialect which return compilers, schema generators, identifier preparers
have changed to direct class references, typically on the Dialect class itself
or optionally as attributes on an individual Dialect instance if conditional behavior is needed.
This takes away the need for Dialect subclasses to know how to instantiate these
objects, and also reduces method overhead by one call for each one.
4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now). The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument.
5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py
Jason Kirtland [Sat, 18 Aug 2007 18:15:11 +0000 (18:15 +0000)]
- fixed prefixes= argument to select()
- mysql can now generate DISTINCT or ALL for queries, select(..., distinct='ALL')
- documented 'prefixes' arg to select()
- rearranged doc order for select args to mirror that of a generated statement
- went nutty and fixed wrapping and line length on most docstrings in sql.py
Mike Bayer [Fri, 17 Aug 2007 23:45:29 +0000 (23:45 +0000)]
- Added a "legacy" adapter to types, such that user-defined TypeEngine
and TypeDecorator classes which define convert_bind_param()/convert_result_value()
will continue to function. Also supports calling the super() version of
those methods.
Mike Bayer [Fri, 17 Aug 2007 21:20:49 +0000 (21:20 +0000)]
- added close() method to Transaction. closes out a transaction using rollback
if it's the outermost transaction, otherwise just ends without affecting
the outer transaction.
- transactional and non-transactional Session integrates better with bound
connection; a close() will ensure that connection transactional state is
the same as that which existed on it before being bound to the Session.
Mike Bayer [Fri, 17 Aug 2007 17:59:08 +0000 (17:59 +0000)]
- added extra argument con_proxy to ConnectionListener interface checkout/checkin methods
- changed testing connection closer to work on _ConnectionFairy instances, resulting in
pool checkins, not actual closes
- disabled session two phase test for now, needs work
- added some two-phase support to TLEngine, not tested
- TLTransaction is now a wrapper
Mike Bayer [Thu, 16 Aug 2007 22:15:15 +0000 (22:15 +0000)]
- moved test/orm/fixtures.py to testlib
- flattened mapper calls in _instance() to operate directly
through a default MapperExtension
- more tests for ScopedSession, fixed [ticket:746]
- threadlocal engine propagates **kwargs through begin()
Mike Bayer [Wed, 15 Aug 2007 16:48:57 +0000 (16:48 +0000)]
- moved unicode schema ORM tests to unitofwork.py tests. mostly
is to test mappers so limited DB support (really hard to get these unicode schemas
to work...)
- fixed [ticket:739]
Mike Bayer [Tue, 14 Aug 2007 21:53:32 +0000 (21:53 +0000)]
- merged "fasttypes" branch. this branch changes the signature
of convert_bind_param() and convert_result_value() to callable-returning
bind_processor() and result_processor() methods. if no callable is
returned, no pre/post processing function is called.
- hooks added throughout base/sql/defaults to optimize the calling
of bind param/result processors so that method call overhead is minimized.
special cases added for executemany() scenarios such that unneeded "last row id"
logic doesn't kick in, parameters aren't excessively traversed.
- new performance tests show a combined mass-insert/mass-select test as having 68%
fewer function calls than the same test run against 0.3.
- general performance improvement of result set iteration is around 10-20%.
Mike Bayer [Tue, 14 Aug 2007 03:19:46 +0000 (03:19 +0000)]
- base_mapper() becomes a plain attribute
- session.execute() and scalar() can search for a Table with which to bind
from using the given ClauseElement
- session automatically extrapolates tables from mappers with binds,
also uses base_mapper so that inheritance hierarchies bind automatically
- moved ClauseVisitor traversal back to inlined non-recursive
Mike Bayer [Mon, 13 Aug 2007 20:14:04 +0000 (20:14 +0000)]
- a rudimental SessionExtension class has been added, allowing user-defined
functionality to take place at flush(), commit(), and rollback() boundaries.
Mike Bayer [Mon, 13 Aug 2007 20:00:38 +0000 (20:00 +0000)]
- generalized a SQLCompileTest out of select.py, installed
into dialect/mssql.py, dialect/oracle.py, sql/generative.py
- fixed oracle issues [ticket:732], [ticket:733], [ticket:734]