Closed radekosmulski closed 10 months ago
Interestingly, when I try reading from the table, I get the following error (and this is despite AFAICT I have followed the docs exactly)
Can you try also inserting a rowid into the vss table? Something like
cur.execute("insert into vss_demo(rowid, a) values (?, ?)", [1, json.dumps(embedding)])
I think there's a bug when you insert a new row without a rowid. Will look into it
(will also update the docs, which incorrectly omits the rowid)
Thank you very much for your prompt reply, really appreciate it!!! 🙂
This does indeed fix the problem 🙏🥳
Unfortunately, I cannot overwrite a row, but that is not a big issue for my use case:
To overwrite a row, you'll currently have to DELETE FROM vss_demo WHERE rowid = 4
, then insert a new row. I'll be adding UPDATE
support soon.
Thank you so much for your help, @asg017! 🙏 Really appreciate your prompt replies and guidance!
Hi, I have the same issue. What is the current best practice to insert a new row when it's not possible to know the next rowid to insert ?
I could work around something like querying the max rowid before each insertion, but doing this i'm unsure it will be safe with concurrency if another session is inserting while i'm getting the max rowid. Locking the table does not sound very practical either.
I am running into a very peculiar problem -- I cannot add more than a single row to a table... it always ends in a
OperationalError: SQL logic error
.For instance, the following code:
will throw a
OperationalError: SQL logic error
.Thank you very much for your help 🙏