dbapi.py
changeset 10005 7769d0f61810
parent 9830 465d8151b92d
child 10235 684215aca046
equal deleted inserted replaced
10004:acad42456767 10005:7769d0f61810
   445 
   445 
   446 
   446 
   447 class LogCursor(Cursor):
   447 class LogCursor(Cursor):
   448     """override the standard cursor to log executed queries"""
   448     """override the standard cursor to log executed queries"""
   449 
   449 
   450     def execute(self, operation, parameters=None, eid_key=None, build_descr=True):
   450     def execute(self, operation, parameters=None, build_descr=True):
   451         """override the standard cursor to log executed queries"""
   451         """override the standard cursor to log executed queries"""
   452         if eid_key is not None:
       
   453             warn('[3.8] eid_key is deprecated, you can safely remove this argument',
       
   454                  DeprecationWarning, stacklevel=2)
       
   455         tstart, cstart = time(), clock()
   452         tstart, cstart = time(), clock()
   456         rset = Cursor.execute(self, operation, parameters, build_descr=build_descr)
   453         rset = Cursor.execute(self, operation, parameters, build_descr=build_descr)
   457         self.connection.executed_queries.append((operation, parameters,
   454         self.connection.executed_queries.append((operation, parameters,
   458                                                  time() - tstart, clock() - cstart))
   455                                                  time() - tstart, clock() - cstart))
   459         return rset
   456         return rset