dissect.database.sqlite3.wal

Module Contents

Classes

WAL

Frame

Checkpoint

A checkpoint is an operation that transfers all committed transactions from

Commit

A commit is a collection of frames that were committed together.

Functions

Attributes

dissect.database.sqlite3.wal.log
dissect.database.sqlite3.wal.WAL_HEADER_MAGIC_LE = 931071618
dissect.database.sqlite3.wal.WAL_HEADER_MAGIC_BE = 931071619
dissect.database.sqlite3.wal.WAL_HEADER_MAGIC
class dissect.database.sqlite3.wal.WAL(fh: pathlib.Path | BinaryIO)
fh
path
header
checksum_endian = '<'
highest_page_num
frame
close() None

Close the WAL.

frames() collections.abc.Iterator[Frame]
property commits: list[Commit]

Return all commits in the WAL file.

Commits are frames where header.page_count specifies the size of the database file in pages after the commit. For all other frames it is 0.

References

property checkpoints: list[Checkpoint]

Return deduplicated checkpoints, oldest first.

Deduplicate commits by the salt1 value of their first frame. Later commits overwrite earlier ones so the returned list contains the most recent commit for each salt1, sorted ascending.

References

class dissect.database.sqlite3.wal.Frame(wal: WAL, offset: int)
wal
offset
fh
header
__repr__() str
property valid: bool
property data: bytes
property page_number: int
property page_count: int
class dissect.database.sqlite3.wal.Checkpoint(wal: WAL, frames: list[Frame])

Bases: _FrameCollection

A checkpoint is an operation that transfers all committed transactions from the WAL file back into the main database file.

References

class dissect.database.sqlite3.wal.Commit(wal: WAL, frames: list[Frame])

Bases: _FrameCollection

A commit is a collection of frames that were committed together.

References

dissect.database.sqlite3.wal.checksum(buf: bytes, endian: str = '>') tuple[int, int]