Mike Bayer [Fri, 22 Feb 2008 23:17:15 +0000 (23:17 +0000)]
- the value of a bindparam() can be a callable, in which
case it's evaluated at statement execution time to
get the value.
- expressions used in filter(), filter_by() and others,
when they make usage of a clause generated from a
relation using the identity of a child object
(e.g. filter(Parent.child==<somechild>)), evaluate
the actual primary key value of <somechild> at
execution time so that the autoflush step of the
Query can complete, thereby populating the PK value
of <somechild> in the case that <somechild> was
pending.
- cleanup of attributes.get_committed_value() to never return
the NO_VALUE value; evaluates to None
Mike Bayer [Thu, 21 Feb 2008 01:01:24 +0000 (01:01 +0000)]
- added a new "higher level" operator called "of_type()" -
used in join() as well as with any() and has(), qualifies
the subclass which will be used in filter criterion,
e.g.:
Mike Bayer [Sun, 17 Feb 2008 18:13:14 +0000 (18:13 +0000)]
- modernized cascade.py tests
- your cries have been heard: removing a pending item
from an attribute or collection with delete-orphan
expunges the item from the session; no FlushError is raised.
Note that if you session.save()'ed the pending item
explicitly, the attribute/collection removal still knocks
it out.
Mike Bayer [Sun, 17 Feb 2008 01:15:43 +0000 (01:15 +0000)]
- any(), has(), contains(), attribute level == and != now
work properly with self-referential relations - the clause
inside the EXISTS is aliased on the "remote" side to
distinguish it from the parent table.
Rick Morrison [Thu, 14 Feb 2008 18:03:57 +0000 (18:03 +0000)]
Added EXEC to MSSQL _is_select regexp; should now detect row-returning stored procedures
Added experimental implementation of limit/offset using row_number()
Mike Bayer [Tue, 12 Feb 2008 21:16:31 +0000 (21:16 +0000)]
- fixed bug introduced in r4070 where union() and other compound selects would not get
an OID column if it only contained one selectable element, due to missing return in _proxy_column()
- visit_column() calls itself to render a primary key col being used as the interpretation of the oid col instead of relying upon broken partial logic
Mike Bayer [Mon, 11 Feb 2008 19:22:34 +0000 (19:22 +0000)]
- added expire_all() method to Session. Calls expire()
for all persistent instances. This is handy in conjunction
with .....
- instances which have been partially or fully expired
will have their expired attributes populated during a regular
Query operation which affects those objects, preventing
a needless second SQL statement for each instance.
Mike Bayer [Mon, 11 Feb 2008 00:28:39 +0000 (00:28 +0000)]
- updated the naming scheme of the base test classes in test/testlib/testing.py;
tests extend from either TestBase or ORMTest, using additional mixins for
special assertion methods as needed
Mike Bayer [Sun, 10 Feb 2008 23:39:09 +0000 (23:39 +0000)]
- Table columns and constraints can be overridden on a
an existing table (such as a table that was already
reflected) using the 'useexisting=True' flag, which now
takes into account the arguments passed along with it.
- fixed one element of [ticket:910]
- refactored reflection test
Mike Bayer [Sat, 9 Feb 2008 01:48:19 +0000 (01:48 +0000)]
- lazy loader can now handle a join condition where the "bound"
column (i.e. the one that gets the parent id sent as a bind
parameter) appears more than once in the join condition.
Specifically this allows the common task of a relation()
which contains a parent-correlated subquery, such as "select
only the most recent child item". [ticket:946]
- col_is_part_of_mappings made more strict, seems to be OK
with tests
- memusage will dump out the size list in an assertion fail
Mike Bayer [Sat, 9 Feb 2008 01:24:01 +0000 (01:24 +0000)]
heisenbug in aisle 3
(when db.dispose is called in unitofwork test with sqlite, the first test that runs in memusage grows by two gc'ed objects on every iteration; then the problem vanishes. doesnt matter what test runs in memusage. doing a dispose() in memusage solves the problem also. screwing wiht the mechanics of engine.dispose() only fix it when both the pool.dispose() *and* the pool.ressurect() are disabled. its just a subtle python/pysqlite bug afaict)
Mike Bayer [Fri, 8 Feb 2008 22:57:45 +0000 (22:57 +0000)]
- added generative where(<criterion>) method to delete()
and update() constructs which return a new object with
criterion joined to existing criterion via AND, just
like select().where().
- compile assertions use assertEquals()
Jason Kirtland [Tue, 5 Feb 2008 23:31:14 +0000 (23:31 +0000)]
- Enabled schema support on SQLite, added the temporary table namespace to table name reflection
- TODO: add sqlite to the standard alternate schema tests. a little tricky, because unlike CREATE SCHEMA, an ATTACH DATABASE won't survive a pool dispose...
Jason Kirtland [Tue, 5 Feb 2008 17:26:35 +0000 (17:26 +0000)]
- Autodetect mysql's ANSI_QUOTES mode, sometimes. [ticket:845]
The dialect needs a hook run on first pool connect to detect this most of
the time, and a refactor with Dialect-per-Connection to get it right all of
the time. (It's a connection-session scoped setting with dialect-modifying
behavior)
Jason Kirtland [Tue, 5 Feb 2008 05:46:33 +0000 (05:46 +0000)]
- Added free-form `DDL` statements, can be executed standalone or tied to the DDL create/drop lifecycle of Tables and MetaData. [ticket:903]
- Added DDL event hooks, triggers callables before and after create / drop.
Mike Bayer [Mon, 4 Feb 2008 21:47:42 +0000 (21:47 +0000)]
- add dummy column to appease older SQLite verisons in unicode.py
- add test "escape_literal_column" comiler method to start addressing literal '%' character
Mike Bayer [Mon, 4 Feb 2008 20:35:25 +0000 (20:35 +0000)]
forcibly clean out _sessions, _mapper_registry at test start to eliminate leftovers from other unit tests (from other test scripts) still stored in memory
Mike Bayer [Fri, 1 Feb 2008 01:16:18 +0000 (01:16 +0000)]
- some consolidation of tests in select.py, moved
other tests to more specific modules
- added "now()" as a generic function; on SQLite and
Oracle compiles as "CURRENT_TIMESTAMP"; "now()"
on all others [ticket:943]
Mike Bayer [Thu, 31 Jan 2008 17:48:22 +0000 (17:48 +0000)]
- added "autocommit=True" kwarg to select() and text(),
as well as generative autocommit() method on select();
for statements which modify the database through some
user-defined means other than the usual INSERT/UPDATE/
DELETE etc., this flag will enable "autocommit" behavior
during execution if no transaction is in progress
[ticket:915]
Mike Bayer [Thu, 31 Jan 2008 03:57:20 +0000 (03:57 +0000)]
- the startswith(), endswith(), and contains() operators
now concatenate the wildcard operator with the given
operand in SQL, i.e. "'%' || <bindparam>" in all cases,
accept text('something') operands properly [ticket:962]
- cast() accepts text('something') and other non-literal
operands properly [ticket:962]
Mike Bayer [Wed, 30 Jan 2008 21:08:11 +0000 (21:08 +0000)]
- Oracle and others properly encode SQL used for defaults
like sequences, etc., even if no unicode idents are used
since identifier preparer may return a cached unicode
identifier.
Mike Bayer [Wed, 30 Jan 2008 17:35:20 +0000 (17:35 +0000)]
- next release will be 0.4.3
- fixed merge() collection-doubling bug when merging
transient entities with backref'ed collections.
[ticket:961]
- merge(dont_load=True) does not accept transient
entities, this is in continuation with the fact that
merge(dont_load=True) does not accept any "dirty"
objects either.
Mike Bayer [Mon, 28 Jan 2008 23:15:40 +0000 (23:15 +0000)]
- "Passive defaults" and other "inline" defaults can now
be loaded during a flush() call if needed; in particular,
this allows constructing relations() where a foreign key
column references a server-side-generated, non-primary-key
column. [ticket:954]
Mike Bayer [Sun, 27 Jan 2008 02:21:23 +0000 (02:21 +0000)]
- Fixed bug in polymorphic inheritance where incorrect
exception is raised when base polymorphic_on
column does not correspond to any columns within
the local selectable of an inheriting mapper more
than one level deep
Mike Bayer [Wed, 23 Jan 2008 19:20:49 +0000 (19:20 +0000)]
- query.join() can also accept tuples of attribute
name/some selectable as arguments. This allows
construction of joins *from* subclasses of a
polymorphic relation, i.e.: