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
Mike Bayer [Thu, 25 Sep 2008 15:59:37 +0000 (15:59 +0000)]
- fixed RLock-related bug in mapper which could deadlock
upon reentrant mapper compile() calls, something that
occurs when using declarative constructs inside of
ForeignKey objects.
Mike Bayer [Fri, 19 Sep 2008 22:59:28 +0000 (22:59 +0000)]
- Overhauled SQLite date/time bind/result processing
to use regular expressions and format strings, rather
than strptime/strftime, to generically support
pre-1900 dates, dates with microseconds. [ticket:968]
Get a bit more speed into the new _sort_states function. It's probably possible
to get even more speed by getting rid of the decorator and call the method
directly, but it makes for slightly less readable code so I won't do it since I
don't know whether this code is speed-critical or not.
Mike Bayer [Fri, 19 Sep 2008 01:34:28 +0000 (01:34 +0000)]
- Fixed bug involving read/write relation()s that
contain literal or other non-column expressions
within their primaryjoin condition equated
to a foreign key column.
- fixed UnmappedColumnError exception raise to not assume it was passed a column
Mike Bayer [Thu, 18 Sep 2008 21:41:37 +0000 (21:41 +0000)]
- "non-batch" mode in mapper(), a feature which allows
mapper extension methods to be called as each instance
is updated/inserted, now honors the insert order
of the objects given.
- added some tests, some commented out, involving [ticket:1171]
Mike Bayer [Tue, 16 Sep 2008 18:17:34 +0000 (18:17 +0000)]
- version bump
- turned properties in sql/expressions.py to @property
- column.in_(someselect) can now be used as
a columns-clause expression without the subquery
bleeding into the FROM clause [ticket:1074]
Mike Bayer [Mon, 15 Sep 2008 21:29:28 +0000 (21:29 +0000)]
- annual unitofwork cleanup
- moved conversion of cyclical sort to UOWTask structure to be non-recursive
- reduced some verbosity
- rationale for the "tree" sort clarified
- would love to flatten all of uow topological sorting, sorting within mapper._save_obj() into a single sort someday
Mike Bayer [Thu, 11 Sep 2008 19:35:40 +0000 (19:35 +0000)]
- Added scalar() and value() methods to Query, each return a
single scalar value. scalar() takes no arguments and is
roughly equivalent to first()[0], value()
takes a single column expression and is roughly equivalent to
values(expr).next()[0].
Mike Bayer [Wed, 10 Sep 2008 21:09:04 +0000 (21:09 +0000)]
- the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without
the parenthesis, which seem to get in the way when using in
conjunction with executemany().
Mike Bayer [Mon, 8 Sep 2008 22:50:37 +0000 (22:50 +0000)]
- The exists() construct won't "export" its contained list
of elements as FROM clauses, allowing them to be used more
effectively in the columns clause of a SELECT.
- and_() and or_() now generate a ColumnElement, allowing
boolean expressions as result columns, i.e.
select([and_(1, 0)]). [ticket:798]
Mike Bayer [Mon, 8 Sep 2008 03:51:47 +0000 (03:51 +0000)]
- Added func.min(), func.max(), func.sum() as "generic functions",
which basically allows for their return type to be determined
automatically. Helps with dates on SQLite, decimal types,
others. [ticket:1160]
- added decimal.Decimal as an "auto-detect" type; bind parameters
and generic functions will set their type to Numeric when a
Decimal is used.
Mike Bayer [Fri, 5 Sep 2008 17:16:11 +0000 (17:16 +0000)]
- rearranged delete() so that the object is attached before
cascades fire off [ticket:5058]
- after_attach() only fires if the object was not previously attached
Mike Bayer [Wed, 3 Sep 2008 16:53:05 +0000 (16:53 +0000)]
- limit/offset no longer uses ROW NUMBER OVER to limit rows,
and instead uses subqueries in conjunction with a special
Oracle optimization comment. Allows LIMIT/OFFSET to work
in conjunction with DISTINCT. [ticket:536]
Mike Bayer [Tue, 2 Sep 2008 19:51:48 +0000 (19:51 +0000)]
- column_property(), composite_property(), and relation() now
accept a single or list of AttributeExtensions using the
"extension" keyword argument.
- Added a Validator AttributeExtension, as well as a
@validates decorator which is used in a similar fashion
as @reconstructor, and marks a method as validating
one or more mapped attributes.
- removed validate_attributes example, the new methodology replaces it
Mike Bayer [Tue, 2 Sep 2008 17:57:35 +0000 (17:57 +0000)]
- AttributeListener has been refined such that the event
is fired before the mutation actually occurs. Addtionally,
the append() and set() methods must now return the given value,
which is used as the value to be used in the mutation operation.
This allows creation of validating AttributeListeners which
raise before the action actually occurs, and which can change
the given value into something else before its used.
A new example "validate_attributes.py" shows one such recipe
for doing this. AttributeListener helper functions are
also on the way.
Mike Bayer [Fri, 29 Aug 2008 16:31:58 +0000 (16:31 +0000)]
- The "extension" argument to Session and others can now
optionally be a list, supporting events sent to multiple
SessionExtension instances. Session places SessionExtensions
in Session.extensions.
Mike Bayer [Thu, 28 Aug 2008 18:21:42 +0000 (18:21 +0000)]
- starargs_as_list was not actually issuing SAPendingDeprecationWarning, fixed
- implemented code cleanup from [ticket:1152] but not including using the decorators module
Mike Bayer [Thu, 28 Aug 2008 17:11:18 +0000 (17:11 +0000)]
- Fixed bug whereby deferred() columns with a group in conjunction
with an otherwise unrelated synonym() would produce
an AttributeError during deferred load.
Mike Bayer [Sun, 24 Aug 2008 21:52:38 +0000 (21:52 +0000)]
- Fixed bug whereby changing a primary key attribute on an
entity where the attribute's previous value had been expired
would produce an error upon flush(). [ticket:1151]
Mike Bayer [Sun, 24 Aug 2008 21:10:36 +0000 (21:10 +0000)]
- logging scale-back; the echo_uow flag on Session is deprecated, and unit of work logging is now
class level like all the other logging.
- trimmed back the logging API, centralized class_logger() as the single point of configuration for
logging, removed per-instance logging checks from ORM.
- Engine and Pool logging remain at the instance level. The modulus of "instance ids" has been upped
to 65535. I'd like to remove the modulus altogether but I do see a couple of users each month
calling create_engine() on a per-request basis, an incorrect practice but I'd rather their applications
don't just run out of memory.