Skip to content

Demonstration website to test the duckdb-wasm WebAssembly (WASM) binary.

License

Notifications You must be signed in to change notification settings

sfomuseum/www-duckdb-wasm-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

www-duckdb-wasm-local

Demonstration website to test the duckdb-wasm WebAssembly (WASM) binary.

Description

This is a simple website to test two things:

  1. Understanding the syntax for using the duckdb-wasm (WASM) binary, including loading and using the full-text search (FTS) extension.
  2. 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.

Example (basic)

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.

Notes

  • 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).

See also

About

Demonstration website to test the duckdb-wasm WebAssembly (WASM) binary.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published