Simplify worms.get_tables with select_column.
This commit is contained in:
parent
6867fb3011
commit
59df12a23f
1 changed files with 1 additions and 2 deletions
|
@ -266,8 +266,7 @@ class Database(metaclass=abc.ABCMeta):
|
||||||
Return the set of all table names in the database.
|
Return the set of all table names in the database.
|
||||||
'''
|
'''
|
||||||
query = 'SELECT name FROM sqlite_master WHERE type = "table"'
|
query = 'SELECT name FROM sqlite_master WHERE type = "table"'
|
||||||
table_rows = self.select(query)
|
tables = set(self.select_column(query))
|
||||||
tables = set(name for (name,) in table_rows)
|
|
||||||
return tables
|
return tables
|
||||||
|
|
||||||
def insert(self, table, data) -> None:
|
def insert(self, table, data) -> None:
|
||||||
|
|
Loading…
Reference in a new issue