Mike Bayer [Wed, 18 Jan 2012 17:42:54 +0000 (12:42 -0500)]
- [feature] Added "false()" and "true()" expression
constructs to sqlalchemy.sql namespace, though
not part of __all__ as of yet.
- [bug] sql.false() and sql.true() compile to
0 and 1, respectively in sqlite [ticket:2368]
Mike Bayer [Tue, 10 Jan 2012 16:43:47 +0000 (11:43 -0500)]
- Fixed regression from 0.6 whereby if
"load_on_pending" relationship() flag were used
where a non-"get()" lazy clause needed to be
emitted on a pending object, it would fail
to load.
Mike Bayer [Tue, 10 Jan 2012 16:15:11 +0000 (11:15 -0500)]
- [bug] Added __reduce__ to StatementError,
DBAPIError so that exceptions are pickleable,
as when using multiprocessing. However, not
all DBAPIs support this yet, such as
psycopg2. [ticket:2371]
Mike Bayer [Sat, 7 Jan 2012 20:37:51 +0000 (15:37 -0500)]
- [bug] the "name" of an FK constraint in SQLite
is reflected as "None", not "0" [ticket:2364].
SQLite does not appear to support constraint
naming in any case (the names are ignored).
Mike Bayer [Sat, 7 Jan 2012 17:57:22 +0000 (12:57 -0500)]
- [bug] Fixed bug whereby event.listen(SomeClass)
forced an entirely unnecessary compile of the
mapper, making events very hard to set up
at module import time (nobody noticed this ??)
[ticket:2367]
Mike Bayer [Tue, 3 Jan 2012 22:07:44 +0000 (17:07 -0500)]
- rework "sql expressions as mapped attributes" to also stress hybrids as the first
method to try. now there's two sections here that introduce hybrids, which
is less than ideal.
Mike Bayer [Fri, 30 Dec 2011 20:29:44 +0000 (15:29 -0500)]
add a "jinja2 fallback" renderer for render_string(), which is used for the js/css templates
we don't really care about. not sure if this is going to break again with a newer sphinx
or what, but fixes [ticket:2359] for now.
Mike Bayer [Thu, 15 Dec 2011 15:31:55 +0000 (10:31 -0500)]
- [bug] Fixed inappropriate usage of util.py3k
flag and renamed it to util.py3k_warning, since
this flag is intended to detect the -3 flag
series of import restrictions only.
[ticket:2348]
Mike Bayer [Fri, 9 Dec 2011 16:12:41 +0000 (11:12 -0500)]
- Standalone expressions in polymorphic_on
propagate to single-table inheritance
subclasses so that they are used in the
WHERE /JOIN clause to limit rows to that
subclass as is the usual behavior.
- make sure implicit map to polymorphic_on expr
handles creating a label(). Use an explicit name
here as _sa_polymorphic_on makes more sense when
poking around in _props.
Mike Bayer [Fri, 9 Dec 2011 05:56:12 +0000 (00:56 -0500)]
- [feature] polymorphic_on now accepts many
new kinds of values:
- standalone expressions that aren't
otherwise mapped
- column_property() objects
- string names of any column_property()
or attribute name of a mapped Column
The docs include an example using
the case() construct, which is likely to be
a common constructed used here.
[ticket:2345] and part of [ticket:2238]
Mike Bayer [Wed, 7 Dec 2011 18:24:11 +0000 (13:24 -0500)]
- [bug] Fixed bug in get_history() when referring
to a composite attribute that has no value;
added coverage for get_history() regarding
composites which is otherwise just a userland
function.
Mike Bayer [Wed, 7 Dec 2011 01:59:04 +0000 (20:59 -0500)]
- doc updates per [ticket:2251]
- [feature] Added new value for Column autoincrement
called "ignore_fk", can be used to force autoincrement
on a column that's still part of a ForeignKeyConstraint.
New example in the relationship docs illustrates
its use.
Mike Bayer [Tue, 6 Dec 2011 21:31:52 +0000 (16:31 -0500)]
- [bug] Decode incoming values when retrieving
list of index names and the names of columns
within those indexes. [ticket:2269]
- rewrite unicode reflection test to be of more general use on
broken backends
Mike Bayer [Tue, 6 Dec 2011 20:35:06 +0000 (15:35 -0500)]
- [bug] don't cast "table name" as NVARCHAR
on SQL Server 2000. Still mostly in the dark
what incantations are needed to make PyODBC
work fully with FreeTDS 0.91 here, however.
[ticket:2343]
Mike Bayer [Mon, 5 Dec 2011 22:06:15 +0000 (17:06 -0500)]
- [feature] Added an example to the hybrid docs
of a "transformer" - a hybrid that returns a
query-transforming callable in combination
with a custom comparator. Uses a new method
on Query called with_transformation(). The use
case here is fairly experimental, but only
adds one line of code to Query.
Mike Bayer [Sun, 4 Dec 2011 21:23:55 +0000 (16:23 -0500)]
- [bug] Updated warning message when setting
delete-orphan without delete to no longer
refer to 0.6, as we never got around to
upgrading this to an exception. Ideally
this might be better as an exception but
it's not critical either way. [ticket:2325]
- add new test suite to test_cascades for cascade
arguments
Mike Bayer [Sun, 4 Dec 2011 20:47:13 +0000 (15:47 -0500)]
-re-document the is_modified method, and place significant caveats
about the "passive" flag which is now known to be wrong. Add
new is_modified tests illustrating the passive flag.
[ticket:2320]
Mike Bayer [Sun, 4 Dec 2011 19:25:00 +0000 (14:25 -0500)]
- [bug] Fixed bug whereby transaction.rollback()
would throw an error on an invalidated
connection if the transaction were a
two-phase or savepoint transaction.
For plain transactions, rollback() is a no-op
if the connection is invalidated, so while
it wasn't 100% clear if it should be a no-op,
at least now the interface is consistent.
[ticket:2317]
Mike Bayer [Sun, 4 Dec 2011 19:16:42 +0000 (14:16 -0500)]
- [feature] The "extend_existing" flag on Table
now allows for the reflection process to take
effect for a Table object that's already been
defined; when autoload=True and extend_existing=True
are both set, the full set of columns will be
reflected from the Table which will then
*overwrite* those columns already present,
rather than no activity occurring. Columns that
are present directly in the autoload run
will be used as always, however.
[ticket:1410]
Mike Bayer [Sun, 4 Dec 2011 18:46:45 +0000 (13:46 -0500)]
- [bug] the "name" of a column-level CHECK constraint,
if present, is now rendered in the CREATE TABLE
statement using "CONSTRAINT <name> CHECK <expression>".
[ticket:2305]
Mike Bayer [Sun, 4 Dec 2011 18:29:29 +0000 (13:29 -0500)]
- [bug] pyodbc-based dialects now parse the
pyodbc accurately as far as observed
pyodbc strings, including such gems
as "py3-3.0.1-beta4" [ticket:2318]
- [bug] use new pyodbc version detection for
_need_decimal_fix option, [ticket:2318]
Mike Bayer [Sun, 4 Dec 2011 01:57:27 +0000 (20:57 -0500)]
- [bug] Calls to query.join() to a single-table
inheritance subclass are now tracked, and
are used to eliminate the additional WHERE..
IN criterion normally tacked on with single
table inheritance, since the join should
accommodate it. This allows OUTER JOIN
to a single table subclass to produce
the correct results, and overall will produce
fewer WHERE criterion when dealing with
single table inheritance joins.
[ticket:2328]
Mike Bayer [Sun, 4 Dec 2011 01:04:55 +0000 (20:04 -0500)]
- [bug] repaired the with_hint() feature which
wasn't implemented correctly on MSSQL -
usually used for the "WITH (NOLOCK)" hint
(which you shouldn't be using anyway !
use snapshot isolation instead :) )
[ticket:2336]
Mike Bayer [Sun, 4 Dec 2011 00:50:01 +0000 (19:50 -0500)]
- [bug] Fixed bug whereby column_property() created
against ORM-level column could be treated as
a distinct entity when producing certain
kinds of joined-inh joins. [ticket:2316]
- [bug] related to [ticket:2316], made some
adjustments to the change from [ticket:2261]
regarding the "from" list on a select(). The
_froms collection is no longer memoized, as this
simplifies various use cases and removes the
need for a "warning" if a column is attached
to a table after it was already used in an
expression - the select() construct will now
always produce the correct expression.
There's probably no real-world
performance hit here; select() objects are
almost always made ad-hoc, and systems that
wish to optimize the re-use of a select()
would be using the "compiled_cache" feature.
A hit which would occur when calling select.bind
has been reduced, but the vast majority
of users shouldn't be using "bound metadata"
anyway :).
Mike Bayer [Thu, 1 Dec 2011 19:21:43 +0000 (14:21 -0500)]
- [bug] Fixed bug whereby "order_by='foreign_key'"
option to Inspector.get_table_names
wasn't implementing the sort properly, replaced
with the existing sort algorithm
- clean up metadata usage in reflection tests
Mike Bayer [Tue, 29 Nov 2011 03:28:28 +0000 (22:28 -0500)]
- [feature] Added create_type constructor argument
to pg.ENUM. When False, no CREATE/DROP or
checking for the type will be performed as part
of a table create/drop event; only the
create()/drop)() methods called directly
will do this. Helps with Alembic "offline"
scripts.
Mike Bayer [Mon, 28 Nov 2011 17:44:56 +0000 (12:44 -0500)]
- [bug] Fixed bug whereby TypeDecorator would
return a stale value for _type_affinity, when
using a TypeDecorator that "switches" types,
like the CHAR/UUID type.
Mike Bayer [Thu, 24 Nov 2011 15:47:10 +0000 (10:47 -0500)]
- doc updates in loading
- de-emphasize contains_alias() which is pretty much a non-use case
- add docs for immediateload which have been missing all this time
- fix links, formatting
Mike Bayer [Sun, 20 Nov 2011 04:28:01 +0000 (23:28 -0500)]
- [bug] further tweak to the fix from [ticket:2261],
so that generative methods work a bit better
off of cloned (this is almost a non-use case though).
In particular this allows with_only_columns()
to behave more consistently. Added additional
documentation to with_only_columns() to clarify
expected behavior, which changed as a result
of [ticket:2261]. [ticket:2319]
- document the crap out of with_only_columns, include caveats about
the change, etc.