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 the exact-fraction scalar function on every SQLite 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
Fractiondoes;httk_fraction_scaled_equalpreserves 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 Noneis 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: