httk.store.backend.sqlite.hooks

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

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

Functions

install_engine_functions(engine)

Install the exact-fraction scalar function on every SQLite connection.

connection_uses_autocommit(connection)

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

Module Contents

httk.store.backend.sqlite.hooks.install_engine_functions(engine)

Install the exact-fraction scalar function on every SQLite connection.

Fraction values are persisted canonically as text because SQL integer products can overflow long before a valid Python Fraction does; httk_fraction_scaled_equal preserves exact comparisons without touching presentation float columns.

Parameters:

engine (sqlalchemy.Engine) – The SQLite SQLAlchemy engine to install the function on.

Returns:

None.

Return type:

None

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

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

sqlite3.Connection.isolation_level is None is SQLite’s documented autocommit mode; the SQLAlchemy checks cover alternate DBAPI wrappers while still requiring the live connection to agree.

Parameters:

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

Returns:

Whether the underlying DBAPI connection is in autocommit mode.

Return type:

bool