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

Method execute_query_only

explorer/models.py:99–114  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

97 return swap_params(self.sql, self.available_params())
98
99 def execute_query_only(self):
100 # check blacklist every time sql is run to catch parameterized SQL
101 passes_blacklist_flag, failing_words = self.passes_blacklist()
102
103 error = MSG_FAILED_BLACKLIST % ", ".join(
104 failing_words) if not passes_blacklist_flag else None
105
106 if error:
107 raise ValidationError(
108 error,
109 code="InvalidSql"
110 )
111 conn = self.database_connection or default_db_connection()
112 return QueryResult(
113 self.final_sql(), conn.as_django_connection()
114 )
115
116 def execute_with_logging(self, executing_user):
117 ql = self.log(executing_user)

Calls 5

passes_blacklistMethod · 0.95
final_sqlMethod · 0.95
default_db_connectionFunction · 0.90
QueryResultClass · 0.85
as_django_connectionMethod · 0.80