summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMark Sandan <msandan@utexas.edu>2016-05-23 17:08:36 -0700
committerMike Bayer <mike_mp@zzzcomputing.com>2016-06-16 11:43:02 -0400
commitd7b8b475f8a5c0ddf955157f89db3d44d0dc0d9a (patch)
tree8ce3434eec8554bf085c2b7068c66d0588e2383a /lib/sqlalchemy/sql/compiler.py
parente5bdf96bc0b1503c4e4c8461748cd061f624e346 (diff)
downloadsqlalchemy-d7b8b475f8a5c0ddf955157f89db3d44d0dc0d9a.tar.gz
Add DDLCompiler.create_table_suffix()
Allows custom dialects to add keywords after the CREATE TABLE section. Change-Id: I6fa66dfcf00ef95122f491a9115410df2746cf88
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 5e537dfdc..fc5073596 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -2260,7 +2260,13 @@ class DDLCompiler(Compiled):
text = "\nCREATE "
if table._prefixes:
text += " ".join(table._prefixes) + " "
- text += "TABLE " + preparer.format_table(table) + " ("
+ text += "TABLE " + preparer.format_table(table) + " "
+
+ create_table_suffix = self.create_table_suffix(table)
+ if create_table_suffix:
+ text += create_table_suffix + " "
+
+ text += "("
separator = "\n"
@@ -2465,6 +2471,9 @@ class DDLCompiler(Compiled):
colspec += " NOT NULL"
return colspec
+ def create_table_suffix(self, table):
+ return ''
+
def post_create_table(self, table):
return ''