Mike Bayer [Sun, 5 Dec 2010 06:41:37 +0000 (01:41 -0500)]
- inline the various construction methods of DefaultExecutionContext. This
makes it sort of easier to read, sort of harder, depending on where you look.
Cuts down two or three method calls on execute.
Mike Bayer [Sun, 5 Dec 2010 05:46:11 +0000 (00:46 -0500)]
- ResultProxy and friends always reference the DBAPI connection at the same time
as the cursor. There is no reason for CursorFairy - the only use case would be,
end-user is using the pool or pool.manage with DBAPI connections, uses a cursor,
deferences the owning connection and continues using cursor. This is an almost
nonexistent use case and isn't correct usage at a DBAPI level. Take out CursorFairy.
- move the "check for a dot in the colname" logic out to the sqlite dialect.
Mike Bayer [Mon, 29 Nov 2010 23:38:44 +0000 (18:38 -0500)]
- use class name by itself in flush warnings to prevent overflow of warnings registry
- test suite swaps out warnings.warn with warnings.warn_explicit, to solve warnings registry issue
- explicitly disallow functions from inside test.bootstrap, test.lib being interpreted as tests
Mike Bayer [Sun, 28 Nov 2010 21:27:44 +0000 (16:27 -0500)]
after some usage, its clear that [ticket:1974] should not be implemented. backrefs
add to collections so its expected that collection membership would mirror in session
membership.
Backed out changeset e836366c843cd64a0df569582534868e3fb00f3b
Mike Bayer [Sun, 28 Nov 2010 19:19:44 +0000 (14:19 -0500)]
- sqlalchemy.test and nose plugin moves back to being entirely
outside of "sqlalchemy" and under "test/".
Rationale:
- coverage plugin works without issue, without need for an awkward
additional package install
- command line for "nosetests" isn't polluted with SQLAlchemy options
Mike Bayer [Sun, 28 Nov 2010 18:45:51 +0000 (13:45 -0500)]
- a column with a "mutable" type mapped as "deferred" will not
emit a load for the "old" value upon a set event,
unless the "active_history" flag is set to True. [ticket:1976]
Mike Bayer [Sun, 28 Nov 2010 18:40:56 +0000 (13:40 -0500)]
- Pooling methods now underscored or removed:
Pool.create_connection() -> Pool._create_connection()
Pool.do_get() -> Pool._do_get()
Pool.do_return_conn() -> Pool._do_return_conn()
Pool.do_return_invalid() -> removed, was not used
Pool.return_conn() -> Pool._return_conn()
Pool.get() -> Pool._get(), public API is Pool.connect()
SingletonThreadPool.cleanup() -> _cleanup()
SingletonThreadPool.dispose_local() -> removed, use conn.invalidate()
Mike Bayer [Sun, 28 Nov 2010 17:14:51 +0000 (12:14 -0500)]
- the names used in the NamedTuple returned by Query.__iter__()
will be transferred from the individual Query objects that compose
a union() or similar, as opposed to returning the "table_colname"
alias generated when subqueries are generated. [ticket:1942]
Mike Bayer [Sun, 28 Nov 2010 17:00:01 +0000 (12:00 -0500)]
- NullPool is now used by default for SQLite file-
based databases. :memory: databases will continue
to select SingletonThreadPool by default.
[ticket:1921]
Mike Bayer [Sun, 28 Nov 2010 16:52:24 +0000 (11:52 -0500)]
- post_process_text() is called for DDL() constructs, in particular allowing
'%' with only one level of escaping. Note this is backwards-incompatible
with previously triple-escaped sections. [ticket:1897]
Mike Bayer [Sat, 20 Nov 2010 22:57:30 +0000 (17:57 -0500)]
- fixes for PG, mysql, twophase
- added "pool_events" arg to create_engine(), "events" to pool, allowing
establishment of listeners which fire before those of the dialect
Mike Bayer [Sat, 20 Nov 2010 21:28:39 +0000 (16:28 -0500)]
- logging has been overhauled such that engines no longer need to encode the
"hex id" string in their logging name in order to maintain separate loggers
per engine. thanks to Vinay Sajip for assistance. merge of [ticket:1926]
Mike Bayer [Sat, 20 Nov 2010 21:25:12 +0000 (16:25 -0500)]
- the column assigned to polymorphic_on now behaves like any other
mapped attribute, in that it can be assigned to, mapped to multiple
columns. It is also populated immediately upon object construction
with its class-based value, so the attribute can be read before
any flush occurs. [ticket:1895]
Mike Bayer [Sat, 20 Nov 2010 20:43:12 +0000 (15:43 -0500)]
- bindparam() gets a new option "callable", which is a lambda or def
evaluated at execution time to determine the value. This replaces
the implicit recognition of callables sent as the primary value
of bindparam(), which was an undocumented behavior used by the ORM.
The argument is separated now so that values can be passed to
bindparams that are also callables without ambiguity, such
as user defined objects that include a __call__() method.
[ticket:1950]
Mike Bayer [Sat, 20 Nov 2010 20:28:18 +0000 (15:28 -0500)]
- add distinct tests for mapping to join with "exclude" prop versus "explicit",
should be the last thing needed for [ticket:1896], related to [ticket:1892]
Mike Bayer [Sat, 20 Nov 2010 19:52:21 +0000 (14:52 -0500)]
- the in-flush check for "pending orphan being flushed" has been removed.
It's now possible to issue INSERT for an object that would otherwise
be an orphan due to no parent object specified, along a relationship
that specifies "delete-orphan" cascade. The detection of this condition
as an error should now be accomplished via NOT NULL foreign keys.
[ticket:1912]
Mike Bayer [Sat, 20 Nov 2010 18:44:03 +0000 (13:44 -0500)]
- the ordering of columns in a multi-column property now is in
reverse order of which they were added to the property. A
typical effect of this is that the ".id" attribute on a
joined-inheritance subclass, where both parent/child tables
name the PK column ".id", will reference the ".id" column of
the child table, not the parent, thus allowing join conditions
and such to be constructed more intuitively. This is a
behavior change for some joined-table inheritance queries.
[ticket:1892]
- it's now an error condition to map to a join where multiple
same-named columns from each table combine themselves
implicitly. An explicit mention in the "properties" dictionary
should be specified, using a list of columns, or
column_property(*cols) with declarative. [ticket:1892]
Mike Bayer [Fri, 19 Nov 2010 23:44:09 +0000 (18:44 -0500)]
- active_history flag also added to composite().
The flag has no effect in 0.6, but is instead
a placeholder flag for forwards compatibility,
as it will be needed in 0.7 for composites.
[ticket:1976]
Mike Bayer [Thu, 18 Nov 2010 23:44:35 +0000 (18:44 -0500)]
- Added as_uuid=True flag to the UUID type, will receive
and return values as Python UUID() objects rather than
strings. Currently, the UUID type is only known to
work with psycopg2. [ticket:1956]
Mike Bayer [Thu, 18 Nov 2010 19:55:19 +0000 (14:55 -0500)]
- Added active_history flag to relationship()
and column_property(), forces attribute events to
always load the "old" value, so that it's available to
attributes.get_history(). [ticket:1961]
- modernize test_relationship, give test classes meaningful names
Mike Bayer [Thu, 18 Nov 2010 17:19:31 +0000 (12:19 -0500)]
- The cx_oracle "decimal detection" logic, which takes place
for for result set columns with ambiguous numeric characteristics,
now uses the decimal point character determined by the locale/
NLS_LANG setting, using an on-first-connect detection of
this character. cx_oracle 5.0.3 or greater is also required
when using a non-period-decimal-point NLS_LANG setting.
[ticket:1953].
Mike Bayer [Thu, 18 Nov 2010 00:34:47 +0000 (19:34 -0500)]
- establish a consistent pattern of behavior along o2m, m2m, and m2o relationships
when "save-update" cascade is disabled, or the target object is otherwise not
present in the session, and collection/scalar changes have taken place. A warning
is emitted describing the type of operation, the target reference, and the relationship
description, stating that the operation will not take place. The operation then doesn't
take place. [ticket:1973]
- clean up test_cascade a little bit, remove cruft
Mike Bayer [Sun, 14 Nov 2010 18:59:03 +0000 (13:59 -0500)]
- pool event tests that don't depend on deprecated listener system,
attempting "test just one thing" style
- reorganize fixtures to come primarily from the base test class
Mike Bayer [Sat, 13 Nov 2010 18:19:36 +0000 (13:19 -0500)]
- move inline "import" statements to use new "util.importlater()" construct. cuts
down on clutter, timeit says there's a teeny performance gain, at least where
the access is compared against attr.subattr. these aren't super-critical
calls anyway
- slight inlining in _class_to_mapper
Mike Bayer [Fri, 12 Nov 2010 15:49:17 +0000 (10:49 -0500)]
- On the same theme, the REFERENCES clause in a CREATE TABLE
that includes a remote schema to a *different* schema
than that of the parent table doesn't render at all,
as cross-schema references do not appear to be supported.
Mike Bayer [Fri, 12 Nov 2010 15:36:03 +0000 (10:36 -0500)]
- The REFERENCES clause in a CREATE TABLE that includes
a remote schema name now renders the remote name without
the schema clause, as required by SQLite. [ticket:1851]