Pure MoonBit read-only SQLite file format parser and inspector
git clone https://github.com/prowk/MoonSQLiteFile.git
cd MoonSQLiteFile
moon build --target js cmd/inspect
node tools/inspect.cjs fixtures/core.sqlite header
node tools/inspect.cjs fixtures/core.sqlite schema
node tools/inspect.cjs fixtures/core.sqlite page 3
node tools/inspect.cjs fixtures/core.sqlite rows samples
node tools/inspect.cjs fixtures/core.sqlite rows branches 5
node tools/inspect.cjs fixtures/core.sqlite freelistimport {
"prowk/moonsqlitefile" @sqlite,
}fn inspect(data : Bytes) -> Array[@sqlite.Row] raise @sqlite.SqliteError {
let db = @sqlite.open_database(data)
db.table_rows("samples", limit=10)
}moon run --target js examples/basicmoon check --target all --deny-warn
moon build --target all --deny-warn
moon test --target all --deny-warn
moon fmt --check
python tools/generate_fixtures.py --check
python tools/verify_oracle.pypub(all) struct Header {
page_size : Int
usable_size : Int
write_version : Int
read_version : Int
change_counter : UInt
declared_pages : UInt
freelist_trunk : UInt
freelist_pages : UInt
schema_cookie : UInt
schema_format : Int
text_encoding : Int
user_version : UInt
application_id : UInt
version_valid_for : UInt
sqlite_version : UInt
} derive(Eq, Debug)pub(all) struct Limits {
max_rows : Int
max_payload_bytes : Int
max_pages : Int
max_depth : Int
} derive(Debug)pub(all) struct SchemaEntry {
object_type : String
name : String
table_name : String
root_page : Int
sql : String?
} derive(Debug)Install
Download zipPure MoonBit read-only SQLite file format parser and inspector