示例#1
0
 def execute(self, sql, params=()):
     try:
         return self.cursor.execute(sql, params)
     finally:
         raw_sql = self.db.ops.last_executed_query(self.cursor, sql, params)
         print sqlparse.format(raw_sql, reindent=True)
         print
 def execute(self, sql, params=()):
     try:
         return self.cursor.execute(sql, params)
     finally:
         raw_sql = self.db.ops.last_executed_query(self.cursor, sql, params)
         print sqlparse.format(raw_sql, reindent=True)
         print
示例#3
0
 def execute(self, sql, params=()):
     starttime = datetime.now()
     try:
         return self.cursor.execute(sql, params)
     finally:
         raw_sql = self.db.ops.last_executed_query(self.cursor, sql, params)
         execution_time = datetime.now() - starttime
         print sqlparse.format(raw_sql, reindent=True),
         print ' [%.2fms]' % (ms_from_timedelta(execution_time), )
         print
示例#4
0
 def execute(self, sql, params=()):
     starttime = datetime.now()
     try:
         return self.cursor.execute(sql, params)
     finally:
         raw_sql = self.db.ops.last_executed_query(self.cursor, sql, params)
         execution_time = datetime.now() - starttime
         print sqlparse.format(raw_sql, reindent=True),
         print ' [%.2fms]' % (ms_from_timedelta(execution_time),)
         print
 def execute(self, sql, params=()):
     starttime = datetime.today()
     try:
         return self.cursor.execute(sql, params)
     finally:
         raw_sql = self.db.ops.last_executed_query(self.cursor, sql, params)
         execution_time = datetime.today() - starttime
         print sqlparse.format(raw_sql, reindent=True)
         print
         print "Execution time: %fs" % execution_time.total_seconds()
         print
 def execute(self, sql, params=()):
     starttime = datetime.today()
     try:
         return self.cursor.execute(sql, params)
     finally:
         raw_sql = self.db.ops.last_executed_query(self.cursor, sql, params)
         execution_time = datetime.today() - starttime
         print sqlparse.format(raw_sql, reindent=True)
         print
         print 'Execution time: %fs' % execution_time.total_seconds()
         print