summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/sqlite.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-10-19 23:01:14 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-10-19 23:01:14 +0000
commita941dff48f04b9dc0a81ce2673c67b2ba24971ac (patch)
tree73ae99fe44d8b029a1ae98a03d820d9aed37b2c0 /lib/sqlalchemy/databases/sqlite.py
parent6a38b502e08dae3430328e2eff557c638e042373 (diff)
downloadsqlalchemy-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.py5
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: