and can be used to determine correct shard id (since execute() doesn't
take an instance)
+- adjusted operator precedence of NOT to match '==' and others, so that
+ ~(x <operator> y) produces NOT (x <op> y), which is better compatible with MySQL.
+ [ticket:764]. this doesn't apply to "~(x==y)" as it does in 0.3 since ~(x==y)
+ compiles to "x != y", but still applies to operators like BETWEEN.
+
- other tickets: [ticket:768]
0.4.0beta5
- postgres reflects tables with autoincrement=False for primary key
columns which have no defaults.
-
+
- postgres no longer wraps executemany() with
individual execute() calls, instead favoring performance.
"rowcount"/"concurrency" checks with deleted items (which use executemany)
)
def testoperators(self):
-
# exercise arithmetic operators
for (py_op, sql_op) in ((operator.add, '+'), (operator.mul, '*'),
(operator.sub, '-'), (operator.div, '/'),
"SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.myid != :mytable_myid AND mytable.name != :mytable_name"
)
+ self.assert_compile(
+ table1.select((table1.c.myid != 12) & ~(table1.c.name.between('jack','john'))),
+ "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.myid != :mytable_myid AND NOT (mytable.name BETWEEN :mytable_name AND :mytable_name_1)"
+ )
+
self.assert_compile(
table1.select((table1.c.myid != 12) & ~and_(table1.c.name=='john', table1.c.name=='ed', table1.c.name=='fred')),
"SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.myid != :mytable_myid AND NOT (mytable.name = :mytable_name AND mytable.name = :mytable_name_1 AND mytable.name = :mytable_name_2)"
"SELECT op.field FROM op WHERE :op_field + op.field IN (:literal, :literal_1)")
self.assert_compile(table.select(not_(and_(table.c.field == 5, table.c.field == 7))),
"SELECT op.field FROM op WHERE NOT (op.field = :op_field AND op.field = :op_field_1)")
+ self.assert_compile(table.select(not_(table.c.field == 5)),
+ "SELECT op.field FROM op WHERE op.field != :op_field")
+ self.assert_compile(table.select(not_(table.c.field.between(5, 6))),
+ "SELECT op.field FROM op WHERE NOT (op.field BETWEEN :op_field AND :op_field_1)")
self.assert_compile(table.select(not_(table.c.field) == 5),
"SELECT op.field FROM op WHERE (NOT op.field) = :literal")
self.assert_compile(table.select((table.c.field == table.c.field).between(False, True)),