It's good for single-page applications. Many datasets are relatively small -- pushing them to the client is reasonable. In exchange, you get zero-latency querying and can build very responsive UIs that can use SQL, versus writing REST APIs or GraphQL APIs.
Taken to an extreme, it permits publishing datasets that can be queried with no ongoing server-side expenses.
A wild example: Datasette is a Python service that makes SQLite databases queryable via the web. It turns out that since you can compile Python and SQLite to WASM, you can run Datasette entirely in the user's browser [1]. The startup time is brutal, because it's literally simulating the `pip install`, but a purpose-built SPA wouldn't have this problem.
[1]: https://lite.datasette.io/?url=https%3A%2F%2Fcongress-legisl...
Plenty of interesting databases fit into less than a MB even.
I've been using SQLite in WebAssembly for my Datasette Lite project - a Python server-side web app running entirely in the browser: https://simonwillison.net/2022/May/4/datasette-lite/ - here's an article showing how that can be useful: https://simonwillison.net/2022/Aug/21/scotrail/
It's also available in Observable notebooks, which is really handy. Here's a project I built on top of that: https://simonwillison.net/2022/Nov/20/tracking-mastodon/ - notebook here: https://observablehq.com/@simonw/mastodon-users-and-statuses...
The SQLite team have been working with browser developers to ensure the new API is sufficient to enable all this.
Honestly, and I keep going on about it, SQLite in the browser via WASM is the missing piece to make "offline first" PWAs a serious contender when deciding an architecture for an app.
2023 is going to be the year of SQLite in the browser.
https://webkit.org/blog/12257/the-file-system-access-api-wit...
It's "offline first", not "offline only".
At the moment, as I understand it, the OPFS virtual disk is completely isolated from the users disk.
This means you cannot just lightly query a 1GB file without first copying the 1GB from the users filesystem to the OPFS.
Any writes mean you must then copy the 1GB SQLite db file from OPFS to the users local filesystem too.
Is this correct?
Yeah, it's going to be confusing for users when they want to actually want to use one of these files outside of the application that created it. But it's better than nothing!
Adding those API's to read/write parts of the file is the next logical step. But it looks like it is limited to the isolated OPFS only.