Closed skiz closed 2 months ago
Hi @skiz,
Indeed Litesearch relies heavily on rowid, but I will be looking into relaxing this requirement and try to find a way to map composite keys as well
Hi @skiz I have been looking at this issue, and there doesn't seem to be an effective solution to it, at least not one that would be less expensive than having a rowid field in the original table
happy to discuss this in more detail if you like
Hi!
I had the same issue here (the one in the subject, not the WITHOUT ROWID tables) and making liteserach rely in the rowid
works for me: https://github.com/oldmoe/litestack/pull/117
Hi @gabriel-curtino, I was hesitant from relying on rowid because historically SQLite used to reassign these after a vacuum. This doesn't seem to be the case for recent versions, I will verify this and integrate this enhancement if it turns out rowids are stable now.
Hi @gabriel-curtino, I was hesitant from relying on rowid because historically SQLite used to reassign these after a vacuum. This doesn't seem to be the case for recent versions, I will verify this and integrate this enhancement if it turns out rowids are stable now.
Interesting, I've missed that. I researched about the rowid after seeing it was being used for the backed schema triggers.
Wondering if rebuilding the index after vacuum would be an issue thinking that it might not be usual to vacuum the db used in a webapp and it's seems prettry straighforward unless you've some kind of complex standalone index.
I still think that it worth to support any kind of primary key (or no primary-key) over having to rebuild the index after vacuum.
I have merged the PR already, and I believe requiring a rebuild after a vacuum is something we can live with. Other than that, I don't think there is much we can do for without rowid tables, I will close this issue as not planned
Given a schema with a TEXT primary key, litesearch cannot index these tables. This negates the ability to use this with UUIDS or other generated ids.
Attempting to dig in to the issues, I found that it also heavily relies on ROWID, so any tables using WITHOUT ROWID are also not able to be indexed (which generally are TEXT pkeys).
I may be able to look in to this further and add support, but also wanted to get some feedback in case theres no way it will be able to work, or has already been discussed.