:py:mod:`dissect.database.ese.cursor` ===================================== .. py:module:: dissect.database.ese.cursor Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.database.ese.cursor.Cursor .. py:class:: Cursor(index: dissect.database.ese.index.Index) A simple cursor implementation for searching the ESE indexes. :param index: The :class:`~dissect.database.ese.index.Index` to create the cursor for. .. py:attribute:: index .. py:attribute:: table .. py:attribute:: db .. py:method:: __iter__() -> collections.abc.Iterator[dissect.database.ese.record.Record] .. py:method:: record() -> dissect.database.ese.record.Record Return the record the cursor is currently on. :returns: A :class:`~dissect.database.ese.record.Record` object of the current record. .. py:method:: reset() -> Self Reset the internal state. .. py:method:: next() -> dissect.database.ese.record.Record | None Move the cursor to the next record and return it. Can move the cursor to the next page as a side effect. :returns: A :class:`~dissect.database.ese.record.Record` object of the next record. .. py:method:: prev() -> dissect.database.ese.record.Record | None Move the cursor to the previous node and return it. Can move the cursor to the previous page as a side effect. :returns: A :class:`~dissect.database.ese.record.Record` object of the previous record. .. py:method:: make_key(*args: dissect.database.ese.util.RecordValue, **kwargs: dissect.database.ese.util.RecordValue) -> bytes Generate a key for this index from the given values. :param \*args: The values to generate a key for. :param \*\*kwargs: The columns and values to generate a key for. :returns: The generated key as bytes. .. py:method:: search(*args: dissect.database.ese.util.RecordValue, **kwargs: dissect.database.ese.util.RecordValue) -> dissect.database.ese.record.Record Search the index for the requested values. Searching modifies the cursor state. Searching again will search from the current position. Reset the cursor with :meth:`reset` to start from the beginning. :param \*args: The values to search for. :param \*\*kwargs: The columns and values to search for. :returns: A :class:`~dissect.database.ese.record.Record` object of the found record. .. py:method:: search_key(key: bytes, exact: bool = True) -> dissect.database.ese.record.Record Search for a record with the given ``key``. :param key: The key to search for. :param exact: If ``True``, search for an exact match. If ``False``, sets the cursor on the next record that is greater than or equal to the key. .. py:method:: seek(*args: dissect.database.ese.util.RecordValue, **kwargs: dissect.database.ese.util.RecordValue) -> Self Seek to the record with the given values. :param \*args: The values to seek to. :param \*\*kwargs: The columns and values to seek to. .. py:method:: seek_key(key: bytes) -> Self Seek to the record with the given ``key``. :param key: The key to seek to. .. py:method:: find(**kwargs: dissect.database.ese.util.RecordValue) -> dissect.database.ese.record.Record | None Find a record in the index. This differs from :meth:`search` in that it will allow additional filtering on non-indexed columns. :param \*\*kwargs: The columns and values to search for. .. py:method:: find_all(**kwargs: dissect.database.ese.util.RecordValue) -> collections.abc.Iterator[dissect.database.ese.record.Record] Find all records in the index that match the given values. This differs from :meth:`search` in that it will allows additional filtering on non-indexed columns. If you only search on indexed columns, this will yield all records that match the indexed columns. :param \*\*kwargs: The columns and values to search for.