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]
DELETE etc., this flag will enable "autocommit" behavior
during execution if no transaction is in progress
[ticket:915]
-
+
- The '.c.' attribute on a selectable now gets an entry
for every column expression in its columns clause.
Previously, "unnamed" columns like functions and CASE
up their ".c." collection based on the names present in
the first selectable only; corresponding_column() now
works fully for all embedded selectables.
-
+
- 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.
-
+
+ - Column and clause comparisons to datetime objects on the
+ left hand side of the expression now work (d < table.c.col).
+ (datetimes on the RHS have always worked, the LHS exception
+ is a quirk of the datetime implementation.)
+
- orm
- Every Session.begin() must now be accompanied by a
corresponding commit() or rollback() unless the session
class ColumnOperators(Operators):
"""Defines comparison and math operations."""
+ timetuple = None
+ """Hack, allows datetime objects to be compared on the LHS."""
+
def __lt__(self, other):
return self.operate(operators.lt, other)
import testenv; testenv.configure_for_tests()
-import re, operator
+import datetime, re, operator
from sqlalchemy import *
from sqlalchemy import exceptions, sql, util
from sqlalchemy.sql import table, column
):
self.assert_compile(py_op(lhs, rhs), res % sql_op)
+ dt = datetime.datetime.today()
# exercise comparison operators
for (py_op, fwd_op, rev_op) in ((operator.lt, '<', '>'),
(operator.gt, '>', '<'),
(literal('a'), 'b', ':param_1', ':param_2'),
(literal('a'), table1.c.myid, ':param_1', 'mytable.myid'),
(literal('a'), literal('b'), ':param_1', ':param_2'),
+ (dt, literal('b'), ':param_2', ':param_1'),
+ (literal('b'), dt, ':param_1', ':param_2'),
):
# the compiled clause should match either (e.g.):