Merge branch 'main' of github.com:asg017/sqlite-vec into main

This commit is contained in:
Alex Garcia 2024-08-05 16:04:13 -07:00
commit 9f14143e7b
3 changed files with 9 additions and 6 deletions

View file

@ -33,7 +33,7 @@ anywhere! A successor to [`sqlite-vss`](https://github.com/asg017/sqlite-vss)
<a href="https://hacks.mozilla.org/2024/06/sponsoring-sqlite-vec-to-enable-more-powerful-local-ai-applications/">Mozilla Builders project</a>, <a href="https://hacks.mozilla.org/2024/06/sponsoring-sqlite-vec-to-enable-more-powerful-local-ai-applications/">Mozilla Builders project</a>,
with additional sponsorship from with additional sponsorship from
<a href="https://fly.io/"><img width=14px src="./.github/logos/flyio.small.ico"/> Fly.io </a>, <a href="https://fly.io/"><img width=14px src="./.github/logos/flyio.small.ico"/> Fly.io </a>,
<a href="https://turso.tech/"><img width=14px src="./.github/logos/turso.small.ico"/> Turso</a>, and <a href="https://tur.so/sqlite-vec"><img width=14px src="./.github/logos/turso.small.ico"/> Turso</a>, and
<a href="https://sqlitecloud.io/"><img width=14px src="./.github/logos/sqlitecloud.small.svg"/> SQLite Cloud</a>. <a href="https://sqlitecloud.io/"><img width=14px src="./.github/logos/sqlitecloud.small.svg"/> SQLite Cloud</a>.
See <a href="#sponsors">the Sponsors section</a> for more details. See <a href="#sponsors">the Sponsors section</a> for more details.
</i> </i>
@ -117,7 +117,7 @@ is the main sponsor through the new Builders project.
</picture> </picture>
</a> </a>
<a href="https://turso.tech/"> <a href="https://tur.so/sqlite-vec">
<picture> <picture>
<source media="(prefers-color-scheme: dark)" srcset="./.github/logos/turso.svg"> <source media="(prefers-color-scheme: dark)" srcset="./.github/logos/turso.svg">
<source media="(prefers-color-scheme: light)" srcset="./.github/logos/turso.svg"> <source media="(prefers-color-scheme: light)" srcset="./.github/logos/turso.svg">

View file

@ -109,5 +109,8 @@ v, err := sqlite_vec.SerializeFloat32(values)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
stmt.BindInt(1, id) _, err = db.Exec("INSERT INTO vec_items(rowid, embedding) VALUES (?, ?)", id, v)
if err != nil {
log.Fatal(err)
}
``` ```

View file

@ -2074,7 +2074,7 @@ int parse_vector_column(const char *source, int source_length,
// any other tokens left should be column-level options , ex `key=value` // any other tokens left should be column-level options , ex `key=value`
// ex `distance_metric=L2 distance_metric=cosine` should error // ex `distance_metric=L2 distance_metric=cosine` should error
while (1) { while (1) {
// should be EOF or identifer (option key) // should be EOF or identifier (option key)
rc = vec0_scanner_next(&scanner, &token); rc = vec0_scanner_next(&scanner, &token);
if (rc == VEC0_TOKEN_RESULT_EOF) { if (rc == VEC0_TOKEN_RESULT_EOF) {
break; break;
@ -2099,7 +2099,7 @@ int parse_vector_column(const char *source, int source_length,
return SQLITE_ERROR; return SQLITE_ERROR;
} }
// distance_metric value, an identifer (L2, cosine, etc) // distance_metric value, an identifier (L2, cosine, etc)
rc = vec0_scanner_next(&scanner, &token); rc = vec0_scanner_next(&scanner, &token);
if (rc != VEC0_TOKEN_RESULT_SOME && if (rc != VEC0_TOKEN_RESULT_SOME &&
token.token_type != TOKEN_TYPE_IDENTIFIER) { token.token_type != TOKEN_TYPE_IDENTIFIER) {