Demonstration website to test the duckdb-wasm WebAssembly (WASM) binary.
This is a simple website to test two things:
- Understanding the syntax for using the duckdb-wasm (WASM) binary, including loading and using the full-text search (FTS) extension.
- Understanding what needs to happen to serve "all" of the assets to do so locally.
"All" is in air-quotes because so far as I understand DuckDB extensions are always loaded over the wire from the DuckDB servers.
This is derived from the plain-html
code in the duckdb-wasm repository.
All of the assets for the website live in the www
directory. You will need to "serve" this directory from a local web server. Everyone has their favourite way to do this. I like to use the fileserver
tool which is part of the aaronland/go-http-fileserver package. For example:
$> fileserver -root ./www/
2025/01/10 15:17:12 Serving ./www/ and listening for requests on http://localhost:8080
Then opening a web browser to http://localhost:8080
you should see something like this:
This will create and index a database table for performing full-text search of flights to and from SFO in January, 2025 using the sfomuseum-data-flights-2025-01.parquet database. Querying the data looks like this:
That's all this website does. As mentioned before it is a "demonstration" website to illustrate how things work and, more importantly, how more sophisticated applications might work.
- All
*.wasm
files are tracked and stored using git lfs. - Remember that the actual DuckDB WASM file is over 30MB so it's probably not something you want to serve in production traffic to the public internet (but if you do, you do).