예제 #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
예제 #2
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
예제 #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
예제 #5
0
 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