diff options
author | RamonWill <ramonwilliams@hotmail.co.uk> | 2020-08-20 15:05:39 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-12 10:30:43 -0400 |
commit | 69502725db4829a84872697fd6569631d2a3c47f (patch) | |
tree | a4035a47bb0def00afa405c8fdfe8215ae3d468e /test/dialect/mssql/test_compiler.py | |
parent | 544ef23cd36b0ea30a13c5158121ba5ea7573f03 (diff) | |
download | sqlalchemy-69502725db4829a84872697fd6569631d2a3c47f.tar.gz |
Reflect mssql/postgresql filtered/partial indexes
Added support for inspection / reflection of partial indexes / filtered
indexes, i.e. those which use the ``mssql_where`` or ``postgresql_where``
parameters, with :class:`_schema.Index`. The entry is both part of the
dictionary returned by :meth:`.Inspector.get_indexes` as well as part of a
reflected :class:`_schema.Index` construct that was reflected. Pull
request courtesy Ramon Williams.
**Have a nice day!**
Fixes: #4966
Closes: #5504
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5504
Pull-request-sha: b3018bac987081193b2e65cfdb6aeb7d5d270fcd
Change-Id: Icbb2f93d1545700718ccb5222097185b815f5dbc
Diffstat (limited to 'test/dialect/mssql/test_compiler.py')
-rw-r--r-- | test/dialect/mssql/test_compiler.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py index 83a610888..bedbe31c1 100644 --- a/test/dialect/mssql/test_compiler.py +++ b/test/dialect/mssql/test_compiler.py @@ -1299,6 +1299,12 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "CREATE INDEX test_idx_data_1 ON test (data) WHERE data > 1", ) + idx = Index("test_idx_data_1", tbl.c.data, mssql_where="data > 1") + self.assert_compile( + schema.CreateIndex(idx), + "CREATE INDEX test_idx_data_1 ON test (data) WHERE data > 1", + ) + def test_index_ordering(self): metadata = MetaData() tbl = Table( |