Mike Bayer [Fri, 30 Dec 2005 05:58:45 +0000 (05:58 +0000)]
changes related to mapping against arbitrary selects, selects with labels or functions:
testfunction has a more complete test (needs an assert tho);
added new labels, synonymous with column key, to "select" statements that are subqueries with use_labels=False, since SQLite wants them -
this also impacts the names of the columns attached to the select object in the case that the key and name dont match, since
it is now the key, not the name;
aliases generate random names if name is None (need some way to make them more predictable to help plan caching);
select statements have a rowid column of None, since there isnt really a "rowid"...at least cant figure out what it would be yet;
mapper creates an alias if given a select to map against, since Postgres wants it;
mapper checks if it has pks for a given table before saving/deleting, skips it otherwise;
mapper will not try to order by rowid if table doesnt have a rowid (since select statements dont have rowids...)
Mike Bayer [Fri, 30 Dec 2005 00:27:46 +0000 (00:27 +0000)]
reworking concept of column lists, "FromObject", "Selectable";
support for types to be propigated into boolean expressions;
new label() function/method to make any column/literal/function/bind param
into a "foo AS bar" clause, better support in ansisql for this concept;
trying to get column list on a select() object to be Column and ColumnClause
objects equally, working on mappers that map to those select() objects
Mike Bayer [Fri, 30 Dec 2005 00:23:01 +0000 (00:23 +0000)]
catching up oracle to current, some tweaks to unittests to work better with oracle,
allow different ordering of expected statements.
unittests still dont work completely with oracle due to sequence columns in INSERT statements
Mike Bayer [Sat, 24 Dec 2005 15:33:47 +0000 (15:33 +0000)]
the 'column' function is optional to point a property to a column when constructing a mapper
can also be specified as a list to indicate overlap
mapper columns come from its table, no need to add from given columns
Mike Bayer [Fri, 23 Dec 2005 05:19:48 +0000 (05:19 +0000)]
mapper, when updating, only SET's those columns that have changed.
this also allows "deferred" column properties to remain untouched by a save operation
if they werent affected.
Mike Bayer [Fri, 23 Dec 2005 01:49:44 +0000 (01:49 +0000)]
refactor/cleanup to mapper options methodology to allow for incoming defer/undefer options
mapper/relations are stricter about class attributes and primary mapper - is_primary flag
on relations fixed (wasnt working before). new primary mappers clear off old class attributes,
secondary mappers insure that their property was set up by the primary; otherwise secondary
mappers can add behavior to properties that are unmanaged by the primary mapper
added "group" option to deferred loaders so a group of properties can be loaded at once
mapper adds the "oid" column to the select list if "distinct" is set to true and its
using the default "order by oid" ordering (mysql benefits from ansisql fix to only print out unique
columns in the select list since its oid is the same as the pk column)
fixed unittests to comply with stricter primary mapper rules
Mike Bayer [Fri, 23 Dec 2005 01:37:10 +0000 (01:37 +0000)]
move execute parameter processing from sql.ClauseElement to engine.execute_compiled
testbase gets "assert_sql_count" method, moves execution wrapping to pre_exec to accomodate engine change
move _get_colparams from Insert/Update to ansisql since it applies to compilation
ansisql also insures that select list for columns is unique, helps the mapper with the "distinct" keyword
docstrings/cleanup
Mike Bayer [Fri, 16 Dec 2005 07:19:29 +0000 (07:19 +0000)]
manytomany test shows that mysql needs column lengths on string to be used as a primary key
testbase simplified slightly, allowed by reorganiztion of engine's execution of compiled objects
Mike Bayer [Fri, 16 Dec 2005 07:18:27 +0000 (07:18 +0000)]
factored "sequence" execution in postgres in oracle to be generalized to the SQLEngine, to also allow space for "defaults" that may be constants, python functions, or SQL functions/statements
Sequence schema object extends from a more generic "Default" object
ANSICompiled can convert positinal params back to a dictionary, but the whole issue of parameters and how the engine executes compiled objects with parameters should be revisited
mysql has fixes for its "rowid_column" being hidden else it screws up some query construction, also will not use AUTOINCREMENT unless the column is Integer
Mike Bayer [Mon, 12 Dec 2005 01:44:58 +0000 (01:44 +0000)]
added 'order_by' property to mapper constructor
added 'no_sort' property to mapper _compile method to disable all ordering
mapper _compile will not use its internal order_by if the given statement has an orderby
lazyloader order_by used standalone when loading via mapper
Mike Bayer [Thu, 8 Dec 2005 03:03:29 +0000 (03:03 +0000)]
some enhancemnets to unions, unions and selects need to be more commonly derived,
also more tweaks to mapper eager query compilation involving distinct etc.
Mike Bayer [Wed, 7 Dec 2005 01:37:55 +0000 (01:37 +0000)]
added rudimentary support for limit and offset (with the hack version in oracle)
fixed up order_by to support a list/scalar of columns or asc/desc
fixed up query.py unit test
Mike Bayer [Sat, 3 Dec 2005 04:34:12 +0000 (04:34 +0000)]
added a third "mapper" to a many-to-many relationship that becomes the dependency in the "middle", thus allowing circular many-to-many relationships
added testcase to the 'double' test suite (whose name will change...)
small fix to table.get_col_by_original
added **kwargs to EagerLazyOption so other property options can be sent through
Mike Bayer [Fri, 2 Dec 2005 08:49:45 +0000 (08:49 +0000)]
added functionality to map columns to their aliased versions.
added support for specifying an alias in a relation.
added a new relation flag 'selectalias' which causes eagerloader to use a local alias name for its target table, translating columns back to the original non-aliased name as result rows come in.
Robert Leftwich [Thu, 1 Dec 2005 12:51:38 +0000 (12:51 +0000)]
Added float type to support real/double precision/float8/etc sql data types. Added columns.py as unit test. Modified sqlite.py, postgres.py and mysql.py to use the new type where appropriate (note -Oracle is unchanged at present).