From 086ae95614b4848c486eeb7acf2bc1b03b2a6a37 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 28 Jul 2011 11:53:18 -0400 Subject: - SQLite dialect no longer strips quotes off of reflected default value, allowing a round trip CREATE TABLE to work. This is consistent with other dialects that also maintain the exact form of the default. [ticket:2189] --- lib/sqlalchemy/dialects/sqlite/base.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/dialects/sqlite') diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index 331ab92d0..577b9a3a0 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -630,17 +630,19 @@ class SQLiteDialect(default.DefaultDialect): else: pragma = "PRAGMA " qtable = quote(table_name) - c = _pragma_cursor(connection.execute("%stable_info(%s)" % (pragma, qtable))) + c = _pragma_cursor( + connection.execute("%stable_info(%s)" % + (pragma, qtable))) found_table = False columns = [] while True: row = c.fetchone() if row is None: break - (name, type_, nullable, default, has_default, primary_key) = (row[1], row[2].upper(), not row[3], row[4], row[4] is not None, row[5]) + (name, type_, nullable, default, has_default, primary_key) = \ + (row[1], row[2].upper(), not row[3], + row[4], row[4] is not None, row[5]) name = re.sub(r'^\"|\"$', '', name) - if default: - default = re.sub(r"^\'|\'$", '', default) match = re.match(r'(\w+)(\(.*?\))?', type_) if match: coltype = match.group(1) -- cgit v1.2.1