entropy.db: new method listAllTables

new method that returns a list of available database tables
This commit is contained in:
Fabio Erculiani
2009-03-30 12:44:28 +02:00
parent cf24734a43
commit 159113acd1
+5
View File
@@ -3768,6 +3768,11 @@ class LocalRepository:
)
# remember to close the file
def listAllTables(self):
self.cursor.execute("""
SELECT name FROM SQLITE_MASTER WHERE type = "table"
""")
return self.fetchall2list(self.cursor.fetchall())
def doesTableExist(self, table):
self.cursor.execute('select name from SQLITE_MASTER where type = (?) and name = (?)', ("table",table))