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/postgresql/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/postgresql/test_compiler.py')
-rw-r--r-- | test/dialect/postgresql/test_compiler.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index 708dbe147..517d570c9 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -452,7 +452,20 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): dialect=postgresql.dialect(), ) + idx3 = Index( + "test_idx2", + tbl.c.data, + postgresql_where="data > 'a' AND data < 'b''s'", + ) + self.assert_compile( + schema.CreateIndex(idx3), + "CREATE INDEX test_idx2 ON testtbl (data) " + "WHERE data > 'a' AND data < 'b''s'", + dialect=postgresql.dialect(), + ) + def test_create_index_with_ops(self): + m = MetaData() tbl = Table( "testtbl", |