Mike Bayer [Thu, 18 Dec 2008 16:50:49 +0000 (16:50 +0000)]
- Query() can be passed a "composite" attribute
as a column expression and it will be expanded.
Somewhat related to [ticket:1253].
- Query() is a little more robust when passed
various column expressions such as strings,
clauselists, text() constructs (which may mean
it just raises an error more nicely).
- select() can accept a ClauseList as a column
in the same way as a Table or other selectable
and the interior expressions will be used as
column elements. [ticket:1253]
- removed erroneous FooTest from test/orm/query
-This line, and those below, will be ignored--
M test/orm/query.py
M test/orm/mapper.py
M test/sql/select.py
M lib/sqlalchemy/orm/query.py
M lib/sqlalchemy/sql/expression.py
M CHANGES
Mike Bayer [Wed, 17 Dec 2008 23:09:51 +0000 (23:09 +0000)]
- _execute_clauseelement() goes back to being
a private method. Subclassing Connection
is not needed now that ConnectionProxy
is available.
- tightened the interface for the various _execute_XXX()
methods to reduce ambiguity
- __distill_params() no longer creates artificial [{}] entry,
blank dict is no longer passed through to do_execute()
in any case unless explicitly sent from the outside
as in connection.execute("somestring"), {})
- fixed a few old sql.query tests which were doing that
- removed needless do_execute() from mysql dialect
- fixed charset param not properly being sent to
_compat_fetchone() in mysql
Mike Bayer [Wed, 17 Dec 2008 20:12:07 +0000 (20:12 +0000)]
- added sphinx handler to allow __init__ methods through
- sqlite module documentation
- some corrections to pool docs
- the example in URL.translate_connect_args() never made any sense anyway so removed it
Michael Trier [Fri, 12 Dec 2008 04:49:24 +0000 (04:49 +0000)]
Support for three levels of column nullability: NULL, NOT NULL, and the database's configured default.
The default Column configuration (nullable=True) will now generate NULL in the DDL. Previously no specification was emitted and the database default would take effect (usually NULL, but not always). To explicitly request the database default, configure columns with nullable=None and no specification will be emitted in DDL. Fixes #1243.
Mike Bayer [Thu, 11 Dec 2008 17:27:33 +0000 (17:27 +0000)]
- PickleType now favors == comparison by default,
if the incoming object (such as a dict) implements
__eq__(). If the object does not implement
__eq__() and mutable=True, a deprecation warning
is raised.
Mike Bayer [Wed, 10 Dec 2008 02:16:52 +0000 (02:16 +0000)]
- reworked the "SQL assertion" code to something more flexible and based off of ConnectionProxy. upcoming changes to dependency.py
will make use of the enhanced flexibility.
Mike Bayer [Mon, 8 Dec 2008 21:32:29 +0000 (21:32 +0000)]
- restored the previous API Reference structure
- bumped latex TOC structure, the PDF looks great
- but we need to fix the translate_connect_args docstring bug to really have PDF
Mike Bayer [Sun, 7 Dec 2008 23:58:02 +0000 (23:58 +0000)]
- moved index.rst around to have the API docs right there, no "Main Documentation" chapter which is fairly needless. this all allows PDF to have a decent TOC on the side with only two levels (can we change that ?)
- added LatexFormatter.
- PDF wont work until issue with the docstirng in url.py/URL.translate_connect_args is fixed.
Mike Bayer [Sun, 7 Dec 2008 06:30:00 +0000 (06:30 +0000)]
- re-documented Table and Column constructors, fixed case sensitivity description [ticket:1231]
- turned on autoclass_content="both". Need to specify __init__ docstring with a newline after the """.
- other docs
Mike Bayer [Sat, 6 Dec 2008 23:47:21 +0000 (23:47 +0000)]
- removed creepy exec call for now
- removed unnecessary isinstance() from class_mapper()
- removed unnecessary and py3k incompatible "dictionary sort" from association table delete
Mike Bayer [Sat, 6 Dec 2008 16:59:48 +0000 (16:59 +0000)]
- merged -r5338:5429 of sphinx branch.
- Documentation has been converted to Sphinx.
In particular, the generated API documentation
has been constructed into a full blown
"API Reference" section which organizes
editorial documentation combined with
generated docstrings. Cross linking between
sections and API docs are vastly improved,
a javascript-powered search feature is
provided, and a full index of all
classes, functions and members is provided.
Mike Bayer [Sat, 6 Dec 2008 00:14:50 +0000 (00:14 +0000)]
- union() and union_all() will not whack
any order_by() that has been applied to the
select()s inside. If you union() a
select() with order_by() (presumably to support
LIMIT/OFFSET), you should also call self_group()
on it to apply parenthesis.
Mike Bayer [Fri, 5 Dec 2008 14:46:27 +0000 (14:46 +0000)]
- Adjusted the format of create_xid() to repair
two-phase commit. We now have field reports
of Oracle two-phase commit working properly
with this change.
Mike Bayer [Wed, 3 Dec 2008 21:27:04 +0000 (21:27 +0000)]
- Query.with_polymorphic() now accepts a third
argument "discriminator" which will replace
the value of mapper.polymorphic_on for that
query. Mappers themselves no longer require
polymorphic_on to be set, even if the mapper
has a polymorphic_identity. When not set,
the mapper will load non-polymorphically
by default. Together, these two features allow
a non-polymorphic concrete inheritance setup
to use polymorphic loading on a per-query basis,
since concrete setups are prone to many
issues when used polymorphically in all cases.
Mike Bayer [Wed, 3 Dec 2008 17:28:36 +0000 (17:28 +0000)]
- Two fixes to help prevent out-of-band columns from
being rendered in polymorphic_union inheritance
scenarios (which then causes extra tables to be
rendered in the FROM clause causing cartesian
products):
- improvements to "column adaption" for
a->b->c inheritance situations to better
locate columns that are related to one
another via multiple levels of indirection,
rather than rendering the non-adapted
column.
- the "polymorphic discriminator" column is
only rendered for the actual mapper being
queried against. The column won't be
"pulled in" from a subclass or superclass
mapper since it's not needed.
Mike Bayer [Wed, 3 Dec 2008 06:23:55 +0000 (06:23 +0000)]
- Fixed bug introduced in 0.5rc4 involving eager
loading not functioning for properties which were
added to a mapper post-compile using
add_property() or equivalent.
Mike Bayer [Thu, 27 Nov 2008 15:59:34 +0000 (15:59 +0000)]
- fixed "double iter()" call causing bus errors
in shard API, removed errant result.close()
left over from the 0.4 version. [ticket:1099]
[ticket:1228]
Mike Bayer [Tue, 25 Nov 2008 04:43:04 +0000 (04:43 +0000)]
- Duplicate items in a list-based collection will
be maintained when issuing INSERTs to
a "secondary" table in a many-to-many relation.
Assuming the m2m table has a unique or primary key
constraint on it, this will raise the expected
constraint violation instead of silently
dropping the duplicate entries. Note that the
old behavior remains for a one-to-many relation
since collection entries in that case
don't result in INSERT statements and SQLA doesn't
manually police collections. [ticket:1232]
Mike Bayer [Mon, 24 Nov 2008 01:14:32 +0000 (01:14 +0000)]
- comparator_factory is accepted by all MapperProperty constructors. [ticket:1149]
- added other unit tests as per [ticket:1149]
- rewrote most of the "joined table inheritance" documentation section, removed badly out of
date "polymorphic_fetch" and "select_table" arguments.
- "select_table" raises a deprecation warning. converted unit tests to not use it.
- removed all references to "ORDER BY table.oid" from mapping docs.
- renamed PropertyLoader to RelationProperty. Old symbol remains.
- renamed ColumnProperty.ColumnComparator to ColumnProperty.Comparator. Old symbol remains.
Mike Bayer [Fri, 21 Nov 2008 01:21:00 +0000 (01:21 +0000)]
- Added NotImplementedError for params() method
on Insert/Update/Delete constructs. These items
currently don't support this functionality, which
also would be a little misleading compared to
values().
Mike Bayer [Fri, 14 Nov 2008 18:57:24 +0000 (18:57 +0000)]
- switched session.save() to session.add() throughout declarative test
- Fixed PendingDeprecationWarning involving order_by
parameter on relation(). [ticket:1226]
- Unit tests still filter pending deprecation warnings but have a commented-out
line to temporarily disable this behavior. Tests need to be fully converted
before we can turn this on.
Michael Trier [Fri, 14 Nov 2008 03:57:07 +0000 (03:57 +0000)]
Pulled out values test that uses boolean evaluation in the SELECT in order to appropriately flag it as not supported on mssql. I sure hope I didn't jack things up for other dialects. Cleaned up a comment and removed some commented pdb statements.
Michael Trier [Fri, 14 Nov 2008 03:57:00 +0000 (03:57 +0000)]
Fixed up a lot of missing order_by statements in the tests when using offset. A lot of dialects don't really require order_by although you'll get unpredictable results. mssql does require order_by with an offset, so this fixes problems with that dialect.
Mike Bayer [Thu, 13 Nov 2008 20:38:56 +0000 (20:38 +0000)]
- Rearranged the `load_dialect_impl()` method in
`TypeDecorator` such that it will take effect
even if the user-defined `TypeDecorator` uses
another `TypeDecorator` as its impl.
Mike Bayer [Mon, 10 Nov 2008 20:22:18 +0000 (20:22 +0000)]
- converted some more attributes to @memoized_property in expressions
- flattened an unnecessary KeyError in identity.py
- memoized the default list of mapper properties queried in MapperEntity.setup_context
Michael Trier [Mon, 10 Nov 2008 04:29:53 +0000 (04:29 +0000)]
Handle the mssql port properly. If we're using the SQL Server driver then use the correct host,port syntax, otherwise use the Port= parameter in the connection string. Fixes #1192.