tursodatabase / turso-docs

Turso Documentation
https://docs.turso.tech
MIT License
11 stars 49 forks source link

Error running sqlite-vss extension #119

Closed achrafash closed 9 months ago

achrafash commented 9 months ago

Hi, thank you for building turso it looks really awesome!

I'm new to turso and trying to setup sqlite-vss, but I get this error:

Error: failed to execute SQL: select rowid, distance from vss_items where vss_search(item_embedding, (select embedding from items where rowid=5));
error code 502: 

Here's what I did, following the tutorial from the author of sqlite-vss:

  1. Created a database with extensions enabled:
    turso db create my-db --enable-extensions
  2. Created an items table and inserted data:
    create table items (
    id        text primary key,
    title     text not null,
    embedding text
    );
  3. Created a virtual table with vss:
    create virtual table vss_items using vss0(item_embedding(384));
  4. Inserted items records in the virtual table:
    insert into vss_items(rowid, item_embedding) values select rowid, embedding from items;

But now if I try to do a normal SELECT I get:

Error: failed to execute SQL: select * from vss_items limit 5;
SQLite error: bad parameter or other API misuse

And if I try to use the vss_search() function I get:

Error: failed to execute SQL: select rowid, distance from vss_items where vss_search(item_embedding, (select embedding from items where rowid=5));
error code 502: 

Any clue what could be the issue?

achrafash commented 9 months ago

Sorry wrong repo. Moved here: https://github.com/tursodatabase/libsql/issues/865#issuecomment-1885134864