summaryrefslogtreecommitdiff
path: root/adbh.py
diff options
context:
space:
mode:
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>2007-11-09 15:32:21 +0100
committerAdrien Di Mascio <Adrien.DiMascio@logilab.fr>2007-11-09 15:32:21 +0100
commit1f8fab8ead2dccfc9857b5d9ecdebd71cfaaa334 (patch)
tree1259502f8827c9dfdcafb0cdb44d80a7d5d6d2df /adbh.py
parented14fb826b0e4c0c237e703fe4d8d1abb6c28032 (diff)
downloadlogilab-common-1f8fab8ead2dccfc9857b5d9ecdebd71cfaaa334.tar.gz
list_tables() should return a list of tablenames
Diffstat (limited to 'adbh.py')
-rw-r--r--adbh.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/adbh.py b/adbh.py
index 80dc56d..a4d5e78 100644
--- a/adbh.py
+++ b/adbh.py
@@ -335,7 +335,7 @@ class _PGAdvFuncHelper(_GenericAdvFuncHelper):
def list_tables(self, cursor):
"""return the list of tables of a database"""
cursor.execute("SELECT tablename FROM pg_tables")
- return cursor.fetchall()
+ return [r[0] for r in cursor.fetchall()]
def create_language(self, cursor, extlang):
"""postgres specific method to install a procedural language on a database"""
@@ -363,7 +363,7 @@ class _SqliteAdvFuncHelper(_GenericAdvFuncHelper):
"""return the list of tables of a database"""
# filter type='table' else we get indices as well
cursor.execute("SELECT name FROM sqlite_master WHERE type='table'")
- return cursor.fetchall( )
+ return [r[0] for r in cursor.fetchall()]
class _MyAdvFuncHelper(_GenericAdvFuncHelper):
"""Postgres helper, taking advantage of postgres SEQUENCE support