dissect.database.ese.cursor

Module Contents

Classes

Cursor

A simple cursor implementation for searching the ESE indexes.

class dissect.database.ese.cursor.Cursor(index: dissect.database.ese.index.Index)

A simple cursor implementation for searching the ESE indexes.

Parameters:

index – The Index to create the cursor for.

index
table
db
__iter__() collections.abc.Iterator[dissect.database.ese.record.Record]
record() dissect.database.ese.record.Record

Return the record the cursor is currently on.

Returns:

A Record object of the current record.

reset() Self

Reset the internal state.

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 Record object of the next record.

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 Record object of the previous record.

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.

Parameters:
  • *args – The values to generate a key for.

  • **kwargs – The columns and values to generate a key for.

Returns:

The generated key as bytes.

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 reset() to start from the beginning.

Parameters:
  • *args – The values to search for.

  • **kwargs – The columns and values to search for.

Returns:

A Record object of the found record.

search_key(key: bytes, exact: bool = True) dissect.database.ese.record.Record

Search for a record with the given key.

Parameters:
  • key – The key to search for.

  • 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.

seek(*args: dissect.database.ese.util.RecordValue, **kwargs: dissect.database.ese.util.RecordValue) Self

Seek to the record with the given values.

Parameters:
  • *args – The values to seek to.

  • **kwargs – The columns and values to seek to.

seek_key(key: bytes) Self

Seek to the record with the given key.

Parameters:

key – The key to seek to.

find(**kwargs: dissect.database.ese.util.RecordValue) dissect.database.ese.record.Record | None

Find a record in the index.

This differs from search() in that it will allow additional filtering on non-indexed columns.

Parameters:

**kwargs – The columns and values to search for.

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 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.

Parameters:

**kwargs – The columns and values to search for.