Mike Bayer [Sat, 10 Nov 2007 03:02:16 +0000 (03:02 +0000)]
- anonymous column expressions are automatically labeled.
e.g. select([x* 5]) produces "SELECT x * 5 AS anon_1".
This allows the labelname to be present in the cursor.description
which can then be appropriately matched to result-column processing
rules. (we can't reliably use positional tracking for result-column
matches since text() expressions may represent multiple columns).
- operator overloading is now controlled by TypeEngine objects - the
one built-in operator overload so far is String types overloading
'+' to be the string concatenation operator.
User-defined types can also define their own operator overloading
by overriding the adapt_operator(self, op) method.
- untyped bind parameters on the right side of a binary expression
will be assigned the type of the left side of the operation, to better
enable the appropriate bind parameter processing to take effect
[ticket:819]
Jason Kirtland [Fri, 9 Nov 2007 19:55:31 +0000 (19:55 +0000)]
- mysql float types now do an end run around the base class and respect precision=None and length=None
- Added the mysteriously missing mysql cast support
- Added mysql REAL synonym for schema generation
Mike Bayer [Fri, 9 Nov 2007 16:36:46 +0000 (16:36 +0000)]
- fixed error where Query.add_column() would not accept a class-bound
attribute as an argument; Query also raises an error if an invalid
argument was sent to add_column() (at instances() time) [ticket:858]
Mike Bayer [Thu, 8 Nov 2007 18:06:21 +0000 (18:06 +0000)]
more changes to traverse-and-clone; a particular element will only be cloned once and is
then re-used. the FROM calculation of a Select normalizes the list of hide_froms against all
previous incarnations of each FROM clause, using a tag attached from cloned clause to
previous.
Mike Bayer [Thu, 8 Nov 2007 00:26:23 +0000 (00:26 +0000)]
- identified some cases where Alias needs to be cloned; but still cant clone
when its an alias of a Table; added some test coverage for one particular
case from the doctests
- fixed "having" example in doctests, updated eager load example
Mike Bayer [Wed, 7 Nov 2007 01:36:16 +0000 (01:36 +0000)]
adjusted "blank out primary key" rule to check for "allow_null_pks" on target mapper. this was revealed by
recent attributes.py change in r3695 that causes a value of "None" to register as part of the attribute history's
added_items() collection (i.e. since AttributeHistory compares against NO_VALUE instead of None).
Mike Bayer [Mon, 5 Nov 2007 19:23:08 +0000 (19:23 +0000)]
- adjustments to oracle ROWID logic...recent oid changes mean we have to
use "rowid" against the select itself (i.e. its just...'rowid', no table name).
seems to work OK but not sure if issues will arise
- fixes to oracle bind param stuff to account for recent removal of ClauseParameters object.
Mike Bayer [Mon, 5 Nov 2007 18:30:30 +0000 (18:30 +0000)]
- oid_column proxies more intelligently off of Select, CompoundSelect - fixes platform-affected bugs in missing the correct "oid" column
- locate_all_froms() is expensive; added an attribute-level cache for it
- put a huge warning on all select.append_XXX() methods stating that derived collections like locate_all_froms() may become invalid if
already initialized
Mike Bayer [Mon, 5 Nov 2007 17:18:21 +0000 (17:18 +0000)]
- base_columns on ColumnElement becomes a list; as usual, because columns in CompoundSelects
may extend from more than one root column.
- keys_ok argument from corresponding_column() removed. no more name-based matching of columns anywhere.
- DictDecorator is gone. all row translators provided by orm.util.create_row_adapter(). Mapper
and contains_alias() cache the adapters on target mapper to avoid re-computation of adapters.
- create_row_adapter() accepts an "equivalent_columns" map as produced by Mapper, so that
row adapters can take join conditions into account (as usual again, to help with the CompoundSelects
produced by polymorphic_union).
- simplified TableSingleton to just provide lookup; moved all initialization into Table.
- the "properties" accessor on Mapper is removed; it now throws an informative
exception explaining the usage of mapper.get_property() and
mapper.iterate_properties
Mike Bayer [Mon, 5 Nov 2007 00:59:19 +0000 (00:59 +0000)]
- rewrote and simplified the system used to "target" columns across
selectable expressions. On the SQL side this is represented by the
"corresponding_column()" method. This method is used heavily by the ORM
to "adapt" elements of an expression to similar, aliased expressions,
as well as to target result set columns originally bound to a
table or selectable to an aliased, "corresponding" expression. The new
rewrite features completely consistent and accurate behavior.
- the "orig_set" and "distance" elements as well as all associated
fanfare are gone (hooray !)
- columns now have an optional "proxies" list which is a list of all
columns they are a "proxy" for; only CompoundSelect cols proxy more than one column
(just like before). set operations are used to determine lineage.
- CompoundSelects (i.e. unions) only create one public-facing proxy column per
column name. primary key collections come out with just one column per embedded
PK column.
- made the alias used by eager load limited subquery anonymous.
Mike Bayer [Sat, 3 Nov 2007 23:17:34 +0000 (23:17 +0000)]
- eager loading with LIMIT/OFFSET applied no longer adds the primary
table joined to a limited subquery of itself; the eager loads now
join directly to the subquery which also provides the primary table's
columns to the result set. This eliminates a JOIN from all eager loads
with LIMIT/OFFSET. [ticket:843]
Mike Bayer [Sat, 3 Nov 2007 22:13:17 +0000 (22:13 +0000)]
- rewritten ClauseAdapter merged from the eager_minus_join branch; this is a much simpler
and "correct" version which will copy all elements exactly once, except for those which were
replaced with target elements. It also can match a wider variety of target elements including
joins and selects on identity alone.
Mike Bayer [Sat, 3 Nov 2007 20:12:59 +0000 (20:12 +0000)]
- removed "name" attribute from FromClause, Join, Select, CompoundSelect. its needless
and led to some very strange anonymous label names
- removed what was apparently cruft in some column-targeting code
Mike Bayer [Fri, 2 Nov 2007 17:58:20 +0000 (17:58 +0000)]
- merge() includes a keyword argument "dont_load=True". setting this flag will cause
the merge operation to not load any data from the database in response to incoming
detached objects, and will accept the incoming detached object as though it were
already present in that session. Use this to merge detached objects from external
caching systems into the session.
Mike Bayer [Thu, 1 Nov 2007 20:12:36 +0000 (20:12 +0000)]
- session checks more carefully when determining "object X already in another session";
e.g. if you pickle a series of objects and unpickle (i.e. as in a Pylons HTTP session
or similar), they can go into a new session without any conflict
- added stricter checks around session.delete() similar to update()
- shored up some old "validate" stuff in session/uow
Mike Bayer [Thu, 1 Nov 2007 03:58:21 +0000 (03:58 +0000)]
- merged factor_down_bindparams branch.
- removed ClauseParameters object; compiled.params returns a regular dictionary
now, as well as result.last_inserted_params()/last_updated_params().
- various code trimming, method removals.
Mike Bayer [Wed, 31 Oct 2007 19:11:22 +0000 (19:11 +0000)]
- split ScalarInstrumentedAttribute into a "scalar" and an "object" version.
The "object" version loads the existing value on set/del, fires events,
and handles trackparent operations; the "scalar" version does not.
- column loaders now use the "scalar" version of InstrumentedAttribute, so that
event handlers etc. don't fire off for regular column attribute operations.
- some adjustments to AttributeHistory to work properly for non-loaded attributes
- deferred column attributes no longer trigger a load operation when the
attribute is assigned to. in those cases, the newly assigned
value will be present in the flushes' UPDATE statement unconditionally.
Ants Aasma [Wed, 31 Oct 2007 16:30:06 +0000 (16:30 +0000)]
- also added proxying of save_or_update to scoped sessions.
- session.update() raises an error when updating an instance that is already in the session with a different identity
- adjusted zoomarks lower limits so I can get a nice clean run
Mike Bayer [Tue, 30 Oct 2007 18:04:00 +0000 (18:04 +0000)]
- fix to "row switch" behavior, i.e. when an INSERT/DELETE is combined into a
single UPDATE; many-to-many relations on the parent object update properly.
[ticket:841]
- it's an error to session.save() an object which is already persistent
[ticket:840]
- changed a bunch of repr(obj) calls in session.py exceptions to use mapperutil.instance_str()
Mike Bayer [Sun, 28 Oct 2007 21:28:53 +0000 (21:28 +0000)]
- fixed INSERT statements w.r.t. primary key columns that have SQL-expression
based default generators on them; SQL expression executes inline as normal
but will not trigger a "postfetch" condition for the column, for those DB's
who provide it via cursor.lastrowid
Mike Bayer [Sun, 28 Oct 2007 01:51:43 +0000 (01:51 +0000)]
- merged path_based_options branch
- behavior of query.options() is now fully based on paths, i.e. an option
such as eagerload_all('x.y.z.y.x') will apply eagerloading to only
those paths, i.e. and not 'x.y.x'; eagerload('children.children') applies
only to exactly two-levels deep, etc. [ticket:777]
- removes old compiler()/schemagenerator()/schemadropper() methods from mysql dialect
Mike Bayer [Sat, 27 Oct 2007 18:45:20 +0000 (18:45 +0000)]
- inlined a couple of context variables
- PG two phase was calling text() without the correct bind param format, previous compiler checkin revealed issue
Mike Bayer [Sat, 27 Oct 2007 17:41:30 +0000 (17:41 +0000)]
- removed regular expression step from most statement compilations.
also fixes [ticket:833]
- inlining on PG with_returning() call
- extra options added for profiling
Mike Bayer [Thu, 25 Oct 2007 16:57:04 +0000 (16:57 +0000)]
- refactored _compile_properties/_compile_property, removed redundant code.
still a little squirrely but much less complex.
- improved behavior of add_property() etc., fixed [ticket:831] involving
synonym/deferred
Mike Bayer [Sun, 21 Oct 2007 16:36:34 +0000 (16:36 +0000)]
- the whole OperationContext/QueryContext/SelectionContext thing greatly scaled back;
all MapperOptions process the Query and that's it, one very simpliied QueryContext object gets passed
around at query.compile() and query.instances() time
- slight optimization to MapperExtension allowing the mapper to check for the presence of an extended method, takes 3000 calls off of masseagerload.py test (only a slight increase in speed though)
- attempting to centralize the notion of a "path" along mappers/properties, need to define what that is better. heading towards [ticket:777]...
Jason Kirtland [Sat, 20 Oct 2007 17:14:46 +0000 (17:14 +0000)]
Excluding older sqlite versions from the new insert tests. Currently conservative- 2.8 definitely fails, 3.3 works. The 3.0 and 3.1 binaries from sqlite.org segfault for me so the version check should be revisited when possible.