Mike Bayer [Tue, 4 Sep 2007 00:08:57 +0000 (00:08 +0000)]
- removed "parameters" argument from clauseelement.compile(), replaced with
"column_keys". the parameters sent to execute() only interact with the
insert/update statement compilation process in terms of the column names
present but not the values for those columns.
produces more consistent execute/executemany behavior, simplifies things a
bit internally.
Mike Bayer [Sun, 2 Sep 2007 19:55:33 +0000 (19:55 +0000)]
- mapper compilation has been reorganized such that most compilation
occurs upon mapper construction. this allows us to have fewer
calls to mapper.compile() and also to allow class-based properties
to force a compilation (i.e. User.addresses == 7 will compile all
mappers; this is [ticket:758]). The only caveat here is that
an inheriting mapper now looks for its inherited mapper upon construction;
so mappers within inheritance relationships need to be constructed in
inheritance order (which should be the normal case anyway).
Mike Bayer [Sat, 1 Sep 2007 21:21:29 +0000 (21:21 +0000)]
- got all examples working
- inline default execution occurs for *all* non-PK columns
unconditionally - preexecute only for non-executemany PK cols on
PG, Oracle, etc.
- new default docs
Mike Bayer [Sat, 1 Sep 2007 19:49:26 +0000 (19:49 +0000)]
- merged inline inserts branch
- all executemany() style calls put all sequences and SQL defaults inline into a single SQL statement
and don't do any pre-execution
- regular Insert and Update objects can have inline=True, forcing all executions to be inlined.
- no last_inserted_ids(), lastrow_has_defaults() available with inline execution
- calculation of pre/post execute pushed into compiler; DefaultExecutionContext greatly simplified
- fixed postgres reflection of primary key columns with no sequence/default generator, sets autoincrement=False
- fixed postgres executemany() behavior regarding sequences present, not present, passivedefaults, etc.
- all tests pass for sqlite, mysql, postgres; oracle tests pass as well as they did previously including all
insert/update/default functionality
Jason Kirtland [Wed, 29 Aug 2007 22:27:45 +0000 (22:27 +0000)]
engine.url cleanups [ticket:742]
- translate_connect_args can now take kw args or the classic list
- in-tree dialects updated to supply their overrides as keywords
- tweaked url parsing in the spirit of the #742 patch, more or less
Jason Kirtland [Tue, 28 Aug 2007 23:44:00 +0000 (23:44 +0000)]
- Restored reflection for mysql VIEWs [ticket:748]
- Fixed anonymous pk reflection for mysql 5.1
- Tested table and view reflection against the 'sakila' database from
MySQL AB on 3.23 - 6.0. (with some schema adjustments, obviously)
Maybe this will go into the SA test suite someday.
- Tweaked mysql server version tuplification, now also splitting on hyphens
- Light janitorial
Mike Bayer [Wed, 22 Aug 2007 18:21:25 +0000 (18:21 +0000)]
- a "collection-holding" InstrumentedAttribute is now identified
by the presence of a "get_collection" method.
- added "get_collection" to DynamicCollectionAttribute so its
treated as a collection.
Jason Kirtland [Wed, 22 Aug 2007 07:33:03 +0000 (07:33 +0000)]
Added a test for the SELECT DISTINCT ON postgresqlism.
Test currently fails due to two problems in postgres.py, but I'm leaving
it uncorrected for now as its not clear what the original intent was
for lists.
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()