import psycopg2
from .dstatus import Commit_Status, Isolation_Status, Sql_Status
from _typeshed import Incomplete
from typing import Any

__all__ = ['n_postgresql']

class n_postgresql:
    debug: bool
    @classmethod
    def set_pool_debug(cls, debug: bool) -> None: ...
    def set_connect_debug(self, debug: bool) -> None: ...
    @classmethod
    def initialize_pool(cls, minconn: int = 1, maxconn: int = 10, **kwargs): ...
    @classmethod
    def start_healthcheckthread(cls, interval: float = 15.0): ...
    @classmethod
    def stop_healthcheckthread(cls) -> None: ...
    @classmethod
    def close_pool(cls) -> None: ...
    host: Incomplete
    port: Incomplete
    user: Incomplete
    password: Incomplete
    charset: Incomplete
    connection: psycopg2.extensions.connection | None
    use_pool: Incomplete
    def __init__(self, host: str | None = None, port: int | None = None, user: str | None = None, password: str | None = None, charset: str = 'utf8', debug: bool = False, use_pool: bool = False) -> None: ...
    @classmethod
    def getInstance(cls, connect: psycopg2.extensions.connection | None = None, *, host: str = None, port: int = None, user: str = None, password: str = None, charset: str = 'utf8', debug: bool = False) -> n_postgresql | None: ...
    def connect_server(self, commit_status: Commit_Status = ...): ...
    def setup(self, db_name: str, is_start_transaction: bool = False) -> None: ...
    def use_database(self, db_name: str) -> None: ...
    def exec_cmd(self, cmd: str) -> str | list[tuple[Any, ...]] | None: ...
    def exec_language(self, sql_language: str, params: Incomplete | None = None, fetch: Incomplete | None = None) -> tuple[tuple[Any, ...], ...] | None: ...
    @property
    def isolation(self) -> Isolation_Status | None: ...
    @isolation.setter
    def isolation(self, iso_status: Isolation_Status): ...
    def quick_select(self, name: str, limit: int | None = None) -> list | None: ...
    @property
    def commit_status(self) -> Commit_Status: ...
    @commit_status.setter
    def commit_status(self, status: Commit_Status): ...
    @property
    def current_db(self) -> str | None: ...
    @current_db.setter
    def current_db(self, db_name: str): ...
    def startTransAction(self) -> None: ...
    def commit(self) -> None: ...
    def rollback(self) -> None: ...
    @property
    def connect_status(self) -> Sql_Status: ...
    def exists_db(self, database_name: str) -> bool: ...
    def create_database(self, database_name: str) -> None: ...
    def exists_table(self, tb_name: str, schema: str = 'public') -> bool: ...
    def showDatabases(self) -> list[str]: ...
    def showViews(self) -> list[str]: ...
    def showTables(self) -> list[str]: ...
    def exists_view(self, view_name: str, schema: str = 'public') -> bool: ...
    def drop_table(self, tb_name: str): ...
    def drop_database(self, db_name: str) -> None: ...
    def drop_view(self, view_name: str): ...
    def getEncryAccountPassword(self, username: str) -> str: ...
    def resetPassword(self, new_password: str, username: str | None = None, require_old_password: bool = False, old_password: str | None = None): ...
    def createAdminAccount(self, username: str, password: str) -> bool: ...
    def createOnlyReadAccount(self, username: str, password: str) -> bool: ...
    def createDefaultAccount(self, username: str, password: str) -> bool: ...
    def deleteAccountAnyWay(self, account_name: str) -> bool: ...
    def showAllAccountWithPermission(self) -> list: ...
    @staticmethod
    def print_as_table(data: list, headers: Incomplete | None = None): ...
    def disconnect_server(self) -> None: ...
    def __enter__(self): ...
    def __exit__(self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None) -> None: ...
    def __del__(self) -> None: ...
