DEV Community

Cover image for Stop uploading your DBs! View SQLite files 100% locally with WASM
HollyGG
HollyGG

Posted on • Originally published at knothing.com

Stop uploading your DBs! View SQLite files 100% locally with WASM

πŸ›‘ Stop uploading your DBs! View SQLite files 100% locally with WASM

The Problem: "Please upload your .db file" ... Ummm, No. πŸ™…β€β™‚οΈ

Last week, I needed to debug a strange issue with a user's local SQLite database. They sent me the .db file (with permission, of course). I just needed to run a quick SELECT * FROM users WHERE id=... to check a flag.

I didn't want to spin up a whole DBeaver instance or write a Python script just for a 30-second check. So, like any lazy developer, I Googled "Online SQLite Viewer".

The results? A minefield. πŸ’£

"Upload your file to view it!"
"Server processing..."
"Wait for upload..."

Absolutely not.

This was production data. I am not uploading a user's database to some random server in who-knows-where. Even if they promise "we delete it after," I can't take that risk.

I realized there was a gap. Why does viewing a local file require a server round-trip in 2025? Browsers are powerful enough to run Doom; surely they can read a SQLite file?

The Tech Stack: WebAssembly to the Rescue πŸ¦Έβ€β™‚οΈ

I decided to build my own. No servers. No uploads. Just pure client-side power.

Here is the stack I chose:

  • ⚑ Nuxt 3: For that sweet, sweet Developer Experience (DX) and auto-imports.
  • 🎨 Tailwind CSS: Because I want it to look good without fighting CSS.
  • πŸ¦€ sqlite-wasm: The magic sauce. This is the official WebAssembly build of SQLite. It allows us to run a full SQLite engine inside the browser tab.

The Solution: KNothing SQLite Viewer πŸ› οΈ

After a weekend of coding and caffeinating, I deployed KNothing SQLite Viewer.

Here is why it's different:

1. It runs in your RAM 🧠

When you "open" a file, it's not verified or sent anywhere. The browser reads the file buffer and passes it directly to the WASM instance in memory. If you open the Network tab in DevTools, you will see zero requests sending your DB file.

2. It pulls the plug on the internet πŸ”Œ

Don't believe me? Load the page, then turn off your Wi-Fi.
Now try to open a file and run a query. It still works.
It's a PWA (Progressive Web App), so it's fully functional offline.

3. Full SQL Power ⚑

It's not just a read-only list. You can run:

SELECT * FROM orders 
WHERE total > 100 
ORDER BY created_at DESC;
Enter fullscreen mode Exit fullscreen mode

It supports whatever the standard SQLite engine supports.

Try it out! πŸš€

I made this tool free and open for everyone. No ads, no tracking, no nonsense.

πŸ‘‰ Try the Offline SQLite Viewer

It's open source-ish (I'm cleaning up the repo to share soon).

Let me know what you think! Does it handle your 1GB+ files? (It depends on your RAM, but I've tested it up to 500MB comfortably).

Happy (Secure) Coding! πŸ”’

Top comments (0)