This commit is contained in:
Alex Garcia 2024-08-01 02:45:36 -07:00
parent 5be4c980ca
commit 09c3f05759
12 changed files with 120 additions and 47 deletions

View file

@ -1,5 +1,7 @@
# `sqlite-vec` in the Browser with WebAssembly
`sqlite-vec` can be statically compiled into [official SQLite WASM](https://sqlite.org/wasm/doc/trunk/index.md) builds. The process is a bit complicated, but the result is a vector search in the browser, which is pretty cool!
```html
<html>
<body>
@ -15,3 +17,16 @@
</body>
</html>
```
[*Open in CodePen*](https://codepen.io/asg017_ucsd/pen/MWMpJNY)
It's not possibly to dynamically load a SQLite extension into a WASM build of SQLite. So `sqlite-vec` must be statically compiled into custom WASM builds.
## The `sqlite-vec-wasm-demo` NPM package
A **demonstration** of `sqlite-vec` in WASM is provided with the `sqlite-vec-wasm-demo` NPM package. This package is a demonstration and may change at any time. It doesn't follow the [Semantic version of `sqlite-vec`](../versioning.md).
See
[`simple-wasm/index.html`](https://github.com/asg017/sqlite-vec/blob/main/examples/simple-wasm/index.html)
for a more complete WASM demo using this package.