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

Method has_index

lib/sqlalchemy/engine/interfaces.py:1916–1941  ·  view source on GitHub ↗

Check the existence of a particular index name in the database. Given a :class:`_engine.Connection` object, a string ``table_name`` and string index name, return ``True`` if an index of the given name on the given table exists, ``False`` otherwise. The :class:`.Defa

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

Source from the content-addressed store, hash-verified

1914 raise NotImplementedError()
1915
1916 def has_index(
1917 self,
1918 connection: Connection,
1919 table_name: str,
1920 index_name: str,
1921 schema: Optional[str] = None,
1922 **kw: Any,
1923 ) -> bool:
1924 """Check the existence of a particular index name in the database.
1925
1926 Given a :class:`_engine.Connection` object, a string
1927 ``table_name`` and string index name, return ``True`` if an index of
1928 the given name on the given table exists, ``False`` otherwise.
1929
1930 The :class:`.DefaultDialect` implements this in terms of the
1931 :meth:`.Dialect.has_table` and :meth:`.Dialect.get_indexes` methods,
1932 however dialects can implement a more performant version.
1933
1934 This is an internal dialect method. Applications should use
1935 :meth:`_engine.Inspector.has_index`.
1936
1937 .. versionadded:: 1.4
1938
1939 """
1940
1941 raise NotImplementedError()
1942
1943 def has_sequence(
1944 self,

Callers 3

_can_create_indexMethod · 0.45
_can_drop_indexMethod · 0.45
_has_indexMethod · 0.45

Calls

no outgoing calls

Tested by 1

_has_indexMethod · 0.36