equal
deleted
inserted
replaced
22 |
22 |
23 __docformat__ = "restructuredtext en" |
23 __docformat__ = "restructuredtext en" |
24 |
24 |
25 from itertools import repeat |
25 from itertools import repeat |
26 |
26 |
27 from six import string_types, integer_types |
27 from six import text_type, string_types, integer_types |
28 from six.moves import range |
28 from six.moves import range |
29 |
29 |
30 from rql import RQLSyntaxError, CoercionError |
30 from rql import RQLSyntaxError, CoercionError |
31 from rql.stmts import Union |
31 from rql.stmts import Union |
32 from rql.nodes import ETYPE_PYOBJ_MAP, etype_from_pyobj, Relation, Exists, Not |
32 from rql.nodes import ETYPE_PYOBJ_MAP, etype_from_pyobj, Relation, Exists, Not |
510 self.sqlgen_annotate = SQLGenAnnotator(schema).annotate |
510 self.sqlgen_annotate = SQLGenAnnotator(schema).annotate |
511 |
511 |
512 def parse(self, rql, annotate=False): |
512 def parse(self, rql, annotate=False): |
513 """return a rql syntax tree for the given rql""" |
513 """return a rql syntax tree for the given rql""" |
514 try: |
514 try: |
515 return self._parse(unicode(rql), annotate=annotate) |
515 return self._parse(text_type(rql), annotate=annotate) |
516 except UnicodeError: |
516 except UnicodeError: |
517 raise RQLSyntaxError(rql) |
517 raise RQLSyntaxError(rql) |
518 |
518 |
519 def plan_factory(self, rqlst, args, cnx): |
519 def plan_factory(self, rqlst, args, cnx): |
520 """create an execution plan for an INSERT RQL query""" |
520 """create an execution plan for an INSERT RQL query""" |