Better HN
topnewbestaskshowjobs
Log inSign up

zainab-ali

44 karma · joined Jan 25, 2023 (3y ago) · 5 submissions

Submissions

comment 3y ago · link · parent

Of course! As you’ve found through digging into the js, it uses the official SQLite WASM build. The site currently uses a slightly old vendored version built from the SQLite codebase, but the SQLite team have recently released a binary at https://sqlite.org/download.html (under the WebAssembly section) that anyone can try out. You can find the docs at https://sqlite.org/wasm/doc/trunk/index.md, which have been rapidly improving over the past few months.

The process for building the database is a bit complex. I want to support all browsers, so unfortunately need to use local storage to back it up. Firefox has a while to go before it supports the Origin Private File System, but once it does so the build will be a lot smoother.

I build the index as part of the site’s CI (using nix), by running SQLite-WASM in deno to pre-load local storage. I then extract the keys from local storage and populate them as part of the site load using the hand-rolled load-db.js file.

SQLite WASM does have better support for importing / exporting databases on OPFS, so this process should be simpler as soon as I can move to it.

I’ll write a follow up post at some point on the implementation details.

comment 3y ago · link · parent

For those of you interested in browser-based search with SQLite WASM, I’ve written a small post on the Craft of Emacs search page.You can check out the actual search here: https://craft-of-emacs.kebab-ca.se/search.html

Kudos to the SQLite team. It was a joy to implement.

3.

SQLite WASM: Something subtle in the browser(blog.kebab-ca.se ↗)

90 points · by zainab-ali · 3y ago · 39 comments

comment 3y ago · link · parent

A cross-stitch themed guide to Emacs Lisp, written in Racket.

5.

The Craft of Emacs(craft-of-emacs.kebab-ca.se ↗)

9 points · by zainab-ali · 3y ago · 1 comment