From ed39e846cd8ae2714c47fc3d563582f72483df0c Mon Sep 17 00:00:00 2001 From: Tobias Pfeiffer Date: Mon, 28 Nov 2022 07:52:31 -0500 Subject: add partial index predicate to SQLiteDialect.get_indexes() result Added support for reflection of expression-oriented WHERE criteria included in indexes on the SQLite dialect, in a manner similar to that of the PostgreSQL dialect. Pull request courtesy Tobias Pfeiffer. Fixes: #8804 Closes: #8806 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8806 Pull-request-sha: 539dfcb372360911b69aed2a804698bb1a2220b1 Change-Id: I0e34d47dbe2b9c1da6fce531363084843e5127a3 --- lib/sqlalchemy/testing/suite/test_reflection.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/testing') diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py index 563f129ab..60f8fabf1 100644 --- a/lib/sqlalchemy/testing/suite/test_reflection.py +++ b/lib/sqlalchemy/testing/suite/test_reflection.py @@ -2393,7 +2393,12 @@ class ComponentReflectionTestExtra(ComparesIndexes, fixtures.TestBase): insp = inspect(connection) expected = [ - {"name": "t_idx_2", "column_names": ["x"], "unique": False} + { + "name": "t_idx_2", + "column_names": ["x"], + "unique": False, + "dialect_options": {}, + } ] def completeIndex(entry): @@ -2402,6 +2407,8 @@ class ComponentReflectionTestExtra(ComparesIndexes, fixtures.TestBase): entry["dialect_options"] = { f"{connection.engine.name}_include": [] } + else: + entry.setdefault("dialect_options", {}) completeIndex(expected[0]) -- cgit v1.2.1