﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
460	Patch for get_table_list() for SQLite3	Swaroop C H	Adrian Holovaty	"I've attached a patch for implementation of get_table_list() for SQLite3 in django/core/db/backends/sqlite3.py

I'm not sure if any Unicode issues are to be taken care of.

{{{

Index: sqlite3.py
===================================================================
--- sqlite3.py	(revision 618)
+++ sqlite3.py	(working copy)
@@ -119,7 +119,13 @@
         return ""%i-%02i-%02i 00:00:00"" % (dt.year, dt.month, dt.day)
 
 def get_table_list(cursor):
-    raise NotImplementedError
+    '''See http://www.sqlite.org/faq.html#q9 on how to list all tables in a SQLite database.'''
+    cursor.execute('''
+        SELECT name FROM sqlite_master
+        WHERE type='table'
+        ORDER BY name
+    ''')
+    return [row[0] for row in cursor.fetchall()]
 
 def get_relations(cursor, table_name):
     raise NotImplementedError


}}}


Thanks!
Swaroop
www.swaroopch.info"	enhancement	closed	Database layer (models, ORM)		normal	fixed	typo		Ready for checkin	0	0	0	0	0	0
