Use execute_read for explain query plan.

This commit is contained in:
voussoir 2022-09-07 18:05:01 -07:00
parent dcb051bcc7
commit b4ec72fb53
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -338,7 +338,7 @@ class Database(metaclass=abc.ABCMeta):
return (row is not None) return (row is not None)
def explain(self, query, bindings=None) -> str: def explain(self, query, bindings=None) -> str:
exp = self.execute('EXPLAIN QUERY PLAN ' + query, bindings) exp = self.execute_read('EXPLAIN QUERY PLAN ' + query, bindings)
return '\n'.join(str(tuple(x)) for x in exp.fetchall()) return '\n'.join(str(tuple(x)) for x in exp.fetchall())
def get_object_by_id(self, object_class, object_id): def get_object_by_id(self, object_class, object_id):