:py:mod:`dissect.database.ese.index` ==================================== .. py:module:: dissect.database.ese.index Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.database.ese.index.Index Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: dissect.database.ese.index.encode_key Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.database.ese.index.JET_cbKeyMost_OLD dissect.database.ese.index.bPrefixNull dissect.database.ese.index.bPrefixZeroLength dissect.database.ese.index.bPrefixNullHigh dissect.database.ese.index.bPrefixData dissect.database.ese.index.bSentinel .. py:data:: JET_cbKeyMost_OLD :value: 255 .. py:class:: Index(table: dissect.database.ese.table.Table, record: dissect.database.ese.record.Record | None = None) Represents an index on a table. This is still very much WIP but works for basic indexes. For example, none of the special flags are currently implemented. :param table: The table this index is from. :param record: The record in the catalog for this index. .. py:attribute:: table .. py:attribute:: record :value: None .. py:attribute:: db .. py:attribute:: name .. py:attribute:: idb_flags .. py:attribute:: idx_flags .. py:method:: __repr__() -> str .. py:property:: is_primary :type: bool .. py:property:: root :type: dissect.database.ese.page.Page Return the root page of this index. .. py:property:: column_ids :type: list[int] Return a list of column IDs that are used in this index. .. py:property:: columns :type: list[dissect.database.ese.table.Column] Return a list of all columns that are used in this index. .. py:method:: cursor() -> dissect.database.ese.cursor.Cursor Create a new cursor for this index. .. py:method:: search(*args, **kwargs) -> dissect.database.ese.record.Record Search the index for the requested values. :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) -> dissect.database.ese.page.Node Search the index for a specific ``key``. :param key: The key to search for. :returns: A :class:`~dissect.database.ese.page.Node` object of the found node. .. py:method:: key_from_record(record: dissect.database.ese.record.Record) -> bytes Generate a key for this index from a record. :param record: The record to generate a key for. .. py:method:: make_key(values: list[dissect.database.ese.util.RecordValue] | dict[str, dissect.database.ese.util.RecordValue]) -> bytes Generate a key out of the given values. :param values: A map of the column names and values to generate a key for, or a list of values in the order of the index columns. .. py:data:: bPrefixNull :value: 0 .. py:data:: bPrefixZeroLength :value: 64 .. py:data:: bPrefixNullHigh :value: 192 .. py:data:: bPrefixData :value: 127 .. py:data:: bSentinel :value: 255 .. py:function:: encode_key(index: Index, column: dissect.database.ese.table.Column, value: dissect.database.ese.util.RecordValue, max_size: int) -> bytes Encode various values into their normalized index key form. :param column: The column of the value to encode. :param value: The value that needs encoding. :param max_size: The maximum key segment size.