def __init__(self, dsn: str, querymgr: QueryManager, readonly: bool = True, autocommit: bool = False, application_name: Optional[str] = None) -> None: self._db = psycopg2.connect(dsn, application_name=application_name) self._db.set_session(readonly=readonly, autocommit=autocommit) querymgr.inject_queries(self, self._db)
def __init__(self, dsn: str, querymgr: QueryManager, readonly: bool = True, autocommit: bool = False, application_name: str | None = None) -> None: self._db = psycopg2.connect(dsn, application_name=application_name) self._db.set_session( readonly=readonly, autocommit=autocommit ) # type: ignore # broken typing stubs for psycopg2 querymgr.inject_queries(self, self._db)