Mike Bayer [Wed, 7 Jul 2010 16:01:02 +0000 (12:01 -0400)]
- Removed errant many-to-many load in unitofwork
which triggered unnecessarily on expired/unloaded
collections. This load now takes place only if
passive_updates is False and the parent primary
key has changed, or if passive_deletes is False
and a delete of the parent has occurred.
[ticket:1845]
Mike Bayer [Mon, 5 Jul 2010 23:54:46 +0000 (19:54 -0400)]
- latest distribute
- added caveats to unittest README encountered with Py2.7 + current nose 0.11.3
- call counts for py2.7. all tests pass for sqlite + mysql-python + psycopg2
Mike Bayer [Sat, 3 Jul 2010 18:53:37 +0000 (14:53 -0400)]
- Added support for @classproperty to provide
any kind of schema/mapping construct from a
declarative mixin, including columns with foreign
keys, relationships, column_property, deferred.
This solves all such issues on declarative mixins.
An error is raised if any MapperProperty subclass
is specified on a mixin without using @classproperty.
[ticket:1751] [ticket:1796] [ticket:1805]
Mike Bayer [Fri, 2 Jul 2010 18:07:42 +0000 (14:07 -0400)]
- The 'default' compiler is automatically copied over
when overriding the compilation of a built in
clause construct, so no KeyError is raised if the
user-defined compiler is specific to certain
backends and compilation for a different backend
is invoked. [ticket:1838]
Mike Bayer [Fri, 2 Jul 2010 17:55:24 +0000 (13:55 -0400)]
- add typing/operator converts to Float/Numeric to get Oracle tests going again,
as we have an unusually high level of dependence on SQLA typing now
- force oracle seqs to return integers
Mike Bayer [Fri, 2 Jul 2010 16:57:15 +0000 (12:57 -0400)]
- If server_version_info is outside the usual
range of (8, ), (9, ), (10, ), a warning is emitted
which suggests checking that the FreeTDS version
configuration is using 7.0 or 8.0, not 4.2.
[ticket:1825]
Mike Bayer [Fri, 2 Jul 2010 00:50:57 +0000 (20:50 -0400)]
- Query.join() will check for a call of the
form query.join(target, clause_expression),
i.e. missing the tuple, and raise an informative
error message that this is the wrong calling form.
Mike Bayer [Thu, 1 Jul 2010 20:57:02 +0000 (16:57 -0400)]
- Oracle's "native decimal" metadata begins to return
ambiguous typing information about numerics
when columns are embedded in subqueries as well
as when ROWNUM is consulted with subqueries, as we
do for limit/offset. We've added these ambiguous
conditions to the cx_oracle "convert to Decimal()"
handler, so that we receive numerics as Decimal
in more cases instead of as floats. These are
then converted, if requested, into Integer
or Float, or otherwise kept as the lossless
Decimal [ticket:1840].
Mike Bayer [Wed, 30 Jun 2010 20:12:32 +0000 (16:12 -0400)]
- An instance which is moved to "transient", has
an incomplete or missing set of primary key
attributes, and contains expired attributes, will
raise an InvalidRequestError if an expired attribute
is accessed, instead of getting a recursion overflow.
- make_transient() removes all "loader" callables from
the state being made transient, removing any
"expired" state - all unloaded attributes reset back
to undefined, None/empty on access.
Mike Bayer [Tue, 29 Jun 2010 23:02:49 +0000 (19:02 -0400)]
replace all occurences of "closes the connection" "closes the transaction"
with explicit verbiage regarding "returns the connection to the connection
pool", "rolls back the transaction"
Mike Bayer [Fri, 25 Jun 2010 17:11:06 +0000 (13:11 -0400)]
- Won't generate "CREATE TYPE" / "DROP TYPE" if
using types.Enum on a PG version prior to 8.3 -
the supports_native_enum flag is fully
honored. [ticket:1836]
Mike Bayer [Thu, 24 Jun 2010 16:19:15 +0000 (12:19 -0400)]
- The argument to "ESCAPE" of a LIKE operator or similar
is passed through render_literal_value(), which may
implement escaping of backslashes. [ticket:1400]
- Postgresql render_literal_value() is overridden which escapes
backslashes, currently applies to the ESCAPE clause
of LIKE and similar expressions.
Ultimately this will have to detect the value of
"standard_conforming_strings" for full behavior.
[ticket:1400]
- MySQL render_literal_value() is overridden which escapes
backslashes, currently applies to the ESCAPE clause
of LIKE and similar expressions. This behavior
is derived from detecting the value of
NO_BACKSLASH_ESCAPES. [ticket:1400]
Mike Bayer [Sat, 19 Jun 2010 18:08:20 +0000 (14:08 -0400)]
- Fixed @memoized_property and @memoized_instancemethod
decorators so that Sphinx documentation picks up
these attributes and methods, such as
ResultProxy.inserted_primary_key. [ticket:1830]
Mike Bayer [Sat, 19 Jun 2010 17:25:37 +0000 (13:25 -0400)]
- a mixin class can now define a column that matches
one which is present on a __table__ defined on a
subclass. It cannot, however, define one that is
not present in the __table__, and the error message
here now works. [ticket:1821]
Mike Bayer [Fri, 18 Jun 2010 17:31:51 +0000 (13:31 -0400)]
this one is actually doing it. removed the cruft we don't need from the old approach.
not sure if one-to-many with elaborate self-refs, etc., but we appear to be
as good as we were before.
Mike Bayer [Fri, 18 Jun 2010 15:36:35 +0000 (11:36 -0400)]
this approach seems to allow many-to-one post updates to occur as a single action. for one-to-many, we
have it working the old way still. as usual the huge job is the tests. also I am not yet certain
that post updates can always be a "full mapper" operation, i.e. are never involved in per-state dependencies,
or even if the old approach supports that.
Mike Bayer [Thu, 17 Jun 2010 19:53:07 +0000 (15:53 -0400)]
- query.order_by() now accepts False, which cancels
any existing order_by() state on the Query, allowing
subsequent generative methods to be called which do
not support ORDER BY. This is not the same as the
already existing feature of passing None, which
suppresses any existing order_by() settings, including
those configured on the mapper. False will make it
as though order_by() was never called, while
None is an active setting.
Mike Bayer [Tue, 15 Jun 2010 18:04:13 +0000 (14:04 -0400)]
- Can now call make_transient() on an instance that
is referenced by parent objects via many-to-one,
without the parent's foreign key value getting
temporarily set to None - this was a function
of the "detect primary key switch" flush handler.
It now ignores objects that are no longer
in the "persistent" state, and the parent's
foreign key identifier is left unaffected.
Mike Bayer [Tue, 15 Jun 2010 00:07:44 +0000 (20:07 -0400)]
- Query.statement, Query.subquery(), etc. now transfer
the values of bind parameters, i.e. those specified
by query.params(), into the resulting SQL expression.
Previously the values would not be transferred
and bind parameters would come out as None.
- Subquery-eager-loading now works with Query objects
which include params(), as well as get() Queries.
Mike Bayer [Mon, 14 Jun 2010 23:39:26 +0000 (19:39 -0400)]
- Modified the internals of "column annotation" such that
a custom Column subclass can safely override
_constructor to return Column, for the purposes of
making "configurational" column classes that aren't
involved in proxying, etc.
Mike Bayer [Sun, 13 Jun 2010 20:25:26 +0000 (16:25 -0400)]
- Fixed bug regarding flushes on self-referential
bi-directional many-to-many relationships, where
two objects made to mutually reference each other
in one flush would fail to insert a row for both
sides. Regression from 0.5. [ticket:1824]
Mike Bayer [Sun, 13 Jun 2010 20:09:13 +0000 (16:09 -0400)]
- The warning emitted by the Unicode and String types
with convert_unicode=True no longer embeds the actual
value passed. This so that the Python warning
registry does not continue to grow in size, the warning
is emitted once as per the warning filter settings,
and large string values don't pollute the output.
[ticket:1822]
Mike Bayer [Sun, 13 Jun 2010 19:49:27 +0000 (15:49 -0400)]
- added documentation for Inspector [ticket:1820]
- fixed "toplevel" regexp to include tokens of the form foo-bar-toplevel (i.e. multiple dashes)
- some CSS adjustment so that all API headings are in gray.
Mike Bayer [Fri, 11 Jun 2010 15:38:06 +0000 (11:38 -0400)]
- Inspector hits bind.connect() when invoked to ensure
initialize has been called. the internal name ".conn"
is changed to ".bind", since that's what it is.
Mike Bayer [Mon, 31 May 2010 00:24:08 +0000 (20:24 -0400)]
- Pool classes will reuse the same "pool_logging_name" setting
after a dispose() occurs.
- Engine gains an "execution_options" argument and
update_execution_options() method, which will apply to
all connections generated by this engine.
- Added more aggressive caching to the mapper's usage of
UPDATE, INSERT, and DELETE expressions. Assuming the
statement has no per-object SQL expressions attached,
the expression objects are cached by the mapper after
the first create, and their compiled form is stored
persistently in a cache dictionary for the duration of
the related Engine.
- change #3 required change #1 so that we could test
a set of mappers operating over the course of many engines without
memory usage increase.
Mike Bayer [Thu, 27 May 2010 18:46:44 +0000 (14:46 -0400)]
- Fixed concatenation of constraints when "PRIMARY KEY"
constraint gets moved to column level due to SQLite
AUTOINCREMENT keyword being rendered. [ticket:1812]
- remove some extra space in between constraint DDL
- added alias() to binary comparison test, fixing pg + mysql failures
Mike Bayer [Thu, 27 May 2010 17:02:17 +0000 (13:02 -0400)]
- Re-established support for Oracle 8 with cx_oracle,
including that use_ansi is set to False automatically,
NVARCHAR2 and NCLOB are not rendered for Unicode,
"native unicode" check doesn't fail, cx_oracle
"native unicode" mode is disabled, VARCHAR() is emitted
with bytes count instead of char count. [ticket:1808]
Mike Bayer [Thu, 27 May 2010 15:50:16 +0000 (11:50 -0400)]
- FOR UPDATE is emitted in the syntactically correct position
when limit/offset is used, i.e. the ROWNUM subquery.
However, Oracle can't really handle FOR UPDATE with ORDER BY
or with subqueries, so its still not very usable, but at
least SQLA gets the SQL past the Oracle parser.
[ticket:1815]
Mike Bayer [Sat, 22 May 2010 23:08:48 +0000 (19:08 -0400)]
- Columns of _Binary type (i.e. LargeBinary, BLOB, etc.)
will coerce a "basestring" on the right side into a
_Binary as well so that required DBAPI processing
takes place.
Mike Bayer [Thu, 13 May 2010 19:53:18 +0000 (15:53 -0400)]
- Added table.add_is_dependent_on(othertable), allows manual
placement of dependency rules between two Table objects
for use within create_all(), drop_all(), sorted_tables.
[ticket:1801]
Mike Bayer [Mon, 10 May 2010 15:37:48 +0000 (11:37 -0400)]
- the _make_proxy() method of ColumnClause and Column now use
self.__class__ to determine the class of object to be returned
instead of hardcoding to ColumnClause/Column, making it slightly
easier to produce specific subclasses of these which work in
alias/subquery situations.
Mike Bayer [Sat, 8 May 2010 20:25:30 +0000 (16:25 -0400)]
- expr.in_() now accepts a text() construct as the argument.
Grouping parenthesis are added automatically, i.e. usage
is like `col.in_(text("select id from table"))`.
[ticket:1793]
Mike Bayer [Sat, 8 May 2010 19:08:48 +0000 (15:08 -0400)]
- the SqlSoup constructor accepts a `base` argument which specifies
the base class to use for mapped classes, the default being
`object`. [ticket:1783]