def _sel_relation_steps(self, plan, rqlst, relation): """handle the selection of relations for a delete query""" select = Select() lhs, rhs = relation.get_variable_parts() select.append_selected(lhs.copy(select)) select.append_selected(rhs.copy(select)) select.set_where(relation.copy(select)) if rqlst.where is not None: select.add_restriction(rqlst.where.copy(select)) if getattr(rqlst, 'having', None): select.set_having([x.copy(select) for x in rqlst.having]) return self._select_plan(plan, select, rqlst.solutions)
def _sel_variable_step(self, plan, rqlst, etype, varref): """handle the selection of variables for a delete query""" select = Select() varref = varref.copy(select) select.defined_vars = {varref.name: varref.variable} select.append_selected(varref) if rqlst.where is not None: select.set_where(rqlst.where.copy(select)) if getattr(rqlst, 'having', None): select.set_having([x.copy(select) for x in rqlst.having]) if etype != 'Any': select.add_type_restriction(varref.variable, etype) return self._select_plan(plan, select, rqlst.solutions)