In this article, we review SQLite FTS5. You will learn:
SQLite FTS5 extension
context-mode reference
SQLite FTS5 extension
FTS5 is an SQLite virtual table module that provides full-text search functionality to database applications. In their most elementary form, full-text search engines allow the user to efficiently search a large collection of documents for the subset that contain one or more instances of a search term. The search functionality provided to world wide web users by Google is, among other things, a full-text search engine, as it allows users to search for all documents on the web that contain, for example, the term “fts5”.
To use FTS5, the user creates an FTS5 virtual table with one or more columns. For example:
CREATE VIRTUAL TABLE email USING fts5(sender, title, body);
I copied this above information from Overview of FTS5 section.
There’s a term that’s worth understanding here, Virtual table.
Virtual Table
I got the below content from Virtual Table Mechanism.
A virtual table is an object that is registered with an open SQLite database connection. From the perspective of an SQL statement, the virtual table object looks like any other table or view. But behind the scenes, queries and updates on a virtual table invoke callback methods of the virtual table object instead of reading and writing on the database file.
The virtual table mechanism allows an application to publish interfaces that are accessible from SQL statements as if they were tables. SQL statements can do almost anything to a virtual table that they can do to a real table, with the following exceptions:
One cannot create a trigger on a virtual table.
One cannot create additional indices on a virtual table. (Virtual tables can have indices but that must be built into the virtual table implementation. Indices cannot be added separately using CREATE INDEX statements.)
One cannot run ALTER TABLE … ADD COLUMN commands against a virtual table.
context-mode reference
Well, where I found this term? I wrote an article about How does context-mode save the context? Context mode is an MCP plugin that sandboxes tool output and indexes it into a local FTS5 store.
Context-mode achieves the “315 KB → 5.4 KB” saving by never letting raw tool output reach the model’s context window — it executes code in an isolated sandbox subprocess and only returns what the code explicitly prints (console.log, print, etc.), while the full payload either stays inside the sandbox or is persisted to an on-disk FTS5 index for on-demand retrieval.
Now you understand the context-mode reference.
About me:
Hey, my name is Ramu Narasinga. Email: ramu.narasinga@gmail.com
I spent 3+ years studying OSS codebases and wrote 400+ articles on what makes the production-grade. Now I'm putting that into practice differently - instead of writing every fix myself, I run coding agents that do it.
How it works? Register your machine as a Runtime, point it at your repo. Agents pick up issues. write the fix, open the PR. You just review, they execute.
Build your coding agents and get more work done in less time at thinkthroo.com

Top comments (0)