Mike Bayer [Sun, 9 Sep 2012 18:39:25 +0000 (14:39 -0400)]
- [feature] Added a hook to the system of rendering
CREATE TABLE that provides access to the render for each
Column individually, by constructing a @compiles
function against the new schema.CreateColumn
construct. [ticket:2463]
Mike Bayer [Sun, 9 Sep 2012 06:02:01 +0000 (02:02 -0400)]
almost obliterate the concept of "implicit execution" from the docs, move it only
to the "engines and connections" chapter nobody reads, put big green "note:"
boxes with the word "discouraged" in them for "bound metadata", "implicit execution",
"threadlocal strategy"
Mike Bayer [Wed, 5 Sep 2012 22:11:33 +0000 (18:11 -0400)]
- [feature] The types of columns excluded from the
setinputsizes() set can be customized by sending
a list of string DBAPI type names to exclude.
This list was previously fixed. The list also
now defaults to STRING, UNICODE, removing
CLOB, NCLOB from the list. [ticket:2469]
Mike Bayer [Mon, 3 Sep 2012 14:28:26 +0000 (10:28 -0400)]
- type expressions invoke in SQL, but are only for the benefit of columns
delivered to a result set. therefore these expressions should only be rendered
for those columns that are being delivered to the result, thereby preventing
the expression from stacking onto itself within nesting scenarios.
Mike Bayer [Sun, 2 Sep 2012 19:14:09 +0000 (15:14 -0400)]
- fixes for mxODBC, some pyodbc
- enhancements to test suite including ability to set up a testing engine
for a whole test class, fixes to how noseplugin sets up/tears
down per-class context
Mike Bayer [Sat, 1 Sep 2012 00:04:04 +0000 (20:04 -0400)]
- [bug] Fixed a regression since 0.6 regarding
result-row targeting. It should be possible
to use a select() statement with string
based columns in it, that is
select(['id', 'name']).select_from('mytable'),
and have this statement be targetable by
Column objects with those names; this is the
mechanism by which
query(MyClass).from_statement(some_statement)
works. At some point the specific case of
using select(['id']), which is equivalent to
select([literal_column('id')]), stopped working
here, so this has been re-instated and of
course tested. [ticket:2558]
Mike Bayer [Mon, 27 Aug 2012 23:40:12 +0000 (19:40 -0400)]
- [feature] Reworked the startswith(), endswith(),
contains() operators to do a better job with
negation (NOT LIKE), and also to assemble them
at compilation time so that their rendered SQL
can be altered, such as in the case for Firebird
STARTING WITH [ticket:2470]
- [feature] firebird - The "startswith()" operator renders
as "STARTING WITH", "~startswith()" renders
as "NOT STARTING WITH", using FB's more efficient
operator. [ticket:2470]
Mike Bayer [Mon, 27 Aug 2012 20:44:34 +0000 (16:44 -0400)]
- [feature] declared_attr can now be used with
attributes that are not Column or MapperProperty;
including any user-defined value as well
as association proxy objects. [ticket:2517]
Mike Bayer [Mon, 27 Aug 2012 20:04:16 +0000 (16:04 -0400)]
- [feature] Conflicts between columns on
single-inheritance declarative subclasses,
with or without using a mixin, can be resolved
using a new @declared_attr usage described
in the documentation. [ticket:2472]
Mike Bayer [Mon, 27 Aug 2012 19:11:53 +0000 (15:11 -0400)]
- [feature] The "required" flag is set to
True by default, if not passed explicitly,
on bindparam() if the "value" or "callable"
parameters are not passed.
This will cause statement execution to check
for the parameter being present in the final
collection of bound parameters, rather than
implicitly assigning None. [ticket:2556]
Mike Bayer [Sun, 26 Aug 2012 15:30:42 +0000 (11:30 -0400)]
- tweak the GenericFunction constructor more so that it's action in parsing the
arguments is easier to understand
- add a test to ensure generic function can have a custom name
Mike Bayer [Fri, 24 Aug 2012 22:48:42 +0000 (18:48 -0400)]
- [feature] Added support for .info dictionary argument to
column_property(), relationship(), composite().
All MapperProperty classes have an auto-creating .info
dict available overall.
Mike Bayer [Thu, 23 Aug 2012 19:40:09 +0000 (15:40 -0400)]
- [feature] The before_cursor_execute event
fires off for so-called "_cursor_execute"
events, which are usually special-case
executions of primary-key bound sequences
and default-generation SQL
phrases that invoke separately when RETURNING
is not used with INSERT. [ticket:2459]
Mike Bayer [Wed, 22 Aug 2012 22:55:59 +0000 (18:55 -0400)]
- [bug] Fixed bug whereby usage of a UNION
or similar inside of an embedded subquery
would interfere with result-column targeting,
in the case that a result-column had the same
ultimate name as a name inside the embedded
UNION. [ticket:2552]
Mike Bayer [Wed, 22 Aug 2012 22:41:46 +0000 (18:41 -0400)]
- [bug] Fixed cextension bug whereby the
"ambiguous column error" would fail to
function properly if the given index were
a Column object and not a string.
Note there are still some column-targeting
issues here which are fixed in 0.8.
[ticket:2553]
- find more cases where column targeting is being inaccurate, add
more information to result_map to better differentiate "ambiguous"
results from "present" or "not present". In particular, result_map
is sensitive to dupes, even though no error is raised; the conflicting
columns are added to the "obj" member of the tuple so that the two
are both directly accessible in the result proxy
- handwringing over the damn "name fallback" thing in results. can't
really make it perfect yet
- fix up oracle returning clause. not sure why its guarding against
labels, remove that for now and see what the bot says.
Mike Bayer [Wed, 22 Aug 2012 17:54:13 +0000 (13:54 -0400)]
- [feature] Enhanced GenericFunction and func.*
to allow for user-defined GenericFunction
subclasses to be available via the func.*
namespace automatically by classname,
optionally using a package name as well.
Mike Bayer [Mon, 20 Aug 2012 22:18:17 +0000 (18:18 -0400)]
- [feature] The Query.update() method is now
more lenient as to the table
being updated. Plain Table objects are better
supported now, and additional a joined-inheritance
subclass may be used with update(); the subclass
table will be the target of the update,
and if the parent table is referenced in the
WHERE clause, the compiler will call upon
UPDATE..FROM syntax as allowed by the dialect
to satisfy the WHERE clause. Target columns
must still be in the target table i.e.
does not support MySQL's multi-table update
feature (even though this is in Core).
PG's DELETE..USING is also not available
in Core yet.
Mike Bayer [Mon, 20 Aug 2012 21:04:25 +0000 (17:04 -0400)]
- [feature] The Core oeprator system now includes
the `getitem` operator, i.e. the bracket
operator in Python. This is used at first
to provide index and slice behavior to the
Postgresql ARRAY type, and also provides a hook
for end-user definition of custom __getitem__
schemes which can be applied at the type
level as well as within ORM-level custom
operator schemes.
Note that this change has the effect that
descriptor-based __getitem__ schemes used by
the ORM in conjunction with synonym() or other
"descriptor-wrapped" schemes will need
to start using a custom comparator in order
to maintain this behavior.
- [feature] postgresql.ARRAY now supports
indexing and slicing. The Python [] operator
is available on all SQL expressions that are
of type ARRAY; integer or simple slices can be
passed. The slices can also be used on the
assignment side in the SET clause of an UPDATE
statement by passing them into Update.values();
see the docs for examples.
- [feature] Added new "array literal" construct
postgresql.array(). Basically a "tuple" that
renders as ARRAY[1,2,3].
Mike Bayer [Mon, 20 Aug 2012 17:20:09 +0000 (13:20 -0400)]
- [bug] Fixes to the interpretation of the
Column "default" parameter as a callable
to not pass ExecutionContext into a keyword
argument parameter. [ticket:2520]
Mike Bayer [Mon, 20 Aug 2012 01:15:40 +0000 (21:15 -0400)]
- [feature] The prefix_with() method is now available
on each of select(), insert(), update(), delete(),
all with the same API, accepting multiple
prefix calls, as well as a "dialect name" so that
the prefix can be limited to one kind of dialect.
[ticket:2431]
Mike Bayer [Sun, 19 Aug 2012 16:35:39 +0000 (12:35 -0400)]
- [bug] Lazy loads emitted within flush events
such as before_flush(), before_update(),
etc. will now function as they would
within non-event code, regarding consideration
of the PK/FK values used in the lazy-emitted
query. Previously,
special flags would be established that
would cause lazy loads to load related items
based on the "previous" value of the
parent PK/FK values specifically when called
upon within a flush; the signal to load
in this way is now localized to where the
unit of work actually needs to load that
way. Note that the UOW does
sometimes load these collections before
the before_update() event is called,
so the usage of "passive_updates" or not
can affect whether or not a collection will
represent the "old" or "new" data, when
accessed within a flush event, based
on when the lazy load was emitted.
The change is backwards incompatible in
the exceedingly small chance that
user event code depended on the old
behavior. [ticket:2350]
Mike Bayer [Sat, 18 Aug 2012 04:54:00 +0000 (00:54 -0400)]
- fix the labeled column with column_expression() issue, finishes [ticket:1534]
- epic documentation sweep for new operator system, making ORM links consistent
and complete, full documentation and examples for type/SQL expression feature
- type_coerce() explicitly accepts BindParamClause objects
- change UserDefinedType to coerce the other side to itself by default as this
is much more likely what's desired
- make coerce_compared_type() fully public on all types
- have profiling run the test no matter what so that the test_zoomarks don't fail
when callcounts are missing
Mike Bayer [Fri, 17 Aug 2012 22:35:25 +0000 (18:35 -0400)]
- [feature] To complement [ticket:2547], types
can now provide "bind expressions" and
"column expressions" which allow compile-time
injection of SQL expressions into statements
on a per-column or per-bind level. This is
to suit the use case of a type which needs
to augment bind- and result- behavior at the
SQL level, as opposed to in the Python level.
Allows for schemes like transparent encryption/
decryption, usage of Postgis functions, etc.
[ticket:1534]
- update postgis example fully.
- still need to repair the result map propagation
here to be transparent for cases like "labeled column".
Mike Bayer [Fri, 17 Aug 2012 02:20:53 +0000 (22:20 -0400)]
- modernize most of the postgis example. would like to do [ticket:1534] also.
- we don't have coverage for type-wide instrumentation events, the listener was broke.
could break again too.
Mike Bayer [Thu, 16 Aug 2012 20:11:42 +0000 (16:11 -0400)]
_adapt_expression() moves fully to _DefaultColumnComparator which resumes
its original role as stateful, forms the basis of TypeEngine.Comparator. lots
of code goes back mostly as it was just with cleaner typing behavior, such
as simple flow in _binary_operate now.
Mike Bayer [Thu, 16 Aug 2012 18:07:33 +0000 (14:07 -0400)]
-we move all the invocation of "_adapt_expression" into TypeEngine.Comparator. at this point
the split of operator stuff is getting awkward and we might want to move _DefaultComparator.
Mike Bayer [Thu, 16 Aug 2012 17:25:46 +0000 (13:25 -0400)]
- we're going to attempt to get the type/operator system to eat its own dogfood and
use the type-based comparator in all cases. will attempt to remove the _adapt_expression()
method entirely as this represents an incomplete and redundant system (though it might
be a lot faster)
Mike Bayer [Wed, 15 Aug 2012 22:42:59 +0000 (18:42 -0400)]
- [bug] Declarative can now propagate a column
declared on a single-table inheritance subclass
up to the parent class' table, when the parent
class is itself mapped to a join() or select()
statement, directly or via joined inheritane,
and not just a Table. [ticket:2549]
Mike Bayer [Tue, 14 Aug 2012 21:24:57 +0000 (17:24 -0400)]
- update all the visit_mod() functions with new naming scheme
- visit_mods all seemed to not propagate **kw down to process().
this is [ticket:2548] which may be backported to 0.7 pending
a test case to illustrate wrong behavior.
Mike Bayer [Tue, 14 Aug 2012 17:55:54 +0000 (13:55 -0400)]
- for the moment, the default comparisons don't need the ColumnOperator interface.
Still a little concerned about the "self.expr" vs. "expr passed in" thing.
Mike Bayer [Tue, 14 Aug 2012 17:47:58 +0000 (13:47 -0400)]
- fix concat() operator, tests
- [feature] Custom unary operators can now be
used by combining operators.custom_op() with
UnaryExpression().
- clean up the operator dispatch system and make it more consistent.
This does change the compiler contract for custom ops.