OmniSelect FileSQL

Guides
← Back to App
Home › Guides › Reading MessagePack files with SQL

Read MessagePack Files With SQL, No Code

MessagePack is what a lot of APIs, message queues and mobile apps send instead of JSON: the same nested objects and arrays, packed into fewer bytes, with no text to read. A cache dump, a queued job, a logged webhook payload — all show up as a .msgpack or .mpk file that nothing renders without a decoder. This is how to query one directly.

Why It Looks Opaque

Open a .msgpack file in a text editor and it is mostly unprintable bytes: every string is prefixed with a length instead of being quoted, and numbers are packed to the byte rather than written as digits. That compactness is the point — it is faster to parse and smaller on the wire than JSON — but it means a person can no longer just look.

Doing It in the Browser

OmniSelect FileSQL decodes MessagePack with the reference @msgpack/msgpack library, inside your browser tab. Nothing is uploaded.

  1. Open the app.
  2. Drop the file onto the File Select panel. telemetry.msgpack becomes a table named T, shown in the Alias column.
  3. Look at it.
    SELECT * FROM T LIMIT 100
event_iddevice_idkindrecorded_atmetrics_temp_cmetrics_humiditytags
19007199254740993reading2026-02-01 06:00:0018.441line-1,ok
29007199254740993reading2026-02-01 07:00:0019.140line-1,ok
34823009184620001alert2026-02-01 07:05:0031.622line-2,over-temp
44823009184620001reading2026-02-01 08:00:0020.239line-2,ok
59007199254740993reading2026-02-01 08:00:0018.942line-1,ok

Look closely at device_id: both values are encoded the same way, as MessagePack's 64-bit integer type, but they don't come back the same way.

Two more things happened without being asked: the nested metrics object flattened into metrics_temp_c and metrics_humidity, and recorded_at — MessagePack's own timestamp extension type, not a string — arrived as a real timestamp.

Filtering and Joining

Ordinary SQL from here. Just the alerts:

SELECT * FROM T WHERE kind = 'alert'

A second file, lines.msgpack (table L), maps each device to a plant. Because both files kept the big id as the same text, it joins correctly — a plain SUM or an equality join on a large 64-bit id is exactly the case a lossy converter would quietly break:

SELECT L.plant, COUNT(*) AS readings, ROUND(AVG(T.metrics_temp_c), 1) AS avg_temp_c
FROM T
JOIN L ON T.device_id = L.device_id
GROUP BY L.plant
ORDER BY avg_temp_c DESC
plantreadingsavg_temp_c
Bristol225.9
Leeds318.7

Drop a .msgpack file in and see inside it.

Open the app →

Either Shape MessagePack Comes In

A .msgpack file is read one of two ways, and both are handled without you choosing:

Nested objects and arrays flatten the same way as JSON — see one query across seven file formats for how a deeper structure turns into columns.

What's Not Supported

Reasonable Questions

What about a .mpk extension?

Same format, same reader — .msgpack and .mpk are both accepted.

Why not just convert it to JSON first?

You can, but converting loses exactly the thing this guide is about: a 64-bit id or timestamp that MessagePack stores precisely can get rounded the moment a converter turns it into a JSON number. Reading the .msgpack directly keeps it exact.

Does anything leave my machine?

No. The MessagePack reader runs in the tab, and after the page has loaded it makes no network requests — here is how to check.

Related Guides