tursodatabase / libsql

libSQL is a fork of SQLite that is both Open Source, and Open Contributions.
https://turso.tech/libsql
MIT License
9.54k stars 252 forks source link

Vector search respect db idx #1582

Closed sivukhin closed 2 months ago

sivukhin commented 2 months ago

Context

Current code always assume that we will work with "main" database which is merely true in real life.

Not only explicit ATTACH will not work with current code, but also VACUUM INTO 't.db' will fail as internally it attaches temp DB with "vacuumed" state.

This PR carefully propagate iDb / zDbSName to vector API and work with provided schema instead of unconditionarl "main".

One caveat is that table-valued functions can't be invoked for any schema other then main - but this is a restriction of SQLite (https://www.sqlite.org/vtab.html#eponymous_virtual_tables). I guess for now this is fine.

Testing

sivukhin commented 2 months ago

Rust tests are broken due to the expired JWT token. Lucio should fix this eventually.