def to_sql(self, schema, not_null=False, boolean=False): not_expr = NotOp(BooleanOp(self.term)).partial_eval() if is_op(not_expr, Variable): return wrap([{ "name": ".", "sql": { "b": "NOT " + sql_iso(not_expr.term.to_sql(schema)[0].sql.b) } }]) else: return not_expr.to_sql(schema)
def to_sql(self, schema, not_null=False, boolean=False): not_expr = NotOp("not", BooleanOp("boolean", self.term)).partial_eval() if isinstance(not_expr, NotOp): return wrap([{ "name": ".", "sql": { "b": "NOT " + sql_iso(not_expr.term.to_sql(schema)[0].sql.b) } }]) else: return not_expr.to_sql(schema)