SqliteFile class

Reader for a SQLite file held entirely in memory. Use SqliteFile.fromBytes to construct.

When the database is in WAL journal mode there will be a companion <name>-wal file that may contain newer page versions than the main database. Use SqliteFile.fromBytesWithWal to parse both at once; any page that has a committed WAL frame transparently overrides the version baked into the main file.

Constructors

SqliteFile.fromBytes(Uint8List bytes)
factory
SqliteFile.fromBytesWithWal(Uint8List dbBytes, Uint8List? walBytes)
Parse a database together with its WAL companion. Frames in walBytes are validated by checksum and salt; any committed frames override the pages in dbBytes. If the WAL has no valid commit (or walBytes is null/empty) the result is identical to SqliteFile.fromBytes.
factory

Properties

bytes Uint8List
final
hashCode int
The hash code for this object.
no setterinherited
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

isWithoutRowid(String tableName) bool
True when the table at tableName is stored as a WITHOUT ROWID B-tree (root page is an index page). Returns false for ordinary rowid tables and throws if the table is unknown.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
page(int pageNumber) Uint8List
1-based page accessor. Returns the WAL-overridden version when one exists, otherwise reads the page out of the main file.
readIndex(String indexName) List<List<Object?>>
Read every entry of the named index. Each returned record is the list of key-column values followed by the integer rowid (as SQLite stores it). Entries are returned in B-tree order, which for a well-formed index is ascending key order.
readSchema() List<SqliteSchemaRow>
Read every row of sqlite_schema (page 1).
readTable(String tableName) List<SqliteRow>
Read every row of the named user table. Both rowid tables and WITHOUT ROWID tables are supported. For a rowid table the row's rowid is the primary key alias; for a WITHOUT ROWID table the returned rowid is always 0 (rows are keyed by their own columns).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited