Mike Bayer [Mon, 12 Mar 2012 20:35:27 +0000 (13:35 -0700)]
- [bug] Fixed bug whereby a primaryjoin
condition with a "literal" in it would
raise an error on compile with certain
kinds of deeply nested expressions
which also needed to render the same
bound parameter name more than once.
[ticket:2425]
Mike Bayer [Mon, 12 Mar 2012 20:14:14 +0000 (13:14 -0700)]
- add __table_cls__ option to declarative, not publicized yet, is for the moment
for the benefit of the test.lib.schema package.
- use test.lib.schema.Table for the table within test.lib.fixtures.DeclarativeMappedTest
- [bug] Removed the check for number of
rows affected when doing a multi-delete
against mapped objects. If an ON DELETE
CASCADE exists between two rows, we can't
get an accurate rowcount from the DBAPI;
this particular count is not supported
on most DBAPIs in any case, MySQLdb
is the notable case where it is.
[ticket:2403]
Mike Bayer [Sun, 11 Mar 2012 00:18:52 +0000 (16:18 -0800)]
- [bug] Fixed memory leak in core which would
occur when C extensions were used with
particular types of result fetches,
in particular when orm query.count()
were called. [ticket:2427]
Mike Bayer [Thu, 8 Mar 2012 03:36:22 +0000 (22:36 -0500)]
- [bug] Fixed event registration bug
which would primarily show up as
events not being registered with
sessionmaker() instances created
after the event was associated
with the Session class. [ticket:2424]
Mike Bayer [Sat, 3 Mar 2012 18:00:44 +0000 (13:00 -0500)]
- [feature] Added cte() method to Query,
invokes common table expression support
from the Core (see below). [ticket:1859]
- [feature] Added support for SQL standard
common table expressions (CTE), allowing
SELECT objects as the CTE source (DML
not yet supported). This is invoked via
the cte() method on any select() construct.
[ticket:1859]
Mike Bayer [Wed, 29 Feb 2012 22:47:59 +0000 (17:47 -0500)]
- expand the check to determine if a selectable column is embedded
in the corresponding selectable to take into account clones
of the target column. fixes [ticket:2419]
- have _make_proxy() copy out the _is_clone_of attribute on the
new column so that even more corresponding_column() checks
work as expected for cloned elements.
- add a new test fixture so that mapped tests can be specified
using declarative.
Mike Bayer [Tue, 28 Feb 2012 21:13:26 +0000 (16:13 -0500)]
remove the "produce test" approach from the polymorphic_rel tests,
break out fixtures into a separate module which will be
used by some future test suites as well
Mike Bayer [Tue, 21 Feb 2012 15:49:38 +0000 (10:49 -0500)]
- [bug] A warning is emitted when a not-present
column is stated in the values() clause
of an insert() or update() construct.
Will move to an exception in 0.8.
[ticket:2413]
Mike Bayer [Fri, 17 Feb 2012 00:29:00 +0000 (19:29 -0500)]
break up _join_left_to_right to call upon _prepare_right_side and _join_to_left.
this separates the handling of each side totally making it easier to see
what's going on.
Mike Bayer [Thu, 16 Feb 2012 23:54:10 +0000 (18:54 -0500)]
- fix some unclear phrases in query regarding polymorphic,
slowly approaching [ticket:2333]
- pep8 most of the big old polymorphic tests, break lots
of the inheritance/test_query tests into individual tests
since these are the ones that are easily broken when
screwing with query
Mike Bayer [Tue, 14 Feb 2012 17:04:04 +0000 (12:04 -0500)]
- [bug] Altered _params_from_query() function
in Beaker example to pull bindparams from the
fully compiled statement, as a quick means
to get everything including subqueries in the
columns clause, etc.
Mike Bayer [Tue, 14 Feb 2012 01:07:44 +0000 (20:07 -0500)]
- [feature] Added "no_parameters=True" execution
option for connections. If no parameters
are present, will pass the statement
as cursor.execute(statement), thereby invoking
the DBAPIs behavior when no parameter collection
is present; for psycopg2 and mysql-python, this
means not interpreting % signs in the string.
This only occurs with this option, and not
just if the param list is blank, as otherwise
this would produce inconsistent behavior
of SQL expressions that normally escape percent
signs (and while compiling, can't know ahead of
time if parameters will be present in
some cases). [ticket:2407]
Mike Bayer [Mon, 13 Feb 2012 21:04:57 +0000 (16:04 -0500)]
- [bug] Fixed bug whereby MappedCollection
would not get the appropriate collection
instrumentation if it were only used
in a custom subclass that used
@collection.internally_instrumented.
[ticket:2406]
- added docs for collection
Mike Bayer [Mon, 13 Feb 2012 00:06:49 +0000 (19:06 -0500)]
- break out sample URLs into individual, per-database sections each with a link
to the dialect page.
- add a section for unix domain sockets under psycopg2 [ticket:2393]
Mike Bayer [Sun, 12 Feb 2012 23:45:17 +0000 (18:45 -0500)]
- [feature] Added a new oracle create_engine() flag
coerce_to_decimal=False, disables the precision
numeric handling which can add lots of overhead
by converting all numeric values to
Decimal. [ticket:2399]
Mike Bayer [Sun, 12 Feb 2012 23:07:41 +0000 (18:07 -0500)]
- [feature] Added support for the "isolation_level"
parameter to all MySQL dialects. Thanks
to mu_mind for the patch here. [ticket:2394]
- add documentation examples for mysql, postgresql
- pep8ing
Mike Bayer [Sun, 12 Feb 2012 22:47:36 +0000 (17:47 -0500)]
- [bug] Index will raise when arguments passed
cannot be interpreted as columns or expressions.
Will warn when Index is created
with no columns at all. [ticket:2380]
Mike Bayer [Sun, 12 Feb 2012 22:28:20 +0000 (17:28 -0500)]
- [bug] Fixed bug whereby if a method name
conflicted with a column name, a
TypeError would be raised when the mapper
tried to inspect the __get__() method
on the method object. [ticket:2352]
Mike Bayer [Sun, 12 Feb 2012 21:43:26 +0000 (16:43 -0500)]
- add a context manager availble via Engine.begin()
- add a test suite for all the Engine/Connection/TLEngine transaction/begin
helpers/context managers
- update docs
Mike Bayer [Wed, 8 Feb 2012 22:41:40 +0000 (17:41 -0500)]
some work on the #1401 branch has discovered that this very old test is pointless;
it slightly exercises post_update but not much compared to modern tests,
and also illustrates a mapping that doesn't actually work currently.
Mike Bayer [Sun, 5 Feb 2012 21:58:32 +0000 (16:58 -0500)]
- [bug] Added support for using the .key
of a Column as a string identifier in a
result set row. The .key is currently
listed as an "alternate" name for a column,
and is superseded by the name of a column
which has that key value as its regular name.
For the next major release
of SQLAlchemy we may reverse this precedence
so that .key takes precedence, but this
is not decided on yet. [ticket:2392]
Mike Bayer [Sun, 5 Feb 2012 19:22:55 +0000 (14:22 -0500)]
- [bug] A significant change to how labeling
is applied to columns in SELECT statements
allows "truncated" labels, that is label names
that are generated in Python which exceed
the maximum identifier length (note this is
configurable via label_length on create_engine()),
to be properly referenced when rendered inside
of a subquery, as well as to be present
in a result set row using their original
in-Python names. [ticket:2396]
Mike Bayer [Wed, 1 Feb 2012 15:14:28 +0000 (10:14 -0500)]
- [feature] Added pool_reset_on_return argument
to create_engine, allows control over
"connection return" behavior. Also added
new arguments 'rollback', 'commit', None
to pool.reset_on_return to allow more control
over connection return activity. [ticket:2378]
Mike Bayer [Tue, 31 Jan 2012 00:52:07 +0000 (19:52 -0500)]
break out _save_obj(), _delete_obj(), _post_update() into a new module
persistence.py - Mapper loses awareness of how to emit INSERT/UPDATE/DELETE,
persistence.py is only used by unitofwork.py. Then break each method out
into a top level with almost no logic, calling into _organize_states_for_XYZ(),
_collect_XYZ_commands(), _emit_XYZ_statements().
Mike Bayer [Mon, 30 Jan 2012 22:52:28 +0000 (17:52 -0500)]
- [bug] Scaled back the test applied within
flush() to check for UPDATE against partially
NULL PK within one table to only actually
happen if there's really an UPDATE to occur.
[ticket:2390]
Mike Bayer [Sat, 28 Jan 2012 23:16:46 +0000 (18:16 -0500)]
- [bug] Improved the "declarative reflection"
example to support single-table inheritance,
multiple calls to prepare(), tables that
are present in alternate schemas,
establishing only a subset of classes
as reflected.
Mike Bayer [Sat, 28 Jan 2012 22:31:39 +0000 (17:31 -0500)]
- [feature] New declarative reflection example
added, illustrates how best to mix table reflection
with declarative as well as uses some new features
from [ticket:2356].
Mike Bayer [Sat, 28 Jan 2012 20:54:28 +0000 (15:54 -0500)]
- [feature] New reflection feature "autoload_replace";
when set to False on Table, the Table can be autoloaded
without existing columns being replaced. Allows
more flexible chains of Table construction/reflection
to be constructed, including that it helps with
combining Declarative with table reflection.
See the new example on the wiki. [ticket:2356]
- [bug] Improved the API for add_column() such that
if the same column is added to its own table,
an error is not raised and the constraints
don't get doubled up. Also helps with some
reflection/declarative patterns. [ticket:2356]
Mike Bayer [Sat, 28 Jan 2012 20:23:56 +0000 (15:23 -0500)]
- [bug] removed an erroneous "raise" in the
SQLite dialect when getting table names
and view names, where logic is in place
to fall back to an older version of
SQLite that doesn't have the
"sqlite_temp_master" table.
Mike Bayer [Sat, 28 Jan 2012 20:20:21 +0000 (15:20 -0500)]
- [feature] Dialect-specific compilers now raise
CompileException for all type/statement compilation
issues, instead of InvalidRequestError or ArgumentError.
The DDL for CREATE TABLE will re-raise
CompileExceptions to include table/column information
for the problematic column. [ticket:2361]
Mike Bayer [Sat, 28 Jan 2012 19:33:29 +0000 (14:33 -0500)]
- [bug] Fixed bug where "merge" cascade could
mis-interpret an unloaded attribute, if the
load_on_pending flag were used with
relationship(). Thanks to Kent Bower
for tests. [ticket:2374]
Mike Bayer [Sat, 28 Jan 2012 19:20:25 +0000 (14:20 -0500)]
- [bug] Fixed issue where the "required" exception
would not be raised for bindparam() with required=True,
if the statement were given no parameters at all.
[ticket:2381]
Mike Bayer [Sat, 28 Jan 2012 18:48:05 +0000 (13:48 -0500)]
- [bug] Fixed bug where unpickled object didn't
have enough of its state set up to work
correctly within the unpickle() event established
by the mutable object extension, if the object
needed ORM attribute access within
__eq__() or similar. [ticket:2362]
Mike Bayer [Sat, 28 Jan 2012 15:45:23 +0000 (10:45 -0500)]
- [bug] Fixed regression from 0.7.4 whereby
using an already instrumented column from a
superclass as "polymorphic_on" failed to resolve
the underlying Column. [ticket:2345]
Mike Bayer [Sat, 28 Jan 2012 02:19:26 +0000 (21:19 -0500)]
- [bug] Added a boolean check for the "finalize"
function within the pool connection proxy's
weakref callback before calling it, so that a
warning isn't emitted that this function is None
when the application is exiting and gc has
removed the function from the module before the
weakref callback was invoked. [ticket:2383]
Mike Bayer [Sat, 28 Jan 2012 02:05:17 +0000 (21:05 -0500)]
- [bug] Changed LRUCache, used by the mapper
to cache INSERT/UPDATE/DELETE statements,
to use an incrementing counter instead
of a timestamp to track entries, for greater
reliability versus using time.time(), which
can cause test failures on some platforms.
[ticket:2379]
Mike Bayer [Sat, 28 Jan 2012 01:59:33 +0000 (20:59 -0500)]
- [bug] implemented standard "can't set attribute" /
"can't delete attribute" AttributeError when
setattr/delattr used on a hybrid that doesn't
define fset or fdel. [ticket:2353]
Mike Bayer [Sat, 28 Jan 2012 01:32:52 +0000 (20:32 -0500)]
- [bug] Fixed issue where modified session state
established after a failed flush would be committed
as part of the subsequent transaction that
begins automatically after manual call
to rollback(). The state of the session is
checked within rollback(), and if new state
is present, a warning is emitted and
restore_snapshot() is called a second time,
discarding those changes. [ticket:2389]
- repaired testing.assert_warnings to also verify
that any warnings were emitted
Mike Bayer [Mon, 23 Jan 2012 01:11:03 +0000 (20:11 -0500)]
- [feature] Added new capability to relationship
loader options to allow "default" loader strategies.
Pass '*' to any of joinedload(), lazyload(),
subqueryload(), or noload() and that becomes the
loader strategy used for all relationships,
except for those explicitly stated in the
Query. Thanks to up-and-coming contributor
Kent Bower for an exhaustive and well
written test suite ! [ticket:2351]