←back to thread

SQLite File Format Viewer

(sqlite-internal.pages.dev)
272 points ilumanty | 2 comments | | HN request time: 0.418s | source
Show context
jchw ◴[] No.43684392[source]
This really would've come in handy when I was debugging my own SQLite parser a couple weeks ago.

One thing that initially confused me was how exactly the pages worked w.r.t. the first page on disk... I misunderstood the SQLite documentation in different ways, but it's really rather simple: the very first page is just treated as containing the file header in it, and it pushes down the rest of the data, making the page shorter than the other pages. You can see that illustrated clearly if you click into the first page of a database using this tool: the database header comes first, then the page header.

This tool will undoubtedly come in handy for anyone who has a reason to be dealing with SQLite data structures directly for whatever reason, especially since the SQLite documentation is a bit terse at times.

replies(3): >>43684613 #>>43688207 #>>43692316 #
hinkley ◴[] No.43684613[source]
I really want a data format that is effectively binary JSON. What is the subset of all of the features of SQLite that makes either a read-only or an updatable data set that is compact. But better searchability than a streaming parser.
replies(6): >>43684710 #>>43685626 #>>43685952 #>>43687507 #>>43688023 #>>43690668 #
1. 79a6ed87 ◴[] No.43688023[source]
Have you tried MessagePack[0]?

0: https://msgpack.org/index.html

replies(1): >>43697567 #
2. hinkley ◴[] No.43697567[source]
I would probably just use bson or gRPC. As o clarified elsewhere, I means JSON as an analogy. I want something that can be scanned and queried cheaply.