ahvn.klstore.db_store module¶

class ahvn.klstore.db_store.DatabaseKLStore(database=None, name=None, condition=None, *args, **kwargs)[source]¶

Bases: BaseKLStore

Database-backed KL store using the UKF ORM model.

Minimal, clear implementation that maps UKF ORM rows to BaseUKF objects.

Parameters:
__init__(database=None, name=None, condition=None, *args, **kwargs)[source]¶

Initialize the database KL store.

Parameters:
  • database (Optional[str]) – Database name or path.

  • name (Optional[str]) – Name of the KLStore instance. If None, defaults to “default”.

  • condition (Optional[Callable]) – Optional upsert/insert condition to apply to the KLStore. KLs that do not satisfy the condition will be ignored. If None, all KLs are accepted.

  • *args – Additional positional arguments for BaseKLStore.

  • **kwargs – Additional keyword arguments for BaseKLStore.

close()[source]¶

Closes the store, if applicable.