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.
Michael Trier [Mon, 20 Oct 2008 15:21:00 +0000 (15:21 +0000)]
Modifications to allow the backends to control the behavior of an empty insert. If supports_empty_insert is True then the backend specifically supports the 'insert into t1 () values ()' syntax. If supports_default_values is True then the backend supports the 'insert into t1 default values' syntax. If both are false then the backend has no support for empty inserts at all and an exception gets raised. Changes here are careful to not change current behavior except where the current behavior was failing to begin with.
Mike Bayer [Sun, 19 Oct 2008 19:26:48 +0000 (19:26 +0000)]
- Improved weakref identity map memory management to no longer
require mutexing, resurrects garbage collected instance
on a lazy basis for an InstanceState with pending changes.
Michael Trier [Sun, 19 Oct 2008 03:00:22 +0000 (03:00 +0000)]
Verified that Subqueries are not allowed in VALUES. mssql supports a SELECT syntax but only as the source of all inserts.
(cherry picked from commit 4516db6b322fb1feaa04915f09b8b4fabd6b9735)
Mike Bayer [Sat, 18 Oct 2008 18:14:06 +0000 (18:14 +0000)]
- 0.5.0rc3, doh
- The internal notion of an "OID" or "ROWID" column has been
removed. It's basically not used by any dialect, and the
possibility of its usage with psycopg2's cursor.lastrowid
is basically gone now that INSERT..RETURNING is available.
- Removed "default_order_by()" method on all FromClause
objects.
- profile/compile/select test is 8 function calls over on buildbot 2.4 for some reason, will adjust after checking
the results of this commit
Mike Bayer [Sat, 18 Oct 2008 17:34:52 +0000 (17:34 +0000)]
- "not equals" comparisons of simple many-to-one relation
to an instance will not drop into an EXISTS clause
and will compare foreign key columns instead.
- removed not-really-working use cases of comparing
a collection to an iterable. Use contains() to test
for collection membership.
- Further simplified SELECT compilation and its relationship
to result row processing.
- Direct execution of a union() construct will properly set up
result-row processing. [ticket:1194]
Michael Trier [Thu, 16 Oct 2008 17:14:30 +0000 (17:14 +0000)]
Unless I'm missing something mssql doesn't support and / or within column selects. Even using the case when syntax it's not possible to test truth in this manner.
Mike Bayer [Sun, 12 Oct 2008 14:39:20 +0000 (14:39 +0000)]
- String's (and Unicode's, UnicodeText's, etc.) convert_unicode
logic disabled in the sqlite dialect, to adjust for pysqlite
2.5.0's new requirement that only Python unicode objects are
accepted;
http://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html
Michael Trier [Sat, 11 Oct 2008 16:14:20 +0000 (16:14 +0000)]
Removed the visit_function stuff in mssql dialect. Added some tests for the function overrides. Fixed up the test_select in the sql/defaults.py tests which was a mess.
Michael Trier [Sat, 11 Oct 2008 16:14:07 +0000 (16:14 +0000)]
Correction of mssql schema reflection in reflectable. Still a problem since the assumed default is dbo, whereas it could be modified by the connection. Allows SchemaTest.test_select to pass now.
Mike Bayer [Sat, 4 Oct 2008 22:39:19 +0000 (22:39 +0000)]
- using contains_eager() against an alias combined with an overall query alias repaired - the
contains_eager adapter wraps the query adapter, not vice versa. Test coverage added.
- contains_eager() will now add columns into the "primary" column collection within Query._compile_context(), instead
of the "secondary" collection. This allows those columns to get wrapped within the subquery generated
by limit/offset in conjunction with an ORM-generated eager join.
Eager strategy also picks up on context.adapter in this case to deliver the columns during result load.
contains_eager() is now compatible with the subquery generated by a regular eager load
with limit/offset. [ticket:1180]
Mike Bayer [Fri, 3 Oct 2008 03:39:52 +0000 (03:39 +0000)]
- Adjustment to Session's post-flush accounting of newly
"clean" objects to better protect against operating on
objects as they're asynchronously gc'ed. [ticket:1182]
Mike Bayer [Thu, 2 Oct 2008 02:02:51 +0000 (02:02 +0000)]
- identity_map._mutable_attrs is a plain dict since we manage weakref removal explicitly
- call list() around iteration of _mutable_attrs to guard against async gc.collect() while check_modified() is running
Ants Aasma [Tue, 30 Sep 2008 09:24:27 +0000 (09:24 +0000)]
Fixed session.transaction.commit() on a autocommit=False session not starting a new transaction.
Moved starting a new transaction in case of previous closing into SessionTransaction.
Mike Bayer [Sun, 28 Sep 2008 19:10:22 +0000 (19:10 +0000)]
- session.execute() will execute a Sequence object passed to
it (regression from 0.4).
- Removed the "raiseerror" keyword argument from object_mapper()
and class_mapper(). These functions raise in all cases
if the given class/instance is not mapped.
- Refined ExtensionCarrier to be itself a dict, removed
'methods' accessor
- moved identity_key tests to test/orm/utils.py
- some docstrings