Rick Morrison [Thu, 15 Mar 2007 02:31:15 +0000 (02:31 +0000)]
MSSQL now passes still more unit tests [ticket:481]
Fix to null FLOAT fields in mssql-trusted.patch
MSSQL: LIMIT with OFFSET now raises an error
MSSQL: can now specify Windows authorization
MSSQL: ignores seconds on DATE columns (DATE fix, part 1)
Mike Bayer [Wed, 14 Mar 2007 23:48:07 +0000 (23:48 +0000)]
- eager loading will not "aliasize" "order by" clauses that were placed
in the select statement by something other than the eager loader
itself, to fix possibility of dupe columns as illustrated in
[ticket:495]. however, this means you have to be more careful with
the columns placed in the "order by" of Query.select(), that you have
explicitly named them in your criterion (i.e. you cant rely on the
eager loader adding them in for you)
- query._join_to (which powers join, join_via, etc) properly takes
secondary table into account when constructing joins
Mike Bayer [Tue, 13 Mar 2007 03:45:28 +0000 (03:45 +0000)]
- added a handy multi-use "identity_key()" method to Session, allowing
the generation of identity keys for primary key values, instances,
and rows, courtesy Daniel Miller
Mike Bayer [Sun, 11 Mar 2007 20:52:02 +0000 (20:52 +0000)]
- for hackers, refactored the "visitor" system of ClauseElement and
SchemaItem so that the traversal of items is controlled by the
ClauseVisitor itself, using the method visitor.traverse(item).
accept_visitor() methods can still be called directly but will
not do any traversal of child items. ClauseElement/SchemaItem now
have a configurable get_children() method to return the collection
of child elements for each parent object. This allows the full
traversal of items to be clear and unambiguous (as well as loggable),
with an easy method of limiting a traversal (just pass flags which
are picked up by appropriate get_children() methods). [ticket:501]
- accept_schema_visitor() methods removed, replaced with
get_children(schema_visitor=True)
- various docstring/changelog cleanup/reformatting
Mike Bayer [Sat, 10 Mar 2007 23:31:40 +0000 (23:31 +0000)]
- oracle:
- got binary working for any size input ! cx_oracle works fine,
it was my fault as BINARY was being passed and not BLOB for
setinputsizes (also unit tests werent even setting input sizes).
- auto_setinputsizes defaults to True for Oracle, fixed cases where
it improperly propigated bad types.
Mike Bayer [Sat, 10 Mar 2007 03:41:55 +0000 (03:41 +0000)]
- Query has add_entity() and add_column() generative methods. these
will add the given mapper/class or ColumnElement to the query at compile
time, and apply them to the instances method. the user is responsible
for constructing reasonable join conditions (otherwise you can get
full cartesian products). result set is the list of tuples, non-uniqued.
- fixed multi-mapper instances() to pad out shorter results with None so
zip() gets everything
Mike Bayer [Sat, 10 Mar 2007 02:49:12 +0000 (02:49 +0000)]
- the full featureset of the SelectResults extension has been merged
into a new set of methods available off of Query. These methods
all provide "generative" behavior, whereby the Query is copied
and a new one returned with additional criterion added.
The new methods include:
filter() - applies select criterion to the query
filter_by() - applies "by"-style criterion to the query
avg() - return the avg() function on the given column
join() - join to a property (or across a list of properties)
outerjoin() - like join() but uses LEFT OUTER JOIN
limit()/offset() - apply LIMIT/OFFSET
range-based access which applies limit/offset:
session.query(Foo)[3:5]
distinct() - apply DISTINCT
list() - evaluate the criterion and return results
no incompatible changes have been made to Query's API and no methods
have been deprecated. Existing methods like select(), select_by(),
get(), get_by() all execute the query at once and return results
like they always did. join_to()/join_via() are still there although
the generative join()/outerjoin() methods are easier to use.
- the return value for multiple mappers used with instances() now returns
a cartesian product of the requested list of mappers, represented
as a list of tuples. this corresponds to the documented behavior.
So that instances match up properly, the "uniquing" is disabled when
this feature is used.
- strings and columns can also be sent to the *args of instances() where
those exact result columns will be part of the result tuples.
- query() method is added by assignmapper. this helps with
navigating to all the new generative methods on Query.
Mike Bayer [Mon, 5 Mar 2007 23:08:52 +0000 (23:08 +0000)]
- added concept of 'require_embedded' to corresponding_column.
requires that the target column be present in a sub-element of the
target selectable.
- embedded logic above more appropriate for ClauseAdapter functionality
since its trying to "pull up" clauses that represent columns within
a larger union up to the level of the union itself.
- the "direction" test against the "foreign_keys" collection apparently
works for an exact "column 'x' is present in the collection", no proxy
relationships needed. fixes the case of relating a selectable/alias
to one of its underlying tables, probably fixes other scenarios
Mike Bayer [Mon, 5 Mar 2007 05:12:09 +0000 (05:12 +0000)]
- put an aggressive check for "flushing object A with a collection
of B's, but you put a C in the collection" error condition -
**even if C is a subclass of B**, unless B's mapper loads polymorphically.
Otherwise, the collection will later load a "B" which should be a "C"
(since its not polymorphic) which breaks in bi-directional relationships
(i.e. C has its A, but A's backref will lazyload it as a different
instance of type "B") [ticket:500]
Mike Bayer [Sat, 3 Mar 2007 21:02:26 +0000 (21:02 +0000)]
- bindparam() names are now repeatable! specify two
distinct bindparam()s with the same name in a single statement,
and the key will be shared. proper positional/named args translate
at compile time. for the old behavior of "aliasing" bind parameters
with conflicting names, specify "unique=True" - this option is
still used internally for all the auto-genererated (value-based)
bind parameters.
Mike Bayer [Sat, 3 Mar 2007 20:24:13 +0000 (20:24 +0000)]
cleanup; removed "separate foreign key" tests, polymorphic joined-table inheritance requires the same pk col name across tables;
added additional polymorphic load assertions
Mike Bayer [Fri, 2 Mar 2007 21:22:14 +0000 (21:22 +0000)]
- added "fold_equivalents" argument to Join.select(), which removes
'duplicate' columns from the resulting column clause that are known to be
equivalent based on the join condition. this is of great usage when
constructing subqueries of joins which Postgres complains about if
duplicate column names are present.
- added support to polymorphic stuff for more than one "equivalent column",
when trying to target columns in the polymorphic union; this applies
to multi-leveled inheritance
- put above-two concepts together to get the abc_inheritance tests to work
with postgres
Mike Bayer [Thu, 1 Mar 2007 20:14:17 +0000 (20:14 +0000)]
- use_labels flag on select() wont auto-create labels for literal text
column elements, since we can make no assumptions about the text. to
create labels for literal columns, you can say "somecol AS somelabel",
or use literal_column("somecol").label("somelabel")
- quoting wont occur for literal columns when they are "proxied" into the
column collection for their selectable (is_literal flag is propigated)
Mike Bayer [Wed, 28 Feb 2007 03:35:32 +0000 (03:35 +0000)]
a generating testcase that tests a three-level inheritance chain (A->B->C) and all one-to-many and many-to-one relationships between
all distinct A,B,C. still needs support for foreign key to parent table not the same col as the pk col
Mike Bayer [Sun, 25 Feb 2007 22:44:52 +0000 (22:44 +0000)]
migrated (most) docstrings to pep-257 format, docstring generator using straight <pre> + trim() func
for now. applies most of [ticket:214], compliemnts of Lele Gaifax
Mike Bayer [Thu, 22 Feb 2007 22:59:51 +0000 (22:59 +0000)]
- a full select() construct can be passed to query.select() (which
worked anyway), but also query.selectfirst(), query.selectone() which
will be used as is (i.e. no query is compiled). works similarly to
sending the results to instances().
Mike Bayer [Wed, 21 Feb 2007 21:55:45 +0000 (21:55 +0000)]
- removed deprecated method of specifying custom collections on classes;
you must now use the "collection_class" option. the old way was
beginning to produce conflicts when people used assign_mapper(), which
now patches an "options" method, in conjunction with a relationship
named "options". (relationships take precedence over monkeypatched
assign_mapper methods).
Mike Bayer [Tue, 20 Feb 2007 18:01:16 +0000 (18:01 +0000)]
fix to the fix for [ticket:454], prevent other mappers in a load operation from using the main extension option send to the query (i.e. mappers used for eager loads etc).
Mike Bayer [Tue, 20 Feb 2007 01:04:07 +0000 (01:04 +0000)]
- added "alias" argument to contains_eager(). use it to specify the string name
or Alias instance of an alias used in the query for the eagerly loaded child items.
easier to use than "decorator"
Mike Bayer [Tue, 20 Feb 2007 00:09:37 +0000 (00:09 +0000)]
- moved SynonymProperty to interfaces, since its more generalized and synonym-aware operations
take place without knowning so much about properties
- mapper options like eagerload(), lazyload(), deferred(), will work for "synonym()" relationships [ticket:485]
Rick Morrison [Sun, 18 Feb 2007 19:43:05 +0000 (19:43 +0000)]
Completed previously missed patches from tickets 422 and 415
get unit tests to work with pyodbc [ticket:481]
fix blank password on adodbapi [ticket:371]
Mike Bayer [Sat, 17 Feb 2007 23:40:31 +0000 (23:40 +0000)]
- modified patch for [ticket:379] - detecting synonyms, dblinks in reflection. test passes
except for DBLINK which I cannot get to work on my oracle-xe database.
- probable (also untested) fix for [ticket:363], better error message if we get None back for
remote table information (which is due to rights)
Mike Bayer [Sat, 17 Feb 2007 02:31:56 +0000 (02:31 +0000)]
- added a Sequence to the unicode test tables to help Oracle
- fixed named PrimaryKeyConstraint generation on oracle [ticket:466] courtesy andrija at gmail
Mike Bayer [Sat, 17 Feb 2007 01:18:54 +0000 (01:18 +0000)]
- fixed oracle list of binary types to check for their presence in the module (such as BFILE not in all versions of cx_Oracle)
- removed oracle-handicap from binary unit test to test [ticket:435] fix, added an extra row containing None
Mike Bayer [Thu, 15 Feb 2007 02:07:06 +0000 (02:07 +0000)]
- some cleanup to the unitofwork test suite (needs much more)
- fixed relationship deletion error when one-to-many child item is moved to a new
parent in a single unit of work [ticket:478]
Mike Bayer [Wed, 14 Feb 2007 02:00:49 +0000 (02:00 +0000)]
- fixed relationship deletion error where parent/child with a single column as PK/FK
on the child would raise a "blank out the primary key" error, if manually deleted
or "delete" cascade without "delete-orphan" was used
Mike Bayer [Tue, 13 Feb 2007 22:53:05 +0000 (22:53 +0000)]
- fixed argument passing to straight textual execute() on engine, connection.
can handle *args or a list instance for positional, **kwargs or a dict instance
for named args, or a list of list or dicts to invoke executemany()
Mike Bayer [Sat, 10 Feb 2007 23:39:06 +0000 (23:39 +0000)]
- implemented foreign_keys argument on relation() [ticket:385]
- PropertyLoader figures out accurate remote_side collection based
on foreign_keys, legacy foreignkey, primary/secondaryjoin/polymorphic
- reworked lazyloader, sync to work straight off foreign_keys/
remote_side collections
Mike Bayer [Tue, 6 Feb 2007 19:22:44 +0000 (19:22 +0000)]
- fixed "remote_side" in testrelationonbaseclass [ticket:461]
- added --reversetop arg to testbase to allow reversing the input collection
for topological sorts, to better reveal dependency issues
Mike Bayer [Sun, 4 Feb 2007 23:45:45 +0000 (23:45 +0000)]
- added "schema" argument to all has_table() calls, only supported so far by PG
- added basic unit test for PG reflection of tables in an alternate schema
Mike Bayer [Sun, 4 Feb 2007 03:43:22 +0000 (03:43 +0000)]
- added literal_column() to specify a column clause that should not undergo any quoting
- straight text sent to select() added as literal_column
- fix for issue in [ticket:450]
Mike Bayer [Sun, 4 Feb 2007 03:12:27 +0000 (03:12 +0000)]
- more quoting fixes for [ticket:450]...quoting more aggressive (but still skips already-quoted literals)
- got mysql to have "format" as default paramstyle even if mysql module not available, allows unit tests
to pass in non-mysql system for [ticket:457]. all the dialects should be changed to pass in their usual
paramstyle.