zlmdb._database¶
Attributes¶
Classes¶
Internal zLMDB configuration element base type. |
|
ZLMDB database access. |
|
Internal zLMDB database slot configuration element. |
Functions¶
|
Module Contents¶
- class ConfigurationElement(oid: uuid.UUID | None = None, name: str | None = None, description: str | None = None, tags: List[str] | None = None)[source]¶
Bases:
objectInternal zLMDB configuration element base type.
- static parse(value: Dict[str, Any]) ConfigurationElement[source]¶
- class Database(dbpath: str | None = None, maxsize: int = 10485760, readonly: bool = False, lock: bool = True, sync: bool = True, create: bool = True, open_now: bool = True, writemap: bool = False, context: Any = None, log: txaio.interfaces.ILogger | None = None)[source]¶
Bases:
objectZLMDB database access.
Objects of this class are generally “light-weight” (cheap to create and destroy), but do manage internal resource such as file descriptors.
To manage these resources in a robust way, this class implements the Python context manager interface.
- __enter__()[source]¶
Enter database runtime context and open the underlying LMDB database environment.
Note
Enter the runtime context related to this object. The with statement will bind this method’s return value to the target(s) specified in the as clause of the statement, if any. [Source](https://docs.python.org/3/reference/datamodel.html#object.__enter__)
Note
A context manager is an object that defines the runtime context to be established when executing a with statement. The context manager handles the entry into, and the exit from, the desired runtime context for the execution of the block of code. Context managers are normally invoked using the with statement (described in section The with statement), but can also be used by directly invoking their methods.” [Source](https://docs.python.org/3/reference/datamodel.html#with-statement-context-managers)
- Returns:
This database instance (in open state).
- __exit__(exc_type, exc_value, traceback)[source]¶
Exit runtime context and close the underlying LMDB database environment.
Note
Exit the runtime context related to this object. The parameters describe the exception that caused the context to be exited. If the context was exited without an exception, all three arguments will be None. [Source](https://docs.python.org/3/reference/datamodel.html#object.__exit__).
- Parameters:
exc_type
exc_value
traceback
- Returns:
- __slots__ = ('log', '_is_temp', '_tempdir', '_dbpath', '_maxsize', '_readonly', '_lock', '_sync', '_create',...[source]¶
- _attach_slot(oid: uuid.UUID, klass: Type[zlmdb._pmap.PersistentMap], marshal: Callable | None = None, parse: Callable | None = None, build: Callable | None = None, cast: Callable | None = None, compress: int | None = None, create: bool = True, name: str | None = None, description: str | None = None)[source]¶
- Parameters:
oid
klass
marshal
parse
build
cast
compress
create
name
description
- Returns:
- attach_table(klass: Type[zlmdb._pmap.PersistentMap])[source]¶
- Parameters:
klass
- Returns:
- begin(write: bool = False, buffers: bool = False, stats: zlmdb._transaction.TransactionStats | None = None) zlmdb._transaction.Transaction[source]¶
- Parameters:
write
buffers
stats
- Returns: