equal
deleted
inserted
replaced
209 self.cnx.transaction_data[key] = (union, self.args) |
209 self.cnx.transaction_data[key] = (union, self.args) |
210 else: |
210 else: |
211 noinvariant = () |
211 noinvariant = () |
212 if cached is None: |
212 if cached is None: |
213 self.cnx.vreg.rqlhelper.simplify(union) |
213 self.cnx.vreg.rqlhelper.simplify(union) |
214 self.querier.rqlannotator.annotate(union) |
214 RQLAnnotator(self.querier.schema).annotate(union) |
215 set_qdata(self.querier.schema.rschema, union, noinvariant) |
215 set_qdata(self.querier.schema.rschema, union, noinvariant) |
216 if union.has_text_query: |
216 if union.has_text_query: |
217 self.cache_key = None |
217 self.cache_key = None |
218 |
218 |
219 def _insert_security(self, union): |
219 def _insert_security(self, union): |
473 def set_schema(self, schema): |
473 def set_schema(self, schema): |
474 self.schema = schema |
474 self.schema = schema |
475 self.clear_caches() |
475 self.clear_caches() |
476 # rql planner |
476 # rql planner |
477 self._planner = SSPlanner(schema, self._repo.vreg.rqlhelper) |
477 self._planner = SSPlanner(schema, self._repo.vreg.rqlhelper) |
478 # sql generation annotator |
|
479 self.rqlannotator = RQLAnnotator(schema) |
|
480 |
478 |
481 def clear_caches(self, eids=None, etypes=None): |
479 def clear_caches(self, eids=None, etypes=None): |
482 if eids is None: |
480 if eids is None: |
483 self.rql_cache = RQLCache(self._repo, self.schema) |
481 self.rql_cache = RQLCache(self._repo, self.schema) |
484 else: |
482 else: |
560 "callstack": "".join(traceback.format_stack()[:-1]), |
558 "callstack": "".join(traceback.format_stack()[:-1]), |
561 "description": "", |
559 "description": "", |
562 } |
560 } |
563 |
561 |
564 start = time.time() |
562 start = time.time() |
565 |
|
566 # execute the plan |
563 # execute the plan |
567 try: |
564 try: |
568 results = plan.execute() |
565 results = plan.execute() |
569 except (Unauthorized, ValidationError): |
566 except (Unauthorized, ValidationError): |
570 # getting an Unauthorized/ValidationError exception means the |
567 # getting an Unauthorized/ValidationError exception means the |