diff options
author | Pete Hollobon <phollobon@renshawbay.com> | 2015-06-04 16:45:41 +0100 |
---|---|---|
committer | Pete Hollobon <phollobon@renshawbay.com> | 2015-06-04 16:45:41 +0100 |
commit | af19435b9c1cec28d0ac93aa832b45601af51597 (patch) | |
tree | 06fbb33f1b5eed5dee47be44aff0f950cbffac53 /test/dialect/postgresql/test_reflection.py | |
parent | b03ee45f32e53416ce1c73fa15966db17ed4bbf9 (diff) | |
download | sqlalchemy-pr/179.tar.gz |
Add reflection of PostgreSQL index access methods (USING clause)pr/179
Diffstat (limited to 'test/dialect/postgresql/test_reflection.py')
-rw-r--r-- | test/dialect/postgresql/test_reflection.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index 70b81219e..2321a3054 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -12,6 +12,7 @@ from sqlalchemy import Table, Column, MetaData, Integer, String, \ from sqlalchemy import exc import sqlalchemy as sa from sqlalchemy.dialects.postgresql import base as postgresql +from sqlalchemy.dialects.postgresql import ARRAY class ForeignTableReflectionTest(fixtures.TablesTest, AssertsExecutionResults): @@ -691,6 +692,24 @@ class ReflectionTest(fixtures.TestBase): 'dialect_options': {"postgresql_with": {"fillfactor": "50"}}}]) conn.close() + @testing.provide_metadata + def test_index_reflection_with_access_method(self): + """reflect indexes with storage options set""" + + metadata = self.metadata + + t1 = Table('t', metadata, + Column('id', Integer, primary_key=True), + Column('x', ARRAY(Integer)) + ) + metadata.create_all() + conn = testing.db.connect().execution_options(autocommit=True) + conn.execute("CREATE INDEX idx1 ON t USING gin (x)") + + ind = testing.db.dialect.get_indexes(conn, "t", None) + eq_(ind, [{'unique': False, 'column_names': ['x'], 'name': 'idx1', + 'dialect_options': {'postgresql_using': 'gin'}}]) + conn.close() @testing.provide_metadata def test_foreign_key_option_inspection(self): |