MCPcopy Create free account
hub / github.com/explorerhq/sql-explorer / execute_with_logging

Method execute_with_logging

explorer/models.py:116–130  ·  view source on GitHub ↗
(self, executing_user)

Source from the content-addressed store, hash-verified

114 )
115
116 def execute_with_logging(self, executing_user):
117 ql = self.log(executing_user)
118 ql.save()
119 try:
120 ret = self.execute()
121 except DatabaseError as e:
122 ql.success = False
123 ql.error = str(e)
124 ql.save()
125 raise e
126 ql.duration = ret.duration
127 ql.save()
128 Stat(StatNames.QUERY_RUN,
129 {"sql_len": len(ql.sql), "duration": ql.duration}).track()
130 return ret, ql
131
132 def execute(self):
133 ret = self.execute_query_only()

Callers 3

query_viewmodelFunction · 0.80
test_log_saves_errorsMethod · 0.80

Calls 5

logMethod · 0.95
executeMethod · 0.95
StatClass · 0.90
saveMethod · 0.80
trackMethod · 0.80

Tested by 2

test_log_saves_errorsMethod · 0.64