diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-10-19 23:01:14 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-10-19 23:01:14 +0000 |
commit | a941dff48f04b9dc0a81ce2673c67b2ba24971ac (patch) | |
tree | 73ae99fe44d8b029a1ae98a03d820d9aed37b2c0 /lib/sqlalchemy/databases/sqlite.py | |
parent | 6a38b502e08dae3430328e2eff557c638e042373 (diff) | |
download | sqlalchemy-a941dff48f04b9dc0a81ce2673c67b2ba24971ac.tar.gz |
fix for sqlite refection of names with weird quotes around them in the DDL which seem to hang around
Diffstat (limited to 'lib/sqlalchemy/databases/sqlite.py')
-rw-r--r-- | lib/sqlalchemy/databases/sqlite.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/databases/sqlite.py b/lib/sqlalchemy/databases/sqlite.py index a4445b1a8..557441254 100644 --- a/lib/sqlalchemy/databases/sqlite.py +++ b/lib/sqlalchemy/databases/sqlite.py @@ -186,7 +186,7 @@ class SQLiteDialect(ansisql.ANSIDialect): #print "row! " + repr(row) found_table = True (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) @@ -213,6 +213,9 @@ class SQLiteDialect(ansisql.ANSIDialect): if row is None: break (constraint_name, tablename, localcol, remotecol) = (row[0], row[2], row[3], row[4]) + tablename = re.sub(r'^\"|\"$', '', tablename) + localcol = re.sub(r'^\"|\"$', '', localcol) + remotecol = re.sub(r'^\"|\"$', '', remotecol) try: fk = fks[constraint_name] except KeyError: |