MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / has_index

Method has_index

lib/sqlalchemy/engine/reflection.py:463–490  ·  view source on GitHub ↗

r"""Check the existence of a particular index name in the database. :param table_name: the name of the table the index belongs to :param index_name: the name of the index to check :param schema: schema name to query, if not the default schema. :param \**kw: Additiona

(
        self,
        table_name: str,
        index_name: str,
        schema: Optional[str] = None,
        **kw: Any,
    )

Source from the content-addressed store, hash-verified

461 )
462
463 def has_index(
464 self,
465 table_name: str,
466 index_name: str,
467 schema: Optional[str] = None,
468 **kw: Any,
469 ) -> bool:
470 r"""Check the existence of a particular index name in the database.
471
472 :param table_name: the name of the table the index belongs to
473 :param index_name: the name of the index to check
474 :param schema: schema name to query, if not the default schema.
475 :param \**kw: Additional keyword argument to pass to the dialect
476 specific implementation. See the documentation of the dialect
477 in use for more information.
478
479 .. versionadded:: 2.0
480
481 """
482 with self._operation_context() as conn:
483 return self.dialect.has_index(
484 conn,
485 table_name,
486 index_name,
487 schema,
488 info_cache=self.info_cache,
489 **kw,
490 )
491
492 def has_schema(self, schema_name: str, **kw: Any) -> bool:
493 r"""Return True if the backend has a schema with the given name.

Callers

nothing calls this directly

Calls 1

_operation_contextMethod · 0.95

Tested by

no test coverage detected