httk.store.backend.postgresql.hooks

PostgreSQL engine hooks: the per-dialect behavior the neutral SQL engine dispatches to.

httk.store.backend.sql.engine keeps only neutral dialect dispatch; the PostgreSQL-specific bodies live here and are imported lazily on first use by the _DIALECT_HOOKS registry in httk.store.backend.sql.engine.

Functions

connection_uses_autocommit(connection)

Return whether the live PostgreSQL DBAPI connection is in autocommit mode.

Module Contents

httk.store.backend.postgresql.hooks.connection_uses_autocommit(connection)

Return whether the live PostgreSQL DBAPI connection is in autocommit mode.

psycopg 3 exposes the live autocommit flag on the DBAPI connection; the transactional-profile validator relies on this to reject a misconfigured AUTOCOMMIT PostgreSQL engine.

Parameters:

connection (sqlalchemy.Connection) – The live PostgreSQL SQLAlchemy connection to inspect.

Returns:

Whether the underlying DBAPI connection is in autocommit mode.

Return type:

bool