Mike Bayer [Sun, 9 Sep 2007 17:01:38 +0000 (17:01 +0000)]
- added 'passive_deletes="all"' flag to relation(), disables all
nulling-out of foreign key attributes during a flush where the parent
object is deleted.
Mike Bayer [Sat, 8 Sep 2007 20:28:26 +0000 (20:28 +0000)]
- adjusted operator precedence of NOT to match '==' and others, so that
~(x <operator> y) produces NOT (x <op> y), which is better compatible with MySQL.
[ticket:764]. this doesn't apply to "~(x==y)" as it does in 0.3 since ~(x==y)
compiles to "x != y", but still applies to operators like BETWEEN.
Mike Bayer [Sat, 8 Sep 2007 19:51:35 +0000 (19:51 +0000)]
- fixes to ShardedSession to work with deferred columns [ticket:771].
- user-defined shard_chooser() function must accept "clause=None"
argument; this is the ClauseElement passed to session.execute(statement)
and can be used to determine correct shard id (since execute() doesn't
take an instance)
Mike Bayer [Fri, 7 Sep 2007 19:57:01 +0000 (19:57 +0000)]
- merged the unit test for the column_prefix fix that was established in the 0.3
trunk in r2795. the actual "fix" part of it I just happened to spot manually
the other day and fixed without testing (forgot what the original failure condition was) in r3449.
Mike Bayer [Wed, 5 Sep 2007 17:25:32 +0000 (17:25 +0000)]
merged current entity_management brach r3457-r3462. cleans up
'_state' mamangement in attributes, moves __init__() instrumntation into attributes.py,
and reduces method call overhead by removing '_state' property.
future enhancements may include _state maintaining a weakref to the instance and a
strong ref to its __dict__ so that garbage-collected instances can get added to 'dirty',
when weak-referenced identity map is used.
Mike Bayer [Tue, 4 Sep 2007 18:07:16 +0000 (18:07 +0000)]
- took out method calls for oid_column
- reduced complexity of parameter handling during execution; __distill_params does all
parameter munging, executioncontext.parameters always holds a list of parameter structures
(lists, tuples, or dicts).
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