11 |
11 |
12 import sys |
12 import sys |
13 import threading |
13 import threading |
14 from time import time |
14 from time import time |
15 from uuid import uuid4 |
15 from uuid import uuid4 |
|
16 from warnings import warn |
16 |
17 |
17 from logilab.common.deprecation import deprecated |
18 from logilab.common.deprecation import deprecated |
18 from rql.nodes import VariableRef, Function, ETYPE_PYOBJ_MAP, etype_from_pyobj |
19 from rql.nodes import VariableRef, Function, ETYPE_PYOBJ_MAP, etype_from_pyobj |
19 from yams import BASE_TYPES |
20 from yams import BASE_TYPES |
20 |
21 |
640 def source_from_eid(self, eid): |
641 def source_from_eid(self, eid): |
641 """return the source where the entity with id <eid> is located""" |
642 """return the source where the entity with id <eid> is located""" |
642 return self.repo.source_from_eid(eid, self) |
643 return self.repo.source_from_eid(eid, self) |
643 |
644 |
644 def execute(self, rql, kwargs=None, eid_key=None, build_descr=True): |
645 def execute(self, rql, kwargs=None, eid_key=None, build_descr=True): |
645 """db-api like method directly linked to the querier execute method""" |
646 """db-api like method directly linked to the querier execute method. |
646 rset = self._execute(self, rql, kwargs, eid_key, build_descr) |
647 |
|
648 See :meth:`cubicweb.dbapi.Cursor.execute` documentation. |
|
649 """ |
|
650 if eid_key is not None: |
|
651 warn('[3.8] eid_key is deprecated, you can safely remove this argument', |
|
652 DeprecationWarning, stacklevel=2) |
|
653 rset = self._execute(self, rql, kwargs, build_descr) |
647 rset.req = self |
654 rset.req = self |
648 return rset |
655 return rset |
649 |
656 |
650 def _clear_thread_data(self): |
657 def _clear_thread_data(self): |
651 """remove everything from the thread local storage, except pool |
658 """remove everything from the thread local storage, except pool |