Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
asg017 committed Jul 17, 2023
1 parent a22f96f commit 1d92a7b
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: ./configure && make

# TODO how cache this?
- run: sudo apt-get install -y cmake libgomp1
- run: sudo apt-get update -y && sudo apt-get install -y cmake libgomp1
- run: make loadable-release static-release
- uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -361,4 +361,4 @@ jobs:
- run: cargo publish --no-verify
working-directory: ./bindings/rust
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
2 changes: 1 addition & 1 deletion bindings/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions site/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ create virtual table vss_demo using vss0(

Notice the `2` declaration in the `a` column definition. This is a required argument that tells `sqlite-vss` how many dimensions our vectors have. Also note that prefixing the virtual table name with `vss_` is a convention but not required.

Now we have an empty `vss_demo`. Let's insert our vectors!
Let's insert our vectors!

```sqlite
insert into vss_demo(rowid, a)
Expand All @@ -99,7 +99,7 @@ insert into vss_demo(rowid, a)
');
```

Here we are using [SQLite's builting JSON support](https://www.sqlite.org/json1.html) to define our vector data in a JSON string. `sqlite-vss` supports reading vectors and JSON in a few different formats, which you [can learn more about here](api-reference#inserting-data).
Here we are using [SQLite's builting JSON support](https://www.sqlite.org/json1.html) to define our vector data in a JSON string. `sqlite-vss` supports vectors in a few different formats, which you [can learn more about here](api-reference#inserting-data).

<p align="center"> <img src="./demo_q1.png" width="75%"> </p>

Expand All @@ -111,7 +111,6 @@ select
from vss_lookup
where vss_search(a, json('[2.0, 2.0]'))
limit 3;
```

```
Expand Down
6 changes: 3 additions & 3 deletions site/using/datasette.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

[![Datasette](https://img.shields.io/pypi/v/datasette-sqlite-vss.svg?color=B6B6D9&label=Datasette+plugin&logoColor=white&logo=python)](https://datasette.io/plugins/datasette-sqlite-vss)

`sqlite-vss` is also distributed as a [Datasette plugin](https://docs.datasette.io/en/stable/plugins.html) in the form of [`datasette-sqlite-vss`](https://pypi.org/project/datasette-sqlite-vss/), which can be installed like so:
`sqlite-vss` is also distributed as a [Datasette plugin](https://docs.datasette.io/en/stable/plugins.html) with [`datasette-sqlite-vss`](https://pypi.org/project/datasette-sqlite-vss/), which can be installed like so:

```bash
datasette install datasette-sqlite-vss
```

`datasette-sqlite-vss` is just a PyPi package and can also be installed with `pip`, but `datasette install` will ensure it's downloaded in the same Python environment as your Datasette installation, and will automatically include `sqlite-vss` in future Datasette instances.
`datasette-sqlite-vss` is just a PyPi package and can also be installed with `pip`. However, `datasette install` ensures that the plugin will be downloaded in the same Python environment as your Datasette installation, and will automatically include `sqlite-vss` in future Datasette instances.

If you're using the `datasette publish` command, you can [use the `--install` flag](https://docs.datasette.io/en/stable/plugins.html#deploying-plugins-using-datasette-publish) to include `datasette-sqlite-vss` in your Datasette projects.
If you're using the [`datasette publish`](https://docs.datasette.io/en/stable/publish.html) command, you can [use the `--install` flag](https://docs.datasette.io/en/stable/plugins.html#deploying-plugins-using-datasette-publish) to include `datasette-sqlite-vss` in your Datasette projects.

```bash
datasette publish cloudrun data.db \
Expand Down
2 changes: 1 addition & 1 deletion site/using/deno.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ stmt.run(JSON.stringify(embedding));

### Vectors as Bytes

Alternatively, if your vectors in Node.js are represented as a [Float32Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array), you can access the [`.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) accessor to insert the underlying ArrayBuffer.
Alternatively, if your vectors in Node.js are represented as a [Float32Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array), use the [`.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) accessor to insert the underlying ArrayBuffer.

```js
const embedding = new Float32Array([0.1, 0.2, 0.3]);
Expand Down
12 changes: 10 additions & 2 deletions site/using/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
The Go bindings for `sqlite-vss` are still in beta and are subject to change. If you come across problems, [please comment on the Go tracking issue](https://github.com/asg017/sqlite-vss/issues/49).
:::

1. binary struct pack

## Installing `sqlite-vss` into Go Projects

The official `sqlite-vss` Go bindings can be installed like so:

```
go get -u github.com/asg017/sqlite-vss/bindings/go
```

You are required to provide pre-compiled static library files of `sqlite-vss`. You can do this by compiling `sqlite-vss` yourself, or [from a Github Release](https://github.com/asg017/sqlite-vss/releases).

Once you have a directory with the pre-compiled static library files, you

## Working with Vectors in Go

If your vectors in Go are represented as a slice of floats, you can insert them into a `vss0` table as a JSON string with [`json.Marshal`](https://pkg.go.dev/encoding/json#Marshal):
Expand Down
2 changes: 1 addition & 1 deletion site/using/nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ stmt.run(JSON.stringify(embedding));

### Vectors as Bytes

Alternatively, if your vectors in Node.js are represented as a [Float32Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array), you can access the [`.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) accessor to insert the underlying ArrayBuffer.
Alternatively, if your vectors in Node.js are represented as a [Float32Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array), use the [`.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) accessor to insert the underlying ArrayBuffer.

```js
const embedding = new Float32Array([0.1, 0.2, 0.3]);
Expand Down

0 comments on commit 1d92a7b

Please sign in to comment.