From: Mike Bayer Date: Sat, 6 Jan 2007 19:28:21 +0000 (+0000) Subject: tweak to support reflecting eqlite columns that didnt specify a type X-Git-Tag: rel_0_3_4~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4add9d3a0d9b660c9a267827ad3dd4ceceb0bfb5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git tweak to support reflecting eqlite columns that didnt specify a type --- diff --git a/lib/sqlalchemy/databases/sqlite.py b/lib/sqlalchemy/databases/sqlite.py index e20b35de0f..6d1e56a7c7 100644 --- a/lib/sqlalchemy/databases/sqlite.py +++ b/lib/sqlalchemy/databases/sqlite.py @@ -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)