instance if that instance is "pending". [ticket:1789]
- sql
+ - expr.in_() now accepts a text() construct as the argument.
+ Grouping parenthesis are added automatically, i.e. usage
+ is like `col.in_(text("select id from table"))`.
+ [ticket:1793]
+
- Fixed bug that prevented implicit RETURNING from functioning
properly with composite primary key that contained zeroes.
[ticket:1778]
# column selectable that does not export itself as a FROM clause
return self.__compare( op, seq_or_selectable.as_scalar(), negate=negate_op)
- elif isinstance(seq_or_selectable, Selectable):
+ elif isinstance(seq_or_selectable, (Selectable, _TextClause)):
return self.__compare( op, seq_or_selectable, negate=negate_op)
-
+
+
# Handle non selectable arguments as sequences
args = []
for o in seq_or_selectable:
else:
return None
+ def self_group(self, against=None):
+ if against is operators.in_op:
+ return _Grouping(self)
+ else:
+ return self
+
def _copy_internals(self, clone=_clone):
self.bindparams = dict((b.key, clone(b))
for b in self.bindparams.values())
self.assert_compile(~table1.c.myid.in_(select([table2.c.otherid])),
"mytable.myid NOT IN (SELECT myothertable.otherid FROM myothertable)")
+ # text
+ self.assert_compile(
+ table1.c.myid.in_(
+ text("SELECT myothertable.otherid FROM myothertable")
+ ),
+ "mytable.myid IN (SELECT myothertable.otherid "
+ "FROM myothertable)"
+ )
+
# test empty in clause
self.assert_compile(table1.c.myid.in_([]),
"mytable.myid != mytable.myid")