diff options
author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> | 2007-11-09 15:32:21 +0100 |
---|---|---|
committer | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> | 2007-11-09 15:32:21 +0100 |
commit | 1f8fab8ead2dccfc9857b5d9ecdebd71cfaaa334 (patch) | |
tree | 1259502f8827c9dfdcafb0cdb44d80a7d5d6d2df /adbh.py | |
parent | ed14fb826b0e4c0c237e703fe4d8d1abb6c28032 (diff) | |
download | logilab-common-1f8fab8ead2dccfc9857b5d9ecdebd71cfaaa334.tar.gz |
list_tables() should return a list of tablenames
Diffstat (limited to 'adbh.py')
-rw-r--r-- | adbh.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |