diff --git a/README.md b/README.md index ef46ab7..aa9a0b2 100644 --- a/README.md +++ b/README.md @@ -234,6 +234,22 @@ Run (all) tests: pytest --db ingres_odbc --junit-xml=all_results_junit.xml --maxfail=12000 +## Execution Options + +### Index Reflection + +The default Ingres dialect behavior for index reflection is to return only user-defined indexes. + +To inspect all indexes, including those generated by the DBMS, set the connection execution option `inspect_indexes="ALL"`. + +Example: + + connection.execution_options(inspect_indexes="ALL") + i = sqlalchemy.inspect(connection) + print(i.get_indexes("employee_table")) + +Documentation reference [iiindexes catalog](https://docs.actian.com/actianx/12.0/index.html#page/DatabaseAdmin/Standard_Catalogs_for_All_Databases.htm#ww1029558) + ## Known Issues Apache Superset issue [27427](https://github.com/apache/superset/issues/27427) diff --git a/lib/sqlalchemy_ingres/_version.py b/lib/sqlalchemy_ingres/_version.py index 082650e..433e13e 100644 --- a/lib/sqlalchemy_ingres/_version.py +++ b/lib/sqlalchemy_ingres/_version.py @@ -1,2 +1,2 @@ -version_tuple = __version_info__ = (0, 0, 8, "dev0") +version_tuple = __version_info__ = (0, 0, 8, "dev1") version = version_string = __version__ = '.'.join(map(str, __version_info__)) diff --git a/lib/sqlalchemy_ingres/base.py b/lib/sqlalchemy_ingres/base.py index d6562e5..6f4d50d 100644 --- a/lib/sqlalchemy_ingres/base.py +++ b/lib/sqlalchemy_ingres/base.py @@ -804,6 +804,11 @@ def get_indexes(self, connection, table_name, schema=None, **kw): AND i.index_owner = c.index_owner AND i.base_name = ?""" params = (self.denormalize_name(table_name),) + + if (connection.get_execution_options().get('inspect_indexes') is None or + connection.get_execution_options().get('inspect_indexes').upper() != "ALL"): + sqltext += """ + AND i.system_use = 'U'""" if schema: sqltext += """ @@ -816,7 +821,7 @@ def get_indexes(self, connection, table_name, schema=None, **kw): rs = None indexes = {} - + try: rs = connection.exec_driver_sql(sqltext, params)