hio.base.hier.holding

hio.hold.holding Module

Provides durable data storage with LMDB

Module Contents

class hio.base.hier.holding.Hold(*pa, **kwa)

Bases: hio.help.Mine

Hold is Mine subclass that on writes intercepts key and keys and then also saves updates value in durable storage for value object CanDom and Durq serializations

Hold has special item ‘_hold_subery’ whose value is Subery instance or None. Read access is provided via the property .subery

Subery attributes are the subdbs: .cans .dsqs

Hold injects reference to one of these based on the type of value and the Hold key into ._sdb and ._key. When not a durable value then no injection. This allows the value then to read/write to its ._sdb at ._key the fields of the Can when Can or Durq when Durq

Properties:

subery (None|Subery): gets instance from item at '_hold_subery' or None
- inject

injects .cans into val._sdb and key into val._key

update(*pa, **kwa)

Convert keys that are tuples when positional argument is Iterable or Mapping to ‘.’ joined strings

dict __init__ signature options are:

dict(**kwa) dict(mapping, **kwa) dict(iterable, **kwa)

dict.update has same call signature

d.update({“a”: 5, “b”: 2,}, c=3 , d=4)

inject(key, val)

When val is instance of CanDom, injects .tokey(key) into val._key and .subery.cans into val._sdb

Parameters:

key (str): for item
val (Any|CanDom): for item. When instance subclass of CanDom then
    inject to ._key and ._sdb
property subery

Gets value of special item ‘_hold_subery’

Returns:

subery (None|Subery): instance or None