summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-11-12 10:36:03 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2010-11-12 10:36:03 -0500
commitbbe3f0a27c5b4cb6506d2f23d8a2654c80d6b481 (patch)
tree14f58d95711635c59fd581746ffbba6a1d682e8d /lib/sqlalchemy/sql/compiler.py
parent5b96e3fff73c455ef2ba262dc904bc9b6d28f554 (diff)
downloadsqlalchemy-bbe3f0a27c5b4cb6506d2f23d8a2654c80d6b481.tar.gz
- The REFERENCES clause in a CREATE TABLE that includes
a remote schema name now renders the remote name without the schema clause, as required by SQLite. [ticket:1851]
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index d3b8bf023..4b41c6ed3 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1306,7 +1306,7 @@ class DDLCompiler(engine.Compiled):
text += "FOREIGN KEY(%s) REFERENCES %s (%s)" % (
', '.join(preparer.quote(f.parent.name, f.parent.quote)
for f in constraint._elements.values()),
- preparer.format_table(remote_table),
+ self.define_constraint_remote_table(constraint, remote_table, preparer),
', '.join(preparer.quote(f.column.name, f.column.quote)
for f in constraint._elements.values())
)
@@ -1314,6 +1314,11 @@ class DDLCompiler(engine.Compiled):
text += self.define_constraint_deferrability(constraint)
return text
+ def define_constraint_remote_table(self, constraint, table, preparer):
+ """Format the remote table clause of a CREATE CONSTRAINT clause."""
+
+ return preparer.format_table(table)
+
def visit_unique_constraint(self, constraint):
text = ""
if constraint.name is not None: