(self, executing_user)
| 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() |