ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

module documentation

Store cache entries and atomic lock owners in relational tables.

Class DatabaseCacheBackend Cache backend that stores entries in a relational database table.
Function _build_entries_table Build the table definition for the cache entries table.
Function _build_locks_table Build the table definition for the atomic-locks table.
Function build Build and return a DatabaseCacheBackend.
Constant _DEFAULT_LOCK_TABLE Default lock table used when the config does not declare one explicitly.
Constant _INCREMENT_ATTEMPTS Compare-and-swap rounds allowed before an increment gives up on contention.
Constant _MISSING Sentinel object to distinguish "key not found" from a stored None value.
def _build_entries_table(table: str) -> TableDefinition: (source)

Build the table definition for the cache entries table.

Parameters
table:strLogical table name for cache entries.
Returns
orionis.orm.schema.TableDefinitionDefinition with cache_key (primary key), cache_value (JSON payload) and expiration (epoch seconds, sub-second precision, nullable) columns.
def _build_locks_table(table: str) -> TableDefinition: (source)

Build the table definition for the atomic-locks table.

Parameters
table:strLogical table name for cache locks.
Returns
orionis.orm.schema.TableDefinitionDefinition with cache_key (primary key), owner and expiration (epoch seconds, sub-second precision) columns.
def build(connection: IConnection, table: str, lock_table: str | None = None) -> DatabaseCacheBackend: (source)

Build and return a DatabaseCacheBackend.

Parameters
connection:orionis.database.contracts.IConnectionDatabase connection used to store cache entries and locks.
table:strTable name used to store cache entries.
lock_table:str | NoneTable name used to store atomic locks.
Returns
orionis.cache.stores.database.DatabaseCacheBackendConfigured database-backed cache backend.
_DEFAULT_LOCK_TABLE: str = (source)

Default lock table used when the config does not declare one explicitly.

Value
'cache_locks'
_INCREMENT_ATTEMPTS: int = (source)

Compare-and-swap rounds allowed before an increment gives up on contention.

Value
25
_MISSING = (source)

Sentinel object to distinguish "key not found" from a stored None value.

Value
object()