"Hosting SQLite databases on Github Pages" is absolutely brilliant: it adds a virtual filesystem to SQLite-compiled-to-WebAssembly in order to fetch pages from the database using HTTP range requests phiresky.github.io/blog/2021…
Check out this demo: I run the SQL query "select country_code, long_name from wdi_country order by rowid desc limit 100" and it fetches just 54.2KB of new data (across 49 small HTTP requests) to return 100 results - from a statically hosted database file that's 668.8MB!
May 2, 2021 · 7:09 PM UTC
Looks like the core magic here is only around 300 lines of (devastatingly clever) code github.com/phiresky/sql.js-h…
phiresky points out that my "order by row id desc" demo is actually a worst case scenario - if you try the same thing without the desc it only takes 6 requests!
select country_code, long_name from wdi_country
order by rowid limit 100
news.ycombinator.com/item?id…
Here's an application of this technique at a much larger scale: static.wiki runs HTTP range requests against a 43GB SQLite database on S3 to provide search-by-title and display of Wikipedia articles