Day: 2021年7月5日

静态网站如何启用数据库查询

作者演示静态网站(比如 GitHub Pages)如何通过 SQLite 数据库,实现查询功能,完全不需要后台脚本。

这种操作的实现原理有两个:一是 SQLite 数据库以页为单位存储数据,每页默认是 4KB,可以按页读取数据;二是前端可以用 sql.js 模拟一个内存文件系统,从而实现按页读取文件。

I was writing a tiny website to display statistics of how much sponsored content a Youtube creator has over time when I noticed that I often write a small