Instead of checking get_tables, just check the COLUMN_INDEX.
This reduces the number of frivolous sql queries we make, since the index contians all the tables anyway. The side effect is that the function won't acknowledge tables created during the run time, which I kind of think is a good thing since it reduces accident surface area to the tables outlined by the programmer during init.
This commit is contained in:
parent
59df12a23f
commit
465f22fedb
1 changed files with 1 additions and 1 deletions
|
@ -122,7 +122,7 @@ class Database(metaclass=abc.ABCMeta):
|
|||
raise NotImplementedError
|
||||
|
||||
def assert_table_exists(self, table) -> None:
|
||||
if table not in self.get_tables():
|
||||
if table not in self.COLUMN_INDEX:
|
||||
raise BadTable(f'Table {table} does not exist.')
|
||||
|
||||
def close(self):
|
||||
|
|
Loading…
Reference in a new issue