bento_meta.mdb.writeable ======================== .. py:module:: bento_meta.mdb.writeable .. autoapi-nested-parse:: mdb.writeable: subclass of `class:bento_meta.MDB` to support writing to an MDB Attributes ---------- .. autoapisummary:: bento_meta.mdb.writeable.P Classes ------- .. autoapisummary:: bento_meta.mdb.writeable.WriteableMDB Functions --------- .. autoapisummary:: bento_meta.mdb.writeable.write_txn Module Contents --------------- .. py:data:: P .. py:function:: write_txn(func: collections.abc.Callable[Concatenate[WriteableMDB, P], tuple[str, dict[str, Any] | None]]) -> collections.abc.Callable[Concatenate[WriteableMDB, P], list[neo4j.Record]] Decorate a query function to run a write transaction based on its query. Query function should return a tuple (qry_string, param_dict). :param func: The query function to decorate. :returns: Decorated function that executes a write transaction. .. py:class:: WriteableMDB(uri: str | None = None, user: str | None = None, password: str | None = None) Bases: :py:obj:`bento_meta.mdb.mdb.MDB` :class:`bento_meta.mdb.MDB` subclass for writing to an MDB. .. py:method:: put_with_statement(qry: str, parms: dict[str, Any] | None = None) -> list[neo4j.Record] Run an arbitrary write statement. .. py:method:: put_term_with_origin(term: bento_meta.objects.Term, commit: str = '', _from: int = 1) -> list[neo4j.Record] Merge a bento-meta Term object, that has an Origin object set into an MDB. If a new term is created, assign a random 6-char nanoid to it. The Origin must already be represented in the database. :param term: Term object to merge. :param commit: GitHub commit SHA1 associated with the term (if any). :param _from: Source identifier. :returns: List of Records from the transaction.