pub enum Error {
TooShort,
BadMagic,
BadPageSize(u32),
PageOutOfRange(u32),
NotATablePage(u8),
TruncatedCell,
TooManyPages,
MalformedFreelist,
MalformedOverflow,
BadJournalPageSize(u32),
JournalModeConflict,
Io(ErrorKind),
}Expand description
Errors that can arise while reading a SQLite database, all recoverable —
the reader never panics on malformed input.
Variants§
TooShort
File is shorter than the 100-byte header.
BadMagic
First 16 bytes are not the SQLite format 3\0 magic.
BadPageSize(u32)
Page-size field is not a power of two in [512, 65536].
PageOutOfRange(u32)
A page number referenced by the b-tree is out of range for the file.
NotATablePage(u8)
A b-tree page had an unexpected type byte where a table page was required.
TruncatedCell
A cell pointer or payload ran past the end of its page.
TooManyPages
The b-tree was deeper / wider than the safety cap allows.
MalformedFreelist
The freelist trunk chain cycled or exceeded the file’s page count.
MalformedOverflow
An overflow-page chain cycled or exceeded the file’s page count.
BadJournalPageSize(u32)
A rollback-journal page size was not a power of two in [512, 65536].
Carries the offending value (Show-the-unrecognized-value).
JournalModeConflict
A rollback journal was applied to a database opened WAL-applied, or whose page size disagrees with the journal’s. WAL and rollback-journal modes are mutually exclusive timelines and must not be overlaid.
Io(ErrorKind)
The file could not be opened or read (an I/O failure via
Database::open_path, not a malformed database). Carries the
std::io::ErrorKind (show-the-unrecognized-value).