Mike Bayer [Wed, 26 Sep 2007 23:47:55 +0000 (23:47 +0000)]
- some docstrings for select()
- fixed tutorial doctests to adjust for execution changes, session being weak-referencing
(reloads objects more frequently which get u'' applied to their __repr__())
Jason Kirtland [Wed, 26 Sep 2007 23:37:11 +0000 (23:37 +0000)]
Changed MySQL dialect to use the older LIMIT <offset>, <limit> syntax instead
of LIMIT <l> OFFSET <o> for folks using 3.23. ([ticket:794], thanks for the
patch!)
Mike Bayer [Wed, 26 Sep 2007 17:08:19 +0000 (17:08 +0000)]
- created a link between QueryContext and SelectionContext; the attribute
dictionary of QueryContext is now passed to SelectionContext inside
of Query.instances(), allowing messages to be passed between the two stages.
- removed the recent "exact match" behavior of Alias objects, they're back to
their usual behavior.
- tightened up the relationship between the Query's generation
of "eager load" aliases, and Query.instances() which actually grabs the
eagerly loaded rows. If the aliases were not specifically generated for
that statement by EagerLoader, the EagerLoader will not take effect
when the rows are fetched. This prevents columns from being grabbed accidentally
as being part of an eager load when they were not meant for such, which can happen
with textual SQL as well as some inheritance situations. It's particularly important
since the "anonymous aliasing" of columns uses simple integer counts now to generate
labels.
Mike Bayer [Wed, 26 Sep 2007 14:55:44 +0000 (14:55 +0000)]
- the behavior of String/Unicode types regarding that they auto-convert
to TEXT/CLOB when no length is present now occurs *only* for an exact type
of String or Unicode with no arguments. If you use VARCHAR or NCHAR
(subclasses of String/Unicode) with no length, they will be interpreted
by the dialect as VARCHAR/NCHAR; no "magic" conversion happens there.
This is less surprising behavior and in particular this helps Oracle keep
string-based bind parameters as VARCHARs and not CLOBs [ticket:793].
Mike Bayer [Mon, 24 Sep 2007 19:27:52 +0000 (19:27 +0000)]
- columns from Alias objects, when used to target result-row columns, must match exactly
to the label used in the generated statement. This is so searching for columns in a
result row which match aliases won't accidentally match non-aliased columns.
fixes errors which can arise in eager loading scenarios.
Mike Bayer [Mon, 24 Sep 2007 14:51:23 +0000 (14:51 +0000)]
- added session.is_modified(obj) method; performs the same "history" comparison operation
as occurs within a flush operation; setting include_collections=False gives the same
result as is used when the flush determines whether or not to issue an UPDATE for the
instance's row.
Mike Bayer [Sat, 22 Sep 2007 17:14:15 +0000 (17:14 +0000)]
- added "schema" argument to Sequence; use this with Postgres /Oracle when the sequence is
located in an alternate schema. Implements part of [ticket:584], should fix [ticket:761].
Mike Bayer [Sat, 22 Sep 2007 16:55:36 +0000 (16:55 +0000)]
- merged sa_entity branch. the big change here is the attributes system
deals primarily with the InstanceState and almost never with the instrumented object
directly. This reduces lookups and complexity since we need the state for just about
everything, now its the one place for everything internally.
we also merged the new weak referencing identity map, which will go out in beta6 and
we'll see how that goes !
Mike Bayer [Sat, 22 Sep 2007 15:55:02 +0000 (15:55 +0000)]
- added 'comparator' keyword argument to PickleType. By default, "mutable"
PickleType does a "deep compare" of objects using their dumps() representation.
But this doesn't work for dictionaries. Pickled objects which provide an
adequate __eq__() implementation can be set up with "PickleType(comparator=operator.eq)"
[ticket:560]
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.