2shady4u / godot-sqlite

GDExtension wrapper for SQLite (Godot 4.x+)
MIT License
975 stars 83 forks source link

Full Text Search (FST5) support #183

Closed miwafoxl closed 3 months ago

miwafoxl commented 3 months ago

Reissue of https://github.com/2shady4u/godot-sqlite/issues/29

Is your feature request related to a problem? Please describe. When dealing with huge databases with bodies of text, a classic query may not perform very well. LIKE works, but it performs a full table scan to find what it wants. Sure it may not be an impact on small databases but in big databases it really may take a while.

Describe the solution you'd like I can't think of a scenerio where one would need FST5. It's really a non-core feature. If it is expensive to ship in the master branch then it would be nice to have enable-fst5 branch updated to the upcoming 4.3 update at least. I think it's a big deal because this is a powerful module and some applications may even depend on it. I say 'applications' because I can't think of a reason one needing this for a game, I ain't making no game so I don't know.

Describe alternatives you've considered There is Indexes which I believe can be created using .query() and they slighly better, and there is definetely some scenarios where an index may just be the right choice. There is also the keywords LIKE and REGEX that could work and they do work. The problem with them is that they don't offer the extra functionally of the module like weighted query and ranking functions, while also not performing quite as good in a large database.

Additional context N/A

2shady4u commented 3 months ago

Hello @miwafoxl,

I am working on it here: https://github.com/2shady4u/godot-sqlite/tree/feature/add-optional-fts5

miwafoxl commented 3 months ago

Sorry to bother, I'm not a very good GitHub user. I was looking for FST5 functionality in enable-fst5 branch and I was quite sad to see that it was for Godot 3.X only. I'm glad you did this! Where do you plan to merge the feature into?

2shady4u commented 3 months ago

Hey @miwafoxl

Support for FTS5 is now an optional flag in the build process. You can get the binaries yourself by following this new section in the REAME.md-file.

Please tell me if anything is unclear in that section and I will update it to make it more clear 😄