diff options
author | Pete Hollobon <phollobon@renshawbay.com> | 2015-06-03 16:55:58 +0100 |
---|---|---|
committer | Pete Hollobon <phollobon@renshawbay.com> | 2015-06-03 17:32:12 +0100 |
commit | dff81500b161cf41ff5d9e77c21a24010e1bd93b (patch) | |
tree | 44161e757cb78b663c98c9ea084eb647accd245d /test/dialect/postgresql/test_compiler.py | |
parent | 16a87fe6d954def3143820217adf398d8eda42c9 (diff) | |
download | sqlalchemy-dff81500b161cf41ff5d9e77c21a24010e1bd93b.tar.gz |
Add support for PostgreSQL index storage parameters
Add support for specifying PostgreSQL index storage paramters (e.g.
fillfactor).
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r-- | test/dialect/postgresql/test_compiler.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index aa3f80fdc..706b60bd8 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -369,6 +369,30 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): 'USING hash (data)', dialect=postgresql.dialect()) + def test_create_index_with_with(self): + m = MetaData() + tbl = Table('testtbl', m, Column('data', String)) + + idx1 = Index('test_idx1', tbl.c.data) + idx2 = Index('test_idx2', tbl.c.data, postgresql_with={"fillfactor": 50}) + idx3 = Index('test_idx3', tbl.c.data, postgresql_using="gist", + postgresql_with={"buffering": "off"}) + + self.assert_compile(schema.CreateIndex(idx1), + 'CREATE INDEX test_idx1 ON testtbl ' + '(data)', + dialect=postgresql.dialect()) + self.assert_compile(schema.CreateIndex(idx2), + 'CREATE INDEX test_idx2 ON testtbl ' + '(data) ' + 'WITH (fillfactor = 50)', + dialect=postgresql.dialect()) + self.assert_compile(schema.CreateIndex(idx3), + 'CREATE INDEX test_idx3 ON testtbl ' + 'USING gist (data) ' + 'WITH (buffering = off)', + dialect=postgresql.dialect()) + def test_create_index_expr_gets_parens(self): m = MetaData() tbl = Table('testtbl', m, Column('x', Integer), Column('y', Integer)) |