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

Class QueryLog

explorer/models.py:221–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219
220
221class QueryLog(models.Model):
222 sql = models.TextField(blank=True)
223 query = models.ForeignKey(
224 Query,
225 null=True,
226 blank=True,
227 on_delete=models.SET_NULL
228 )
229 run_by_user = models.ForeignKey(
230 settings.AUTH_USER_MODEL,
231 null=True,
232 blank=True,
233 on_delete=models.CASCADE
234 )
235 run_at = models.DateTimeField(auto_now_add=True)
236 duration = models.FloatField(blank=True, null=True) # milliseconds
237 # NOTE this field is deprecated in favor of database_connection and no longer in use.
238 # It is present in the 6.0 release to preserve backwards compatibility in case there is need for a rollback.
239 # It will be removed in a future release (e.g. v6.1)
240 connection = models.CharField(blank=True, max_length=128, default="")
241 database_connection = models.ForeignKey(to=DatabaseConnection, on_delete=models.SET_NULL, null=True)
242 success = models.BooleanField(default=True)
243 error = models.TextField(blank=True, null=True)
244
245 @property
246 def is_playground(self):
247 return self.query_id is None
248
249 class Meta:
250 ordering = ["-run_at"]
251
252
253class QueryFavorite(models.Model):

Callers 5

test_is_playgroundMethod · 0.90
set_up_the_thingsMethod · 0.90
last_run_logMethod · 0.85
logMethod · 0.85

Calls

no outgoing calls

Tested by 3

test_is_playgroundMethod · 0.72
set_up_the_thingsMethod · 0.72