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.
Mike Bayer [Sun, 9 Nov 2008 16:06:05 +0000 (16:06 +0000)]
- Query.count() has been enhanced to do the "right
thing" in a wider variety of cases. It can now
count multiple-entity queries, as well as
column-based queries. Note that this means if you
say query(A, B).count() without any joining
criterion, it's going to count the cartesian
product of A*B. Any query which is against
column-based entities will automatically issue
"SELECT count(1) FROM (SELECT...)" so that the
real rowcount is returned, meaning a query such as
query(func.count(A.name)).count() will return a value of
one, since that query would return one row.
Michael Trier [Sun, 9 Nov 2008 05:21:38 +0000 (05:21 +0000)]
Corrected problems with Access dialect. Corrected issue with reflection due to missing Currency type. Functions didn't return the value. JOINS must be specified as LEFT OUTER JOIN or INNER JOIN. Fixes #1017.
Mike Bayer [Sat, 8 Nov 2008 21:00:15 +0000 (21:00 +0000)]
removed setup_instance() from the public API
of ClassManager, and made it a private method on
_ClassInstrumentationAdapter. ClassManager's approach
handles the default task with fewer function calls which chops off
a few hundred calls from the pertinent profile tests.
Mike Bayer [Thu, 6 Nov 2008 23:07:47 +0000 (23:07 +0000)]
- Fixed bug in Query involving order_by() in conjunction with
multiple aliases of the same class (will add tests in
[ticket:1218])
- Added a new extension sqlalchemy.ext.serializer. Provides
Serializer/Deserializer "classes" which mirror Pickle/Unpickle,
as well as dumps() and loads(). This serializer implements
an "external object" pickler which keeps key context-sensitive
objects, including engines, sessions, metadata, Tables/Columns,
and mappers, outside of the pickle stream, and can later
restore the pickle using any engine/metadata/session provider.
This is used not for pickling regular object instances, which are
pickleable without any special logic, but for pickling expression
objects and full Query objects, such that all mapper/engine/session
dependencies can be restored at unpickle time.
Mike Bayer [Wed, 5 Nov 2008 20:50:48 +0000 (20:50 +0000)]
- Dialects can now generate label names of adjustable length.
Pass in the argument "label_length=<value>" to create_engine()
to adjust how many characters max will be present in dynamically
generated column labels, i.e. "somecolumn AS somelabel". Any
value less than 6 will result in a label of minimal size,
consiting of an underscore and a numeric counter.
The compiler uses the value of dialect.max_identifier_length
as a default. [ticket:1211]
- removed ANON_NAME regular expression, using string patterns now
- _generated_label() unicode subclass is used to indicate generated names
which are subject to truncation
Mike Bayer [Tue, 4 Nov 2008 17:28:26 +0000 (17:28 +0000)]
- Simplified the check for ResultProxy "autoclose without results"
to be based solely on presence of cursor.description.
All the regexp-based guessing about statements returning rows
has been removed [ticket:1212].
Mike Bayer [Mon, 3 Nov 2008 02:52:30 +0000 (02:52 +0000)]
- Improved the behavior of aliased() objects such that they more
accurately adapt the expressions generated, which helps
particularly with self-referential comparisons. [ticket:1171]
- Fixed bug involving primaryjoin/secondaryjoin conditions
constructed from class-bound attributes (as often occurs
when using declarative), which later would be inappropriately
aliased by Query, particularly with the various EXISTS
based comparators.
Mike Bayer [Sun, 2 Nov 2008 17:10:37 +0000 (17:10 +0000)]
- mapper naming/organization cleanup
- gave into peer pressure and removed all __names
- inlined polymorphic_iterator()
- moved methods into categories based on configuration, inspection, persistence, row processing.
a more extreme change would be to make separate mixin classes for these or similar.
Mike Bayer [Thu, 30 Oct 2008 14:40:10 +0000 (14:40 +0000)]
the recent change to garbage collection of InstanceState meant that
the deferred lambda: created by lazy_clause would get a state with
no dict. creates strong reference to the object now.
Jonathan Ellis [Wed, 29 Oct 2008 00:48:33 +0000 (00:48 +0000)]
allow repr to leave stuff as unicode. I can't think of any reason for the old behavior except that I didn't understand unicode when I wrote it. Not that I claim to fully understand it now. fixes #1136
Mike Bayer [Tue, 28 Oct 2008 20:15:26 +0000 (20:15 +0000)]
- added some abstraction to the attributes.History object
- Repaired support for "passive-deletes" on a many-to-one
relation() with "delete" cascade. [ticket:1183]
Mike Bayer [Sat, 25 Oct 2008 19:44:21 +0000 (19:44 +0000)]
- moved _FigureVisitName into visitiors.VisitorType, added Visitor base class to reduce dependencies
- implemented _generative decorator for select/update/insert/delete constructs
- other minutiae
Mike Bayer [Sat, 25 Oct 2008 18:04:59 +0000 (18:04 +0000)]
- When using Query.join() with an explicit clause for the
ON clause, the clause will be aliased in terms of the left
side of the join, allowing scenarios like query(Source).
from_self().join((Dest, Source.id==Dest.source_id)) to work
properly.
Mike Bayer [Fri, 24 Oct 2008 15:58:17 +0000 (15:58 +0000)]
- fixed some oracle unit tests in test/sql/
- wrote a docstring for oracle dialect, needs formatting perhaps
- made FIRST_ROWS optimization optional based on optimize_limits=True, [ticket:536]
Mike Bayer [Wed, 22 Oct 2008 16:09:19 +0000 (16:09 +0000)]
- Added more granularity to internal attribute access, such
that cascade and flush operations will not initialize
unloaded attributes and collections, leaving them intact for
a lazy-load later on. Backref events still initialize
attrbutes and collections for pending instances.
[ticket:1202]
Mike Bayer [Tue, 21 Oct 2008 16:17:24 +0000 (16:17 +0000)]
- added NoReferencedColumnError, common base class of NoReferenceError
- relation() won't hide unrelated ForeignKey errors inside of
the "please specify primaryjoin" message when determining
join condition.
Ants Aasma [Mon, 20 Oct 2008 20:41:09 +0000 (20:41 +0000)]
Slightly changed behavior of IN operator for comparing to empty collections. Now results in inequality comparison against self. More portable, but breaks with stored procedures that aren't pure functions.