add sqlite3 fts5 search example; uses the thin sqlite3-ocaml binding - #3698
Open
jonesmelton wants to merge 1 commit into
Open
add sqlite3 fts5 search example; uses the thin sqlite3-ocaml binding#3698jonesmelton wants to merge 1 commit into
jonesmelton wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cookbook example for fts5 in sqlite:
sqlite3_ocamlbindingThe choice of external content is a little tricky to balance for a small example. Internal content is simpler but not used much in practice because it duplicates the data. Contentless is common but requires manually keeping the index in sync, usually in application code, so not really appropriate for a self-contained example. External content is more complex, requiring triggers, but the logic is simple and all in sqlite. So I went with that.
There is also kind of a "minimal dependencies" vs "idiomatic OCaml" question here. In real code you'd likely use or write a library to handle the fairly low level sqlite stuff, it's a little gnarly having it right in with the queries. But this approach lets it be focused more on what sqlite3 is actually doing, rather than describing how to abstract over queries or showing off the Caqti DSL.