]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
tweak to support reflecting eqlite columns that didnt specify a type
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 6 Jan 2007 19:28:21 +0000 (19:28 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 6 Jan 2007 19:28:21 +0000 (19:28 +0000)
lib/sqlalchemy/databases/sqlite.py

index e20b35de0fe71809a36ef7f0db8ed36f421088c8..6d1e56a7c730cc4dee11fb90f6d2e0113f994210 100644 (file)
@@ -192,8 +192,12 @@ class SQLiteDialect(ansisql.ANSIDialect):
             (name, type, nullable, has_default, primary_key) = (row[1], row[2].upper(), not row[3], row[4] is not None, row[5])
             name = re.sub(r'^\"|\"$', '', name)
             match = re.match(r'(\w+)(\(.*?\))?', type)
-            coltype = match.group(1)
-            args = match.group(2)
+            if match:
+                coltype = match.group(1)
+                args = match.group(2)
+            else:
+                coltype = "VARCHAR"
+                args = ''
             
             #print "coltype: " + repr(coltype) + " args: " + repr(args)
             coltype = pragma_names.get(coltype, SLString)