"""
This type stub file was generated by pyright.
"""

from functools import lru_cache

"""
Database-related functionality.
"""

def get_database_file(path): ...

class ConnectionManager:
    def __init__(
        self, database_path=..., reset_database=..., config=..., init_args=...
    ) -> None: ...
    @classmethod
    def exists(cls, database_path): ...
    def reset_database(self, init_args, config=...): ...
    def save_database(
        self, database_path, replace_connection=...
    ):  # -> ConnectionManager | Self@ConnectionManager:
        """Save the current index as a SQLite3 DB at the specified location.

        Note: This is only necessary if a database_path was not specified
        at initialization, and the user now wants to save the index.
        If a database_path was specified originally, there is no need to
        re-save using this method.

        Parameters
        ----------
        database_path : str
            The path to the desired database folder. By default,
            uses .db_cache. If a relative path is passed, it is assumed to
            be relative to the BIDSLayout root directory.
        replace_connection : bool, optional
            If True, returns a new ConnectionManager that points to the newly
            created database. If False, returns the current instance.
        """
        ...
    @property
    def session(self): ...
    @property
    @lru_cache()
    def layout_info(self): ...
    def reset_session(self):  # -> None:
        """Force a new session."""
        ...
