fix(sqla): allow 'unknown' type queries in explore view (#11365)

This commit is contained in:
serenajiang
2020-10-21 10:24:52 -07:00
committed by Ville Brofeldt
parent c8d0778b89
commit 34bbc77cec
2 changed files with 5 additions and 1 deletions

View File

@@ -113,6 +113,9 @@ class ParsedQuery:
def is_explain(self) -> bool:
return self.stripped().upper().startswith("EXPLAIN")
def is_unknown(self) -> bool:
return self._parsed[0].get_type() == "UNKNOWN"
def is_readonly(self) -> bool:
"""Pessimistic readonly, 100% sure statement won't mutate anything"""
return self.is_select() or self.is_explain()