Sometimes a SQLITE_DONE exception is thrown with DELETE when using better-sqlite3 and sqlite-vec >=0.1.7
Hello,
Since the v0.1.7 (v0.1.8 too) and better-sqlite3, we are facing (sometimes, 1% or less, I don't know exactly) to SQLITE_DONE exceptions when deleting rows in the vec table. I'm not able to create a small project where this problem appears, but maybe someone else encounters the same problem?!
Our table:
```
CREATE VIRTUAL TABLE IF NOT EXISTS embeddings USING vec0(
locale TEXT partition key,
scope TEXT,
documentId TEXT,
+chunkId TEXT,
+chunk TEXT,
embedding ${type}[${dimensions}] distance_metric=cosine
);
```
Query that producing sometimes these exception:
```
DELETE FROM embeddings
WHERE documentId = $documentId;
```
```
code=SQLITE_DONE: SqliteError: no more rows available
```
We must wrap the delete queries in a code like that:
```js
try {
run();
} catch (ex) {
if (ex.code !== 'SQLITE_DONE') {
throw ex;
}
}
```
That looks very strange, `SQLITE_DONE` should never produce exception and it's very difficult to reproduce. It's a new problem because the same codebase with `0.1.7-alpha.2` is working as expected.
Regards,
Mathieu
关闭于 2026-03-31 3 条评论