:py:mod:`dissect.database.ese.table` ==================================== .. py:module:: dissect.database.ese.table Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.database.ese.table.Table dissect.database.ese.table.Column dissect.database.ese.table.Catalog .. py:class:: Table(db: dissect.database.ese.ese.ESE, name: str, root_page: int, columns: list[Column] | None = None, indexes: list[dissect.database.ese.index.Index] | None = None, record: dissect.database.ese.record.Record = None) Represents a table in an ESE database. Contains all the relevant metadata of the table, as well as all columns and indices that have been added by the catalog. :param db: An instance of :class:`~dissect.database.ese.ese.ESE`. :param name: The table name. :param root_page: The root page of the table. :param columns: A list of :class:`Column` for this table. :param indexes: A list of :class:`~dissect.database.ese.index.Index` for this table. :param record: The :class:`~dissect.database.ese.record.Record` of this table from the catalog table. .. py:attribute:: db .. py:attribute:: name .. py:attribute:: root_page .. py:attribute:: columns :type: list[Column] :value: [] .. py:attribute:: indexes :type: list[dissect.database.ese.index.Index] :value: [] .. py:attribute:: record :value: None .. py:method:: __repr__() -> str .. py:property:: root :type: dissect.database.ese.page.Page Return the root page of the table. .. py:property:: lv_page :type: dissect.database.ese.page.Page Return the long value page of the table. :raises TypeError: If the table has no long values. .. py:method:: column(name: str) -> Column Return the column with the given name. :param name: The name of the column to return. :raises KeyError: If no column with the given name exists. .. py:property:: column_names :type: list[str] Return a list of all the column names. .. py:property:: primary_index :type: dissect.database.ese.index.Index | None .. py:method:: cursor() -> dissect.database.ese.cursor.Cursor | None Create a new cursor for this table. .. py:method:: index(name: str) -> dissect.database.ese.index.Index Return the index with the given ``name``. :param name: The name of the index to return. :raises KeyError: If no index with the given name exists. .. py:method:: find_index(column_names: list[str]) -> dissect.database.ese.index.Index | None Find the most suitable index to search for the given columns. :param column_names: A list of column names to find the best index for. .. py:method:: search(**kwargs: dissect.database.ese.util.RecordValue) -> dissect.database.ese.record.Record | None Search for a record in the table. :param \*\*kwargs: The columns and values to search for. :returns: The first record that matches the search criteria, or ``None`` if no record was found. .. py:method:: records() -> collections.abc.Iterator[dissect.database.ese.record.Record] Return an iterator of all the records of the table. .. py:method:: get_long_value(key: bytes) -> bytes Retrieve a value from the long value page of the table. :param key: The lookup key for the long value. .. py:class:: Column(identifier: int, name: str, type: dissect.database.ese.c_ese.JET_coltyp, flags: dissect.database.ese.c_ese.FIELDFLAG, record: dissect.database.ese.record.Record | None = None) .. py:attribute:: identifier .. py:attribute:: name .. py:attribute:: type .. py:attribute:: flags .. py:attribute:: record :value: None .. py:method:: __repr__() -> str .. py:property:: offset :type: int .. py:property:: is_fixed :type: bool .. py:property:: is_variable :type: bool .. py:property:: is_tagged :type: bool .. py:property:: is_text :type: bool .. py:property:: is_binary :type: bool .. py:property:: is_multivalue :type: bool .. py:property:: size :type: int .. py:property:: default :type: Any | None .. py:property:: encoding :type: dissect.database.ese.c_ese.CODEPAGE | None .. py:property:: ctype :type: dissect.database.ese.util.ColumnType .. py:class:: Catalog(db: dissect.database.ese.ese.ESE, root_page: dissect.database.ese.page.Page) Parse and interact with the catalog table. The catalog is a special table that contains the metadata for all the other tables in the database. :param db: An instance of :class:`~dissect.database.ese.ese.ESE`. :param root_page: The root page of the catalog table. .. py:attribute:: CATALOG_COLUMNS .. py:attribute:: db .. py:attribute:: root_page .. py:attribute:: tables :value: [] .. py:method:: table(name: str) -> Table Retrieve the table with the given name. :param name: The table to retrieve. :raises KeyError: If no table with that name exists.