summaryrefslogtreecommitdiff
path: root/test/sql/test_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 /test/sql/test_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 'test/sql/test_compiler.py')
-rw-r--r--test/sql/test_compiler.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index ca3468710..8b4e5053b 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -3081,6 +3081,22 @@ class DDLTest(fixtures.TestBase, AssertsCompiledSQL):
"PRIMARY KEY (b, a))"
)
+ def test_create_table_suffix(self):
+ class MyDialect(default.DefaultDialect):
+ class MyCompiler(compiler.DDLCompiler):
+ def create_table_suffix(self, table):
+ return 'SOME SUFFIX'
+
+ ddl_compiler = MyCompiler
+
+ m = MetaData()
+ t1 = Table('t1', m, Column('q', Integer))
+ self.assert_compile(
+ schema.CreateTable(t1),
+ "CREATE TABLE t1 SOME SUFFIX (q INTEGER)",
+ dialect=MyDialect()
+ )
+
def test_table_no_cols(self):
m = MetaData()
t1 = Table('t1', m)