コード例 #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
ファイル: debugsqlshell.py プロジェクト: 2flcastro/ka-lite
 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
コード例 #6
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