summaryrefslogtreecommitdiff
path: root/test/dialect/mssql
diff options
context:
space:
mode:
authordonkopotamus <derek.harland@finq.co.nz>2014-01-14 12:44:05 +1300
committerdonkopotamus <derek.harland@finq.co.nz>2014-01-14 12:44:05 +1300
commit40563e9355f4dd2e677d65b37a2e40dfb0f8ff31 (patch)
treec1733378819b8dde7504df4decc0bf9889b85b91 /test/dialect/mssql
parentfe1d892ba4682f9cd037315b103aec4976c7a361 (diff)
downloadsqlalchemy-40563e9355f4dd2e677d65b37a2e40dfb0f8ff31.tar.gz
Support mssql_clustered option in mssql dialect for both Table and PrimaryKeyConstraint
Diffstat (limited to 'test/dialect/mssql')
-rw-r--r--test/dialect/mssql/test_compiler.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py
index 1742f024c..40ca603a0 100644
--- a/test/dialect/mssql/test_compiler.py
+++ b/test/dialect/mssql/test_compiler.py
@@ -510,6 +510,28 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
"CREATE TABLE test (id INTEGER NOT NULL IDENTITY(1,1))"
)
+ def test_table_pkc_clustering_1(self):
+ metadata = MetaData()
+ tbl = Table('test', metadata,
+ Column('x', Integer, primary_key=True, autoincrement=False),
+ Column('y', Integer, primary_key=True, autoincrement=False),
+ mssql_clustered=True)
+ self.assert_compile(schema.CreateTable(tbl),
+ "CREATE TABLE test (x INTEGER NOT NULL, y INTEGER NOT NULL, "
+ "PRIMARY KEY CLUSTERED (x, y))"
+ )
+
+ def test_table_pkc_clustering_2(self):
+ metadata = MetaData()
+ tbl = Table('test', metadata,
+ Column('x', Integer, autoincrement=False),
+ Column('y', Integer, autoincrement=False),
+ PrimaryKeyConstraint("x", "y", mssql_clustered=True))
+ self.assert_compile(schema.CreateTable(tbl),
+ "CREATE TABLE test (x INTEGER NOT NULL, y INTEGER NOT NULL, "
+ "PRIMARY KEY CLUSTERED (x, y))"
+ )
+
def test_index_clustering(self):
metadata = MetaData()
tbl = Table('test', metadata,